Madan Jampani | 393e0f0 | 2015-02-12 07:35:39 +0530 | [diff] [blame] | 1 | package org.onosproject.store.service; |
| 2 | |
| 3 | /** |
| 4 | * Storage service. |
| 5 | * <p> |
| 6 | * This service provides operations for creating key-value stores. |
| 7 | * One can chose to create key-value stores with varying properties such |
| 8 | * as strongly consistent vs eventually consistent, durable vs volatile. |
| 9 | * <p> |
| 10 | * Various store implementations should leverage the data structures provided |
| 11 | * by this service |
| 12 | */ |
| 13 | public interface StorageService { |
| 14 | |
| 15 | /** |
| 16 | * Creates a ConsistentMap. |
| 17 | * |
| 18 | * @param name map name |
| 19 | * @param serializer serializer to use for serializing keys and values. |
| 20 | * @return consistent map. |
| 21 | * @param <K> key type |
| 22 | * @param <V> value type |
| 23 | */ |
| 24 | <K, V> ConsistentMap<K , V> createConsistentMap(String name, Serializer serializer); |
| 25 | |
| 26 | // TODO: add API for creating Eventually Consistent Map. |
| 27 | } |