T - public abstract class ZooKeeperDataCache<T> extends Object implements ZooKeeperCache.Deserializer<T>, ZooKeeperCache.CacheUpdater<T>, Watcher
Watcher.Event, Watcher.WatcherType| Constructor and Description |
|---|
ZooKeeperDataCache(ZooKeeperCache cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Only for UTs (for now), as this clears the whole ZK data cache.
|
void |
close() |
Optional<T> |
get(String path)
Return an item from the cache
If node doens't exist, the value will be not present.s
|
CompletableFuture<Optional<T>> |
getAsync(String path) |
T |
getDataIfPresent(String path) |
Optional<Map.Entry<T,org.apache.zookeeper.data.Stat>> |
getWithStat(String path) |
CompletableFuture<Optional<Map.Entry<T,org.apache.zookeeper.data.Stat>>> |
getWithStatAsync(String path) |
void |
invalidate(String path) |
void |
process(WatchedEvent event) |
void |
registerListener(ZooKeeperCacheListener<T> listener) |
void |
reloadCache(String path) |
void |
unregisterListener(ZooKeeperCacheListener<T> listener) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserializepublic ZooKeeperDataCache(ZooKeeperCache cache)
public CompletableFuture<Optional<T>> getAsync(String path)
public CompletableFuture<Optional<Map.Entry<T,org.apache.zookeeper.data.Stat>>> getWithStatAsync(String path)
public Optional<T> get(String path) throws Exception
path - Exceptionpublic Optional<Map.Entry<T,org.apache.zookeeper.data.Stat>> getWithStat(String path) throws Exception
Exceptionpublic void clear()
public void invalidate(String path)
public void reloadCache(String path)
reloadCache in interface ZooKeeperCache.CacheUpdater<T>public void registerListener(ZooKeeperCacheListener<T> listener)
registerListener in interface ZooKeeperCache.CacheUpdater<T>public void unregisterListener(ZooKeeperCacheListener<T> listener)
unregisterListener in interface ZooKeeperCache.CacheUpdater<T>public void process(WatchedEvent event)
public void close()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.