public class ZooUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZooUtil.LockID |
static class |
ZooUtil.NodeExistsPolicy |
static class |
ZooUtil.NodeMissingPolicy |
Modifier and Type | Field and Description |
---|---|
static List<org.apache.zookeeper.data.ACL> |
PRIVATE |
static List<org.apache.zookeeper.data.ACL> |
PUBLIC |
Constructor and Description |
---|
ZooUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
exists(org.apache.zookeeper.ZooKeeper zk,
String zPath) |
static byte[] |
getData(org.apache.zookeeper.ZooKeeper zk,
String zPath,
org.apache.zookeeper.data.Stat stat) |
static byte[] |
getLockData(ZooCache zc,
String path) |
static String |
getRoot(Instance instance) |
static String |
getRoot(String instanceId) |
static org.apache.zookeeper.data.Stat |
getStatus(org.apache.zookeeper.ZooKeeper zk,
String zPath) |
static boolean |
isLockHeld(org.apache.zookeeper.ZooKeeper zk,
ZooUtil.LockID lid) |
static String |
putEphemeralSequential(org.apache.zookeeper.ZooKeeper zk,
String zPath,
byte[] data) |
static boolean |
putPersistentData(org.apache.zookeeper.ZooKeeper zk,
String zPath,
byte[] data,
int version,
ZooUtil.NodeExistsPolicy policy) |
static boolean |
putPersistentData(org.apache.zookeeper.ZooKeeper zk,
String zPath,
byte[] data,
int version,
ZooUtil.NodeExistsPolicy policy,
List<org.apache.zookeeper.data.ACL> acls) |
static boolean |
putPersistentData(org.apache.zookeeper.ZooKeeper zk,
String zPath,
byte[] data,
ZooUtil.NodeExistsPolicy policy)
Create a persistent node with the default ACL
|
static String |
putPersistentSequential(org.apache.zookeeper.ZooKeeper zk,
String zPath,
byte[] data) |
static boolean |
putPrivatePersistentData(org.apache.zookeeper.ZooKeeper zk,
String zPath,
byte[] data,
ZooUtil.NodeExistsPolicy policy) |
static void |
recursiveCopyPersistent(org.apache.zookeeper.ZooKeeper zk,
String source,
String destination,
ZooUtil.NodeExistsPolicy policy) |
static void |
recursiveDelete(org.apache.zookeeper.ZooKeeper zk,
String zPath,
int version,
ZooUtil.NodeMissingPolicy policy)
This method will delete a node and all its children from zookeeper
|
static void |
recursiveDelete(org.apache.zookeeper.ZooKeeper zk,
String zPath,
ZooUtil.NodeMissingPolicy policy) |
public static final List<org.apache.zookeeper.data.ACL> PRIVATE
public static final List<org.apache.zookeeper.data.ACL> PUBLIC
public static void recursiveDelete(org.apache.zookeeper.ZooKeeper zk, String zPath, int version, ZooUtil.NodeMissingPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
zPath
- the path to deleteorg.apache.zookeeper.KeeperException
InterruptedException
public static void recursiveDelete(org.apache.zookeeper.ZooKeeper zk, String zPath, ZooUtil.NodeMissingPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static boolean putPersistentData(org.apache.zookeeper.ZooKeeper zk, String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static boolean putPersistentData(org.apache.zookeeper.ZooKeeper zk, String zPath, byte[] data, int version, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static boolean putPersistentData(org.apache.zookeeper.ZooKeeper zk, String zPath, byte[] data, int version, ZooUtil.NodeExistsPolicy policy, List<org.apache.zookeeper.data.ACL> acls) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static byte[] getData(org.apache.zookeeper.ZooKeeper zk, String zPath, org.apache.zookeeper.data.Stat stat) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static org.apache.zookeeper.data.Stat getStatus(org.apache.zookeeper.ZooKeeper zk, String zPath) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static boolean exists(org.apache.zookeeper.ZooKeeper zk, String zPath) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static void recursiveCopyPersistent(org.apache.zookeeper.ZooKeeper zk, String source, String destination, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static boolean putPrivatePersistentData(org.apache.zookeeper.ZooKeeper zk, String zPath, byte[] data, ZooUtil.NodeExistsPolicy policy) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static String putPersistentSequential(org.apache.zookeeper.ZooKeeper zk, String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static String putEphemeralSequential(org.apache.zookeeper.ZooKeeper zk, String zPath, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static boolean isLockHeld(org.apache.zookeeper.ZooKeeper zk, ZooUtil.LockID lid) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.