public class DistributedUniqueTimeProvider
extends net.openhft.chronicle.core.io.SimpleCloseable
implements net.openhft.chronicle.core.time.TimeProvider
Modifier and Type | Method and Description |
---|---|
long |
currentTimeMicros()
Return a unique, monotonically increasing microsecond timestamp where the lowest two digits of the microseconds is the hostId.
|
long |
currentTimeMillis() |
long |
currentTimeNanos()
Return a unique, monotonically increasing nanosecond timestamp where the lowest two digits of the nanoseconds is the hostId.
|
DistributedUniqueTimeDeduplicator |
deduplicator()
A deduplicator to help recognise duplicate timestamps for a hostId
|
static DistributedUniqueTimeProvider |
forHostId(int hostId) |
DistributedUniqueTimeProvider |
hostId(int hostId) |
static long |
hostIdFor(long timestampWithHostId)
Extract the hostId from the timestampWithHostId
|
static DistributedUniqueTimeProvider |
instance() |
protected void |
performClose() |
DistributedUniqueTimeProvider |
provider(net.openhft.chronicle.core.time.TimeProvider provider) |
static long |
timestampFor(long timestampWithHostId)
Extract the timestamp in nanoseconds from the timestampWithHostId
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
referenceId, referenceName, temporary
public static DistributedUniqueTimeProvider instance()
protected void performClose()
performClose
in class net.openhft.chronicle.core.io.SimpleCloseable
public static DistributedUniqueTimeProvider forHostId(int hostId)
public DistributedUniqueTimeProvider hostId(int hostId)
public DistributedUniqueTimeProvider provider(net.openhft.chronicle.core.time.TimeProvider provider)
public long currentTimeMillis()
currentTimeMillis
in interface net.openhft.chronicle.core.time.TimeProvider
public long currentTimeMicros() throws IllegalStateException
currentTimeMicros
in interface net.openhft.chronicle.core.time.TimeProvider
IllegalStateException
- if the underlying resources have been released/closedpublic static long timestampFor(long timestampWithHostId)
timestampWithHostId
- to extract frompublic static long hostIdFor(long timestampWithHostId)
timestampWithHostId
- to extract frompublic long currentTimeNanos() throws IllegalStateException
currentTimeNanos
in interface net.openhft.chronicle.core.time.TimeProvider
IllegalStateException
- if the underlying resources have been released/closedpublic DistributedUniqueTimeDeduplicator deduplicator()
Copyright © 2022. All rights reserved.