Package org.cdlib.mrt.zk
Class QueueItemHelper
java.lang.Object
org.cdlib.mrt.zk.QueueItemHelper
The static methods in this class also provides a simplified interface for common ZooKeeper API calls.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]static Stringstatic StringcreateEphemeral(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) static Stringstatic voidcreateIfNeeded(org.apache.zookeeper.ZooKeeper client, String path) static voidcreateIfNeededForgiving(org.apache.zookeeper.ZooKeeper client, String path) static StringcreateSequential(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) static voidstatic voidstatic booleanstatic Stringnow()static StringpathToString(org.apache.zookeeper.ZooKeeper client, String path) static Stringstatic byte[]serializeAsBytes(Object data) static void
-
Field Details
-
acl
-
empty
public static final byte[] empty
-
-
Constructor Details
-
QueueItemHelper
public QueueItemHelper()
-
-
Method Details
-
exists
public static boolean exists(org.apache.zookeeper.ZooKeeper client, String p) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
pathToString
public static String pathToString(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
serialize
-
asBytes
-
serializeAsBytes
-
createId
public static String createId(org.apache.zookeeper.ZooKeeper client, String prefix) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
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.KeeperExceptionInterruptedException
-
createSequential
public static String createSequential(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
createEphemeral
public static String createEphemeral(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
setData
public static void setData(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
delete
public static void delete(org.apache.zookeeper.ZooKeeper client, String p) throws InterruptedException, org.apache.zookeeper.KeeperException - Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
deleteAll
public static void deleteAll(org.apache.zookeeper.ZooKeeper client, String p) throws InterruptedException, org.apache.zookeeper.KeeperException - Throws:
InterruptedExceptionorg.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.KeeperExceptionInterruptedException
-
createIfNeededForgiving
public static void createIfNeededForgiving(org.apache.zookeeper.ZooKeeper client, String path) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-