Interface ManagedClusterLock

All Superinterfaces:
ClusterLock, Lock

public interface ManagedClusterLock extends ClusterLock
Decorates a cluster lock with management concerns, such as its name and statistics.
Since:
v0.2
  • Method Details

    • getName

      @Nonnull String getName()
      Returns the name of this cluster lock. This is the same name that was supplied to ClusterLockService.getLockForName(String).
      Returns:
      the name of this cluster lock.
    • isLocked

      boolean isLocked()
      Returns:
      true if any thread on any node holds this lock and false otherwise
    • getStatistics

      @Nonnull Map<StatisticsKey,Long> getStatistics()
      Returns the currently available statistics for this lock.

      Callers should generally make no assumptions about what statistics are available or what they mean, and this is likely to vary with the implementation.

      Returns:
      a map of statistics keys to their values, in no particular order
    • getClusterLockStatus

      @Nonnull ClusterLockStatus getClusterLockStatus()
      Returns the status of this lock.

      Callers must be aware that not all implementations can return a valid update time of the lock.

      Returns:
      a ClusterLockStatus for this lock