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 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

      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
    • lockObjectLocalID

      public static boolean lockObjectLocalID(org.apache.zookeeper.ZooKeeper client, String lid)
    • 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

      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