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
Modifier and TypeFieldDescriptionprotected final org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
Fields inherited from class org.apache.drill.exec.coord.store.BaseTransientStore
config
-
Constructor Summary
ConstructorDescriptionZkEphemeralStore
(TransientStoreConfig<V> config, org.apache.curator.framework.CuratorFramework curator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
entries()
Returns an iterator of (key, value) tuples.protected void
fireListeners
(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 ZookeeperClient
Stores 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.int
size()
Returns number of entries.void
start()
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:TransientStore
Returns a value corresponding to the given look-up key if exists, null otherwise.- Parameters:
key
- look-up key
-
put
Description copied from interface:TransientStore
Stores 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:TransientStore
Stores 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:TransientStore
Removes 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:TransientStore
Returns an iterator of (key, value) tuples. -
size
public int size()Description copied from interface:TransientStore
Returns number of entries. -
close
- Throws:
Exception
-
fireListeners
This method override ensures package level method visibility.- Overrides:
fireListeners
in classBaseTransientStore<V>
-