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
ConstructorDescriptionZookeeperPersistentStore
(org.apache.curator.framework.CuratorFramework framework, PersistentStoreConfig<V> config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
Checks if lookup key is present in store.boolean
contains
(String key, DataChangeVersion version) Checks if lookup key is present in store.void
Removes 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 storagemode
of this store.getRange
(int skip, int take) Returns an iterator of desired number of entries offsetting by the skip value.void
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.void
start()
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:Store
Returns storagemode
of this store. -
contains
Description copied from interface:PersistentStore
Checks if lookup key is present in store.- Specified by:
contains
in interfacePersistentStore<V>
- Parameters:
key
- lookup key- Returns:
- true if store contains lookup key, false otherwise
-
contains
Description copied from interface:VersionedPersistentStore
Checks if lookup key is present in store. Sets data change version number.- Specified by:
contains
in interfaceVersionedPersistentStore<V>
- Parameters:
key
- lookup keyversion
- version holder- Returns:
- true if store contains lookup key, false otherwise
-
get
Description copied from interface:PersistentStore
Returns the value for the given key if exists, null otherwise.- Specified by:
get
in interfacePersistentStore<V>
- Parameters:
key
- lookup key
-
get
Description copied from interface:VersionedPersistentStore
Returns the value for the given key if exists, null otherwise. Sets data change version number.- Specified by:
get
in interfaceVersionedPersistentStore<V>
- Parameters:
key
- lookup keyversion
- version holder
-
get
-
put
Description copied from interface:PersistentStore
Stores the (key, value) tuple in the store. Lifetime of the tuple depends upon storemode
.- Specified by:
put
in interfacePersistentStore<V>
- Parameters:
key
- lookup keyvalue
- value to store
-
put
Description copied from interface:VersionedPersistentStore
Stores the (key, value) tuple in the store. If tuple already exits, stores it only if versions match, otherwise throwsVersionMismatchException
Lifetime of the tuple depends upon storemode
.- Specified by:
put
in interfaceVersionedPersistentStore<V>
- Parameters:
key
- lookup keyvalue
- value to storeversion
- version holder
-
putIfAbsent
Description copied from interface:Store
Stores the (key, value) tuple in the store only if it does not exists.- Specified by:
putIfAbsent
in interfaceStore<V>
- Parameters:
key
- lookup keyvalue
- value to store- Returns:
- true if put takes place, false otherwise.
-
delete
Description copied from interface:Store
Removes the value corresponding to the given key if exists, nothing happens otherwise. -
getRange
Description copied from interface:Store
Returns an iterator of desired number of entries offsetting by the skip value. -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-