Package tech.ytsaurus.core
Class YtTimestamp
- java.lang.Object
-
- tech.ytsaurus.core.YtTimestamp
-
public class YtTimestamp extends java.lang.Object
Timestamp is a cluster-wide unique monotonically increasing number used to implement the MVCC paradigm.Timestamp is a 64-bit unsigned integer of the following structure: bits 0-29: auto-incrementing counter (allowing up to ~10^9 timestamps per second) bits 30-61: Unix time in seconds (from 1 Jan 1970) bits 62-63: reserved
-
-
Field Summary
Fields Modifier and Type Field Description static YtTimestamp
ASYNC_LAST_COMMITTED
Relaxed (non-serializable) latest committed version.static int
COUNTER_BITS
static long
COUNTER_MASK
static YtTimestamp
MAX
Maximum valid (non-sentinel) timestamp.static YtTimestamp
MIN
Minimum valid (non-sentinel) timestamp.static YtTimestamp
NULL
Uninitialized/invalid timestamp.static YtTimestamp
SYNC_LAST_COMMITTED
Truly (serializable) latest committed version.
-
Constructor Summary
Constructors Modifier Constructor Description protected
YtTimestamp(long value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
static YtTimestamp
fromInstant(java.time.Instant instant)
long
getCounter()
java.time.Instant
getInstant()
long
getValue()
int
hashCode()
java.lang.String
toString()
static YtTimestamp
valueOf(long value)
-
-
-
Field Detail
-
COUNTER_BITS
public static final int COUNTER_BITS
- See Also:
- Constant Field Values
-
COUNTER_MASK
public static final long COUNTER_MASK
- See Also:
- Constant Field Values
-
MIN
public static final YtTimestamp MIN
Minimum valid (non-sentinel) timestamp.
-
MAX
public static final YtTimestamp MAX
Maximum valid (non-sentinel) timestamp.
-
NULL
public static final YtTimestamp NULL
Uninitialized/invalid timestamp.
-
SYNC_LAST_COMMITTED
public static final YtTimestamp SYNC_LAST_COMMITTED
Truly (serializable) latest committed version. May cause row blocking if concurrent writes are in progress.
-
ASYNC_LAST_COMMITTED
public static final YtTimestamp ASYNC_LAST_COMMITTED
Relaxed (non-serializable) latest committed version. Never leads to row blocking but may miss some concurrent writes.
-
-
Method Detail
-
getValue
public long getValue()
-
getInstant
public java.time.Instant getInstant()
-
getCounter
public long getCounter()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
valueOf
public static YtTimestamp valueOf(long value)
-
fromInstant
public static YtTimestamp fromInstant(@Nonnull java.time.Instant instant)
-
-