Package org.cdlib.mrt.zk
Class MerrittLocks
- java.lang.Object
-
- org.cdlib.mrt.zk.MerrittLocks
-
public class MerrittLocks extends Object
Static methods to set and release Merritt Locks. Object-level locks will be ephemeral. Queue and collection level locks will be persistent.
-
-
Constructor Summary
Constructors Constructor Description MerrittLocks()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckLockCollection(org.apache.zookeeper.ZooKeeper client, String mnemonic)static booleancheckLockIngestQueue(org.apache.zookeeper.ZooKeeper client)static booleancheckLockLargeAccessQueue(org.apache.zookeeper.ZooKeeper client)static booleancheckLockObjectInventory(org.apache.zookeeper.ZooKeeper client, String ark)static booleancheckLockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark)static booleancheckLockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client)static voidinitLocks(org.apache.zookeeper.ZooKeeper client)static booleanlockCollection(org.apache.zookeeper.ZooKeeper client, String mnemonic)static booleanlockIngestQueue(org.apache.zookeeper.ZooKeeper client)static booleanlockLargeAccessQueue(org.apache.zookeeper.ZooKeeper client)static booleanlockObjectInventory(org.apache.zookeeper.ZooKeeper client, String ark)static booleanlockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark)static booleanlockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client)static voidunlockCollection(org.apache.zookeeper.ZooKeeper client, String mnemonic)static voidunlockIngestQueue(org.apache.zookeeper.ZooKeeper client)static voidunlockLargeAccessQueue(org.apache.zookeeper.ZooKeeper client)static voidunlockObjectInventory(org.apache.zookeeper.ZooKeeper client, String ark)static voidunlockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark)static voidunlockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client)
-
-
-
Method Detail
-
initLocks
public static void initLocks(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
lockIngestQueue
public static boolean lockIngestQueue(org.apache.zookeeper.ZooKeeper client)
-
unlockIngestQueue
public static void unlockIngestQueue(org.apache.zookeeper.ZooKeeper client) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
checkLockIngestQueue
public static boolean checkLockIngestQueue(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
lockLargeAccessQueue
public static boolean lockLargeAccessQueue(org.apache.zookeeper.ZooKeeper client)
-
unlockLargeAccessQueue
public static void unlockLargeAccessQueue(org.apache.zookeeper.ZooKeeper client) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
checkLockLargeAccessQueue
public static boolean checkLockLargeAccessQueue(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
lockSmallAccessQueue
public static boolean lockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client)
-
unlockSmallAccessQueue
public static void unlockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
checkLockSmallAccessQueue
public static boolean checkLockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
lockCollection
public static boolean lockCollection(org.apache.zookeeper.ZooKeeper client, String mnemonic)
-
unlockCollection
public static void unlockCollection(org.apache.zookeeper.ZooKeeper client, String mnemonic) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
checkLockCollection
public static boolean checkLockCollection(org.apache.zookeeper.ZooKeeper client, String mnemonic) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
lockObjectStorage
public static boolean lockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark)
-
unlockObjectStorage
public static void unlockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
checkLockObjectStorage
public static boolean checkLockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
lockObjectInventory
public static boolean lockObjectInventory(org.apache.zookeeper.ZooKeeper client, String ark)
-
unlockObjectInventory
public static void unlockObjectInventory(org.apache.zookeeper.ZooKeeper client, String ark) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
checkLockObjectInventory
public static boolean checkLockObjectInventory(org.apache.zookeeper.ZooKeeper client, String ark) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
-