Class IndexUtils
java.lang.Object
io.fluxcapacitor.javaclient.tracking.IndexUtils
Use 48 bits of the current time in milliseconds since epoch as the base of the index. The remaining 16 bits (65k) are
used to increment the index if messages are written in the same ms as the last batch.
The index is only able to store 2^47 - 1 ms of time since epoch, i.e. about 4,500 years.
Uses FluxCapacitor.currentClock() to get the index corresponding to the current timestamp of Flux Capacitor's
internal clock.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longstatic longindexFromMillis(long millisSinceEpoch) static longindexFromTimestamp(Instant timestamp) static longmillisFromIndex(long index) static intoffsetFromIndex(long index) static InstanttimestampFromIndex(long index)
-
Constructor Details
-
IndexUtils
public IndexUtils()
-
-
Method Details
-
millisFromIndex
public static long millisFromIndex(long index) -
timestampFromIndex
-
indexFromTimestamp
-
indexFromMillis
public static long indexFromMillis(long millisSinceEpoch) -
offsetFromIndex
public static int offsetFromIndex(long index) -
indexForCurrentTime
public static long indexForCurrentTime()
-