Package org.apache.cassandra.utils
Interface MonotonicClock
-
- All Known Implementing Classes:
MonotonicClock.AbstractEpochSamplingClock,MonotonicClock.SampledClock,MonotonicClock.SystemClock
public interface MonotonicClockWrapper around time related functions that are either implemented by using the default JVM calls or by using a custom implementation for testing purposes. SeeMonotonicClock.Global.preciseTimefor how to use a custom implementation. Please note thatClockwasn't used, as it would not be possible to provide an implementation fornow()with the exact same properties ofSystem.nanoTime(). TODO better rationalise MonotonicClock/Clock
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMonotonicClock.AbstractEpochSamplingClockstatic classMonotonicClock.Globalstatic classMonotonicClock.SampledClockstatic classMonotonicClock.SystemClock
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longerror()booleanisAfter(long instant)booleanisAfter(long now, long instant)longnow()MonotonicClockTranslationtranslate()
-
-
-
Method Detail
-
now
long now()
- 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
long error()
- Returns:
- nanoseconds of potential error
-
translate
MonotonicClockTranslation translate()
-
isAfter
boolean isAfter(long instant)
-
isAfter
boolean isAfter(long now, long instant)
-
-