Class ZookeeperPersistentStore<V>
java.lang.Object
org.apache.drill.exec.store.sys.BasePersistentStore<V>
org.apache.drill.exec.store.sys.store.ZookeeperPersistentStore<V>
- All Implemented Interfaces:
AutoCloseable,PersistentStore<V>,Store<V>,VersionedPersistentStore<V>
public class ZookeeperPersistentStore<V>
extends BasePersistentStore<V>
implements VersionedPersistentStore<V>
Zookeeper based implementation of
PersistentStore.-
Constructor Summary
ConstructorsConstructorDescriptionZookeeperPersistentStore(org.apache.curator.framework.CuratorFramework framework, PersistentStoreConfig<V> config) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanChecks if lookup key is present in store.booleancontains(String key, DataChangeVersion version) Checks if lookup key is present in store.voidRemoves the value corresponding to the given key if exists, nothing happens otherwise.Returns the value for the given key if exists, null otherwise.get(String key, boolean consistencyFlag, DataChangeVersion version) get(String key, DataChangeVersion version) Returns the value for the given key if exists, null otherwise.getMode()Returns storagemodeof this store.getRange(int skip, int take) Returns an iterator of desired number of entries offsetting by the skip value.voidStores the (key, value) tuple in the store.voidput(String key, V value, DataChangeVersion version) Stores the (key, value) tuple in the store.booleanputIfAbsent(String key, V value) Stores the (key, value) tuple in the store only if it does not exists.voidstart()Methods inherited from class org.apache.drill.exec.store.sys.BasePersistentStore
getAll
-
Constructor Details
-
ZookeeperPersistentStore
public ZookeeperPersistentStore(org.apache.curator.framework.CuratorFramework framework, PersistentStoreConfig<V> config) throws StoreException - Throws:
StoreException
-
-
Method Details
-
start
- Throws:
Exception
-
getMode
Description copied from interface:StoreReturns storagemodeof this store. -
contains
Description copied from interface:PersistentStoreChecks if lookup key is present in store.- Specified by:
containsin interfacePersistentStore<V>- Parameters:
key- lookup key- Returns:
- true if store contains lookup key, false otherwise
-
contains
Description copied from interface:VersionedPersistentStoreChecks if lookup key is present in store. Sets data change version number.- Specified by:
containsin interfaceVersionedPersistentStore<V>- Parameters:
key- lookup keyversion- version holder- Returns:
- true if store contains lookup key, false otherwise
-
get
Description copied from interface:PersistentStoreReturns the value for the given key if exists, null otherwise.- Specified by:
getin interfacePersistentStore<V>- Parameters:
key- lookup key
-
get
Description copied from interface:VersionedPersistentStoreReturns the value for the given key if exists, null otherwise. Sets data change version number.- Specified by:
getin interfaceVersionedPersistentStore<V>- Parameters:
key- lookup keyversion- version holder
-
get
-
put
Description copied from interface:PersistentStoreStores the (key, value) tuple in the store. Lifetime of the tuple depends upon storemode.- Specified by:
putin interfacePersistentStore<V>- Parameters:
key- lookup keyvalue- value to store
-
put
Description copied from interface:VersionedPersistentStoreStores the (key, value) tuple in the store. If tuple already exits, stores it only if versions match, otherwise throwsVersionMismatchExceptionLifetime of the tuple depends upon storemode.- Specified by:
putin interfaceVersionedPersistentStore<V>- Parameters:
key- lookup keyvalue- value to storeversion- version holder
-
putIfAbsent
Description copied from interface:StoreStores the (key, value) tuple in the store only if it does not exists.- Specified by:
putIfAbsentin interfaceStore<V>- Parameters:
key- lookup keyvalue- value to store- Returns:
- true if put takes place, false otherwise.
-
delete
Description copied from interface:StoreRemoves the value corresponding to the given key if exists, nothing happens otherwise. -
getRange
Description copied from interface:StoreReturns an iterator of desired number of entries offsetting by the skip value. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-