org.apache.accumulo.fate.zookeeper
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.
|
protected void |
copyStats(org.apache.zookeeper.data.Stat userStat,
org.apache.zookeeper.data.Stat cachedStat)
Helper method to copy stats from the cached stat into userStat
|
byte[] |
get(String zPath)
Gets data at the given path.
|
byte[] |
get(String zPath,
org.apache.zookeeper.data.Stat status)
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 status)
Stat object. A watch is established by this call.zPath - path to getstatus - status object to populateprotected void copyStats(org.apache.zookeeper.data.Stat userStat,
org.apache.zookeeper.data.Stat cachedStat)
userStat - user Stat objectcachedStat - cached statistic, that is or will be cachedpublic void clear()
public void clear(String zPath)
zPath - path of top node@Deprecated public static ZooCache getInstance(String zooKeepers, int sessionTimeout)
ZooCacheFactory instead.Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.