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 String
static String
createEphemeral
(org.apache.zookeeper.ZooKeeper client, String path, byte[] data) static String
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
static void
static boolean
static String
now()
static String
pathToString
(org.apache.zookeeper.ZooKeeper client, String path) static String
static 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.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
-
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.KeeperException
InterruptedException
-
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
-