Package org.apache.drill.exec.coord.zk
Class ZkEphemeralStore<V>
java.lang.Object
org.apache.drill.exec.coord.store.BaseTransientStore<V>
org.apache.drill.exec.coord.zk.ZkEphemeralStore<V>
- All Implemented Interfaces:
AutoCloseable,TransientStore<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.curator.framework.recipes.cache.PathChildrenCacheListenerFields inherited from class org.apache.drill.exec.coord.store.BaseTransientStore
config -
Constructor Summary
ConstructorsConstructorDescriptionZkEphemeralStore(TransientStoreConfig<V> config, org.apache.curator.framework.CuratorFramework curator) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()entries()Returns an iterator of (key, value) tuples.protected voidfireListeners(TransientStoreEvent event) This method override ensures package level method visibility.Returns a value corresponding to the given look-up key if exists, null otherwise.protected ZookeeperClientStores the given (key, value) in this store overriding the existing value.putIfAbsent(String key, V value) Stores the given (key, value) tuple in this store only if it does not exists.Removes the (key, value) tuple from this store if the key exists.intsize()Returns number of entries.voidstart()Methods inherited from class org.apache.drill.exec.coord.store.BaseTransientStore
addListener, getConfig, keys, removeListener, values
-
Field Details
-
dispatcher
protected final org.apache.curator.framework.recipes.cache.PathChildrenCacheListener dispatcher
-
-
Constructor Details
-
ZkEphemeralStore
public ZkEphemeralStore(TransientStoreConfig<V> config, org.apache.curator.framework.CuratorFramework curator)
-
-
Method Details
-
start
- Throws:
Exception
-
getClient
-
get
Description copied from interface:TransientStoreReturns a value corresponding to the given look-up key if exists, null otherwise.- Parameters:
key- look-up key
-
put
Description copied from interface:TransientStoreStores the given (key, value) in this store overriding the existing value.- Parameters:
key- look-up keyvalue- value to store- Returns:
- the old value if the key exists, null otherwise
-
putIfAbsent
Description copied from interface:TransientStoreStores the given (key, value) tuple in this store only if it does not exists.- Parameters:
key- look-up keyvalue- value to store- Returns:
- the old value if the key exists, null otherwise
-
remove
Description copied from interface:TransientStoreRemoves the (key, value) tuple from this store if the key exists.- Parameters:
key- look-up key- Returns:
- the removed value if key exists, null otherwise
-
entries
Description copied from interface:TransientStoreReturns an iterator of (key, value) tuples. -
size
public int size()Description copied from interface:TransientStoreReturns number of entries. -
close
- Throws:
Exception
-
fireListeners
This method override ensures package level method visibility.- Overrides:
fireListenersin classBaseTransientStore<V>
-