Class LockAttempt

java.lang.Object
com.yahoo.vespa.curator.stats.LockAttempt

public class LockAttempt extends Object
Information about a lock.

Should be mutated by a single thread, except fillStackTrace() which can be invoked by any threads. Other threads may see an inconsistent state of this instance.

Author:
hakon
  • Method Details

    • invokingAcquire

      public static LockAttempt invokingAcquire(ThreadLockStats threadLockStats, String lockPath, Duration timeout, LockMetrics lockMetrics, boolean reentry)
    • getThreadName

      public String getThreadName()
    • getLockPath

      public String getLockPath()
    • getTimeAcquiredWasInvoked

      public Instant getTimeAcquiredWasInvoked()
    • getAcquireTimeout

      public Duration getAcquireTimeout()
    • isReentry

      public boolean isReentry()
    • getLockState

      public LockAttempt.LockState getLockState()
    • getTimeLockWasAcquired

      public Optional<Instant> getTimeLockWasAcquired()
    • isAcquiring

      public boolean isAcquiring()
    • getTimeAcquireEndedOrNow

      public Instant getTimeAcquireEndedOrNow()
    • getTimeTerminalStateWasReached

      public Optional<Instant> getTimeTerminalStateWasReached()
    • getStackTrace

      public Optional<String> getStackTrace()
    • getNestedLockAttempts

      public List<LockAttempt> getNestedLockAttempts()
    • getDurationOfAcquire

      public Duration getDurationOfAcquire()
    • getDurationWithLock

      public Duration getDurationWithLock()
    • getDuration

      public Duration getDuration()
    • getStableTotalDuration

      public Duration getStableTotalDuration()
      Get time from just before trying to acquire lock to the time the terminal state was reached, or ZERO.
    • fillStackTrace

      public void fillStackTrace()
      Fill in the stack trace starting at the caller's stack frame.