Package org.cdlib.mrt.zk
Class MerrittLocks
java.lang.Object
org.cdlib.mrt.zk.MerrittLocks
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 booleancheckLockObjectLocalID(org.apache.zookeeper.ZooKeeper client, String lid) 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 booleanlockObjectLocalID(org.apache.zookeeper.ZooKeeper client, String lid) 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 voidunlockObjectLocalID(org.apache.zookeeper.ZooKeeper client, String lid) static voidunlockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark) static voidunlockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client)
-
Constructor Details
-
MerrittLocks
public MerrittLocks()
-
-
Method Details
-
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
-
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
-
lockObjectLocalID
-
unlockObjectLocalID
public static void unlockObjectLocalID(org.apache.zookeeper.ZooKeeper client, String lid) throws InterruptedException, org.apache.zookeeper.KeeperException - Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
checkLockObjectLocalID
public static boolean checkLockObjectLocalID(org.apache.zookeeper.ZooKeeper client, String lid) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
lockObjectStorage
-
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
-
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
-