Package com.yahoo.vespa.curator.stats
Class LockAttempt
- java.lang.Object
-
- com.yahoo.vespa.curator.stats.LockAttempt
-
public class LockAttempt extends java.lang.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LockAttempt.LockState
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fillStackTrace()
Fill in the stack trace starting at the caller's stack frame.java.time.Duration
getAcquireTimeout()
java.time.Duration
getDuration()
java.time.Duration
getDurationOfAcquire()
java.time.Duration
getDurationWithLock()
java.lang.String
getLockPath()
LockAttempt.LockState
getLockState()
java.util.List<LockAttempt>
getNestedLockAttempts()
boolean
getReentry()
java.time.Duration
getStableTotalDuration()
Get time from just before trying to acquire lock to the time the terminal state was reached, or ZERO.java.util.Optional<java.lang.String>
getStackTrace()
java.lang.String
getThreadName()
java.time.Instant
getTimeAcquiredWasInvoked()
java.time.Instant
getTimeAcquireEndedOrNow()
java.util.Optional<java.time.Instant>
getTimeLockWasAcquired()
java.util.Optional<java.time.Instant>
getTimeTerminalStateWasReached()
static LockAttempt
invokingAcquire(ThreadLockStats threadLockStats, java.lang.String lockPath, java.time.Duration timeout, LockMetrics lockMetrics, boolean reentry)
boolean
isAcquiring()
-
-
-
Method Detail
-
invokingAcquire
public static LockAttempt invokingAcquire(ThreadLockStats threadLockStats, java.lang.String lockPath, java.time.Duration timeout, LockMetrics lockMetrics, boolean reentry)
-
getThreadName
public java.lang.String getThreadName()
-
getLockPath
public java.lang.String getLockPath()
-
getTimeAcquiredWasInvoked
public java.time.Instant getTimeAcquiredWasInvoked()
-
getAcquireTimeout
public java.time.Duration getAcquireTimeout()
-
getReentry
public boolean getReentry()
-
getLockState
public LockAttempt.LockState getLockState()
-
getTimeLockWasAcquired
public java.util.Optional<java.time.Instant> getTimeLockWasAcquired()
-
isAcquiring
public boolean isAcquiring()
-
getTimeAcquireEndedOrNow
public java.time.Instant getTimeAcquireEndedOrNow()
-
getTimeTerminalStateWasReached
public java.util.Optional<java.time.Instant> getTimeTerminalStateWasReached()
-
getStackTrace
public java.util.Optional<java.lang.String> getStackTrace()
-
getNestedLockAttempts
public java.util.List<LockAttempt> getNestedLockAttempts()
-
getDurationOfAcquire
public java.time.Duration getDurationOfAcquire()
-
getDurationWithLock
public java.time.Duration getDurationWithLock()
-
getDuration
public java.time.Duration getDuration()
-
getStableTotalDuration
public java.time.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.
-
-