Interface LockStatus

All Known Implementing Classes:
LockAndQueue

@Private public interface LockStatus
Interface to get status of a Lock without getting access to acquire/release lock. Currently used in MasterProcedureScheduler where we want to give Queues access to lock's status for scheduling purposes, but not the ability to acquire/release it.
  • Method Details

    • isLocked

      default boolean isLocked()
      Return whether this lock has already been held,

      Notice that, holding the exclusive lock or shared lock are both considered as locked, i.e, this method usually equals to hasExclusiveLock() || getSharedLockCount() > 0.

    • hasExclusiveLock

      boolean hasExclusiveLock()
      Whether the exclusive lock has been held.
    • hasLockAccess

      boolean hasLockAccess(Procedure<?> proc)
      Return true if the procedure itself holds the exclusive lock, or any ancestors of the give procedure hold the exclusive lock.
    • getExclusiveLockOwnerProcedure

      Get the procedure which holds the exclusive lock.
    • getExclusiveLockProcIdOwner

      Return the id of the procedure which holds the exclusive lock, if exists. Or a negative value which means no one holds the exclusive lock.

      Notice that, in HBase, we assume that the procedure id is positive, or at least non-negative.

    • getSharedLockCount

      Get the number of procedures which hold the shared lock.
    • describeLockStatus