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 boolean
checkLockCollection
(org.apache.zookeeper.ZooKeeper client, String mnemonic) static boolean
checkLockIngestQueue
(org.apache.zookeeper.ZooKeeper client) static boolean
checkLockLargeAccessQueue
(org.apache.zookeeper.ZooKeeper client) static boolean
checkLockObjectInventory
(org.apache.zookeeper.ZooKeeper client, String ark) static boolean
checkLockObjectLocalID
(org.apache.zookeeper.ZooKeeper client, String lid) static boolean
checkLockObjectStorage
(org.apache.zookeeper.ZooKeeper client, String ark) static boolean
checkLockSmallAccessQueue
(org.apache.zookeeper.ZooKeeper client) static void
initLocks
(org.apache.zookeeper.ZooKeeper client) static boolean
lockCollection
(org.apache.zookeeper.ZooKeeper client, String mnemonic) static boolean
lockIngestQueue
(org.apache.zookeeper.ZooKeeper client) static boolean
lockLargeAccessQueue
(org.apache.zookeeper.ZooKeeper client) static boolean
lockObjectInventory
(org.apache.zookeeper.ZooKeeper client, String ark) static boolean
lockObjectLocalID
(org.apache.zookeeper.ZooKeeper client, String lid) static boolean
lockObjectStorage
(org.apache.zookeeper.ZooKeeper client, String ark) static boolean
lockSmallAccessQueue
(org.apache.zookeeper.ZooKeeper client) static void
unlockCollection
(org.apache.zookeeper.ZooKeeper client, String mnemonic) static void
unlockIngestQueue
(org.apache.zookeeper.ZooKeeper client) static void
unlockLargeAccessQueue
(org.apache.zookeeper.ZooKeeper client) static void
unlockObjectInventory
(org.apache.zookeeper.ZooKeeper client, String ark) static void
unlockObjectLocalID
(org.apache.zookeeper.ZooKeeper client, String lid) static void
unlockObjectStorage
(org.apache.zookeeper.ZooKeeper client, String ark) static void
unlockSmallAccessQueue
(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.KeeperException
InterruptedException
-
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:
InterruptedException
org.apache.zookeeper.KeeperException
-
checkLockIngestQueue
public static boolean checkLockIngestQueue(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
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:
InterruptedException
org.apache.zookeeper.KeeperException
-
checkLockLargeAccessQueue
public static boolean checkLockLargeAccessQueue(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
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:
InterruptedException
org.apache.zookeeper.KeeperException
-
checkLockSmallAccessQueue
public static boolean checkLockSmallAccessQueue(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
lockCollection
-
unlockCollection
public static void unlockCollection(org.apache.zookeeper.ZooKeeper client, String mnemonic) throws InterruptedException, org.apache.zookeeper.KeeperException - Throws:
InterruptedException
org.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.KeeperException
InterruptedException
-
lockObjectLocalID
-
unlockObjectLocalID
public static void unlockObjectLocalID(org.apache.zookeeper.ZooKeeper client, String lid) throws InterruptedException, org.apache.zookeeper.KeeperException - Throws:
InterruptedException
org.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.KeeperException
InterruptedException
-
lockObjectStorage
-
unlockObjectStorage
public static void unlockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark) throws InterruptedException, org.apache.zookeeper.KeeperException - Throws:
InterruptedException
org.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.KeeperException
InterruptedException
-
lockObjectInventory
-
unlockObjectInventory
public static void unlockObjectInventory(org.apache.zookeeper.ZooKeeper client, String ark) throws InterruptedException, org.apache.zookeeper.KeeperException - Throws:
InterruptedException
org.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.KeeperException
InterruptedException
-