Package org.cdlib.mrt.zk
Class QueueItemHelper
- java.lang.Object
-
- org.cdlib.mrt.zk.QueueItemHelper
-
public class QueueItemHelper extends Object
The static methods in this class also provides a simplified interface for common ZooKeeper API calls.
-
-
Constructor Summary
Constructors Constructor Description QueueItemHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
asBytes(String s)
static String
create(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)
static String
createEphemeral(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)
static String
createId(org.apache.zookeeper.ZooKeeper client, String prefix)
static void
createIfNeeded(org.apache.zookeeper.ZooKeeper client, String path)
static void
createIfNeededForgiving(org.apache.zookeeper.ZooKeeper client, String path)
static String
createSequential(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)
static void
delete(org.apache.zookeeper.ZooKeeper client, String p)
static void
deleteAll(org.apache.zookeeper.ZooKeeper client, String p)
static boolean
exists(org.apache.zookeeper.ZooKeeper client, String p)
static String
now()
static String
pathToString(org.apache.zookeeper.ZooKeeper client, String path)
static String
serialize(Object data)
static byte[]
serializeAsBytes(Object data)
static void
setData(org.apache.zookeeper.ZooKeeper client, String path, byte[] data)
-
-
-
Field Detail
-
acl
public static final List<org.apache.zookeeper.data.ACL> acl
-
empty
public static final byte[] empty
-
-
Method Detail
-
exists
public static boolean exists(org.apache.zookeeper.ZooKeeper client, String p) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
pathToString
public static String pathToString(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
asBytes
public static byte[] asBytes(String s)
-
serializeAsBytes
public static byte[] serializeAsBytes(Object data)
-
createId
public static String createId(org.apache.zookeeper.ZooKeeper client, String prefix) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
now
public static String now()
-
create
public static String create(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
createSequential
public static String createSequential(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
createEphemeral
public static String createEphemeral(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
setData
public static void setData(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
delete
public static void delete(org.apache.zookeeper.ZooKeeper client, String p) throws InterruptedException, org.apache.zookeeper.KeeperException
- Throws:
InterruptedException
org.apache.zookeeper.KeeperException
-
deleteAll
public static void deleteAll(org.apache.zookeeper.ZooKeeper client, String p) throws InterruptedException, org.apache.zookeeper.KeeperException
- Throws:
InterruptedException
org.apache.zookeeper.KeeperException
-
createIfNeeded
public static void createIfNeeded(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
createIfNeededForgiving
public static void createIfNeededForgiving(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
-