public class ZooCache extends Object
| Constructor and Description |
|---|
ZooCache(String zooKeepers,
int sessionTimeout)
Creates a new cache.
|
ZooCache(String zooKeepers,
int sessionTimeout,
org.apache.zookeeper.Watcher watcher)
Creates a new cache.
|
ZooCache(ZooReader reader,
org.apache.zookeeper.Watcher watcher)
Creates a new cache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears this cache.
|
void |
clear(String zPath)
Clears this cache of all information about nodes rooted at the given path.
|
byte[] |
get(String zPath)
Gets data at the given path.
|
byte[] |
get(String zPath,
org.apache.zookeeper.data.Stat stat)
Gets data at the given path, filling status information into the given
Stat object. |
List<String> |
getChildren(String zPath)
Gets the children of the given node.
|
static ZooCache |
getInstance(String zooKeepers,
int sessionTimeout)
Deprecated.
Use
ZooCacheFactory instead. |
public ZooCache(String zooKeepers, int sessionTimeout)
zooKeepers - comma-separated list of ZooKeeper host[:port]ssessionTimeout - ZooKeeper session timeoutpublic ZooCache(String zooKeepers, int sessionTimeout, org.apache.zookeeper.Watcher watcher)
zooKeepers - comma-separated list of ZooKeeper host[:port]ssessionTimeout - ZooKeeper session timeoutwatcher - watcher objectpublic ZooCache(ZooReader reader, org.apache.zookeeper.Watcher watcher)
reader - ZooKeeper readerwatcher - watcher objectpublic List<String> getChildren(String zPath)
zPath - path of nodepublic byte[] get(String zPath)
zPath - path to getpublic byte[] get(String zPath, org.apache.zookeeper.data.Stat stat)
Stat object. A watch is established by this call.zPath - path to getstat - status object to populatepublic void clear()
public void clear(String zPath)
zPath - path of top node@Deprecated public static ZooCache getInstance(String zooKeepers, int sessionTimeout)
ZooCacheFactory instead.Copyright © 2014 Apache Accumulo Project. All rights reserved.