Package com.yahoo.vespa.curator.stats
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
-
-
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.Duration
getAcquireTimeout()
Duration
getDuration()
Duration
getDurationOfAcquire()
Duration
getDurationWithLock()
String
getLockPath()
LockAttempt.LockState
getLockState()
List<LockAttempt>
getNestedLockAttempts()
boolean
getReentry()
Duration
getStableTotalDuration()
Get time from just before trying to acquire lock to the time the terminal state was reached, or ZERO.Optional<String>
getStackTrace()
String
getThreadName()
Instant
getTimeAcquiredWasInvoked()
Instant
getTimeAcquireEndedOrNow()
Optional<Instant>
getTimeLockWasAcquired()
Optional<Instant>
getTimeTerminalStateWasReached()
static LockAttempt
invokingAcquire(ThreadLockStats threadLockStats, String lockPath, Duration timeout, LockMetrics lockMetrics, boolean reentry)
boolean
isAcquiring()
-
-
-
Method Detail
-
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()
-
getReentry
public boolean getReentry()
-
getLockState
public LockAttempt.LockState getLockState()
-
isAcquiring
public boolean isAcquiring()
-
getTimeAcquireEndedOrNow
public Instant getTimeAcquireEndedOrNow()
-
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.
-
-