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 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
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
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
unlockObjectStorage(org.apache.zookeeper.ZooKeeper client, String ark)
static void
unlockSmallAccessQueue(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.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
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:
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
-
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:
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
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:
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
-
-