Interface LockStatus
- All Known Implementing Classes:
LockAndQueue
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 Summary
Modifier and TypeMethodDescriptiondefault String
Procedure<?>
Get the procedure which holds the exclusive lock.default long
Return the id of the procedure which holds the exclusive lock, if exists.int
Get the number of procedures which hold the shared lock.boolean
Whether the exclusive lock has been held.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.default boolean
isLocked()
Return whether this lock has already been held,
-
Method Details
-
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 tohasExclusiveLock() || getSharedLockCount() > 0
. -
hasExclusiveLock
boolean hasExclusiveLock()Whether the exclusive lock has been held. -
hasLockAccess
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. -
describeLockStatus
-