Package org.apache.cassandra.utils
Interface MonotonicClock
- All Known Implementing Classes:
MonotonicClock.AbstractEpochSamplingClock,MonotonicClock.SampledClock,MonotonicClock.SystemClock
public interface MonotonicClock
Wrapper around time related functions that are either implemented by using the default JVM calls
or by using a custom implementation for testing purposes.
See
MonotonicClock.Global.preciseTime for how to use a custom implementation.
Please note that Clock wasn't used, as it would not be possible to provide an
implementation for now() with the exact same properties of System.nanoTime().
TODO better rationalise MonotonicClock/Clock-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic classstatic class -
Method Summary
-
Method Details
-
now
long now() -
error
long error()- Returns:
- nanoseconds of potential error
-
translate
MonotonicClockTranslation translate() -
isAfter
boolean isAfter(long instant) -
isAfter
boolean isAfter(long now, long instant)
-