Package org.apache.cassandra.utils
Class MonotonicClock.SampledClock
- java.lang.Object
-
- org.apache.cassandra.utils.MonotonicClock.SampledClock
-
- All Implemented Interfaces:
MonotonicClock
- Enclosing interface:
- MonotonicClock
public static class MonotonicClock.SampledClock extends java.lang.Object implements MonotonicClock
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.MonotonicClock
MonotonicClock.AbstractEpochSamplingClock, MonotonicClock.Global, MonotonicClock.SampledClock, MonotonicClock.SystemClock
-
-
Constructor Summary
Constructors Constructor Description SampledClock(MonotonicClock precise)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
error()
boolean
isAfter(long instant)
boolean
isAfter(long now, long instant)
long
now()
void
pauseNowSampling()
void
refreshNow()
void
resumeNowSampling()
MonotonicClockTranslation
translate()
-
-
-
Constructor Detail
-
SampledClock
public SampledClock(MonotonicClock precise)
-
-
Method Detail
-
now
public long now()
- Specified by:
now
in interfaceMonotonicClock
- See Also:
Provides a monotonic time that can be compared with any other such value produced by the same clock since the application started only; these times cannot be persisted or serialized to other nodes. Nanosecond precision.
-
error
public long error()
- Specified by:
error
in interfaceMonotonicClock
- Returns:
- nanoseconds of potential error
-
translate
public MonotonicClockTranslation translate()
- Specified by:
translate
in interfaceMonotonicClock
-
isAfter
public boolean isAfter(long instant)
- Specified by:
isAfter
in interfaceMonotonicClock
-
isAfter
public boolean isAfter(long now, long instant)
- Specified by:
isAfter
in interfaceMonotonicClock
-
pauseNowSampling
public void pauseNowSampling()
-
resumeNowSampling
public void resumeNowSampling()
-
refreshNow
public void refreshNow()
-
-