V - value typepublic interface PersistentStore<V> extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String key)
Checks if lookup key is present in store.
|
boolean |
contains(String key,
DataChangeVersion version)
Checks if lookup key is present in store.
|
void |
delete(String key)
Removes the value corresponding to the given key if exists, nothing happens otherwise.
|
V |
get(String key)
Returns the value for the given key if exists, null otherwise.
|
V |
get(String key,
DataChangeVersion version)
Returns the value for the given key if exists, null otherwise.
|
Iterator<Map.Entry<String,V>> |
getAll()
Returns an iterator of entries.
|
PersistentStoreMode |
getMode()
Returns storage
mode of this store. |
Iterator<Map.Entry<String,V>> |
getRange(int skip,
int take)
Returns an iterator of desired number of entries offsetting by the skip value.
|
void |
put(String key,
V value)
Stores the (key, value) tuple in the store.
|
void |
put(String key,
V value,
DataChangeVersion version)
Stores the (key, value) tuple in the store.
|
boolean |
putIfAbsent(String key,
V value)
Stores the (key, value) tuple in the store only if it does not exists.
|
closePersistentStoreMode getMode()
mode of this store.boolean contains(String key)
key - lookup keyboolean contains(String key, DataChangeVersion version)
key - lookup keyversion - version holderV get(String key)
key - lookup keyV get(String key, DataChangeVersion version)
key - lookup keyversion - version holdervoid put(String key, V value)
mode.key - lookup keyvalue - value to storevoid put(String key, V value, DataChangeVersion version)
VersionMismatchException
Lifetime of the tuple depends upon store mode.key - lookup keyvalue - value to storeversion - version holdervoid delete(String key)
key - lookup keyboolean putIfAbsent(String key, V value)
key - lookup keyvalue - value to storeIterator<Map.Entry<String,V>> getRange(int skip, int take)
skip - number of records to skip from beginningtake - max number of records to returnCopyright © 2017 The Apache Software Foundation. All rights reserved.