public class ZkEphemeralStore<V> extends BaseTransientStore<V>
Modifier and Type | Field and Description |
---|---|
protected org.apache.curator.framework.recipes.cache.PathChildrenCacheListener |
dispatcher |
config
Constructor and Description |
---|
ZkEphemeralStore(TransientStoreConfig<V> config,
org.apache.curator.framework.CuratorFramework curator) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Iterator<Map.Entry<String,V>> |
entries()
Returns an iterator of (key, value) tuples.
|
protected void |
fireListeners(TransientStoreEvent event)
This method override ensures package level method visibility.
|
V |
get(String key)
Returns a value corresponding to the given look-up key if exists, null otherwise.
|
protected ZookeeperClient |
getClient() |
V |
put(String key,
V value)
Stores the given (key, value) in this store overriding the existing value.
|
V |
putIfAbsent(String key,
V value)
Stores the given (key, value) tuple in this store only if it does not exists.
|
V |
remove(String key)
Removes the (key, value) tuple from this store if the key exists.
|
int |
size()
Returns number of entries.
|
void |
start() |
addListener, getConfig, keys, removeListener, values
protected final org.apache.curator.framework.recipes.cache.PathChildrenCacheListener dispatcher
public ZkEphemeralStore(TransientStoreConfig<V> config, org.apache.curator.framework.CuratorFramework curator)
protected ZookeeperClient getClient()
public V get(String key)
TransientStore
key
- look-up keypublic V put(String key, V value)
TransientStore
key
- look-up keyvalue
- value to storepublic V putIfAbsent(String key, V value)
TransientStore
key
- look-up keyvalue
- value to storepublic V remove(String key)
TransientStore
key
- look-up keypublic Iterator<Map.Entry<String,V>> entries()
TransientStore
public int size()
TransientStore
protected void fireListeners(TransientStoreEvent event)
fireListeners
in class BaseTransientStore<V>
Copyright © 1970 The Apache Software Foundation. All rights reserved.