public class ZookeeperPersistentStore<V> extends BasePersistentStore<V>
PersistentStore.| Constructor and Description |
|---|
ZookeeperPersistentStore(org.apache.curator.framework.CuratorFramework framework,
PersistentStoreConfig<V> config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
contains(String key)
Checks if lookup key is present in store.
|
boolean |
contains(String key,
DataChangeVersion version)
By default contains with version will behave the same way as without version.
|
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,
boolean consistencyFlag,
DataChangeVersion version) |
V |
get(String key,
DataChangeVersion version)
By default get with version will behave the same way as without version.
|
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)
By default put with version will behave the same way as without version.
|
boolean |
putIfAbsent(String key,
V value)
Stores the (key, value) tuple in the store only if it does not exists.
|
void |
start() |
getAllpublic ZookeeperPersistentStore(org.apache.curator.framework.CuratorFramework framework,
PersistentStoreConfig<V> config)
throws StoreException
StoreExceptionpublic PersistentStoreMode getMode()
PersistentStoremode of this store.public boolean contains(String key)
PersistentStorekey - lookup keypublic boolean contains(String key, DataChangeVersion version)
BasePersistentStorecontains in interface PersistentStore<V>contains in class BasePersistentStore<V>key - lookup keyversion - version holderpublic V get(String key)
PersistentStorekey - lookup keypublic V get(String key, DataChangeVersion version)
BasePersistentStoreget in interface PersistentStore<V>get in class BasePersistentStore<V>key - lookup keyversion - version holderpublic V get(String key, boolean consistencyFlag, DataChangeVersion version)
public void put(String key, V value)
PersistentStoremode.key - lookup keyvalue - value to storepublic void put(String key, V value, DataChangeVersion version)
BasePersistentStoreput in interface PersistentStore<V>put in class BasePersistentStore<V>key - lookup keyvalue - value to storeversion - version holderpublic boolean putIfAbsent(String key, V value)
PersistentStorekey - lookup keyvalue - value to storepublic void delete(String key)
PersistentStorekey - lookup keypublic Iterator<Map.Entry<String,V>> getRange(int skip, int take)
PersistentStoreskip - number of records to skip from beginningtake - max number of records to returnpublic void close()
Copyright © 2017 The Apache Software Foundation. All rights reserved.