Package org.apache.cassandra.utils
Class TimeUUID
java.lang.Object
org.apache.cassandra.utils.TimeUUID
- All Implemented Interfaces:
Serializable,Comparable<TimeUUID>
- Direct Known Subclasses:
Ballot,SSTableReader.UniqueIdentifier
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classTimeUUID.AbstractSerializer<T extends TimeUUID>static classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longprotected static final longstatic final longstatic final longprotected static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasUUID()static TimeUUIDatUnixMicrosWithLsb(long unixMicros, long uniqueLsb) static UUIDatUnixMicrosWithLsbAsUUID(long unixMicros, long uniqueLsb) intstatic TimeUUIDdeserialize(DataInput in) static TimeUUIDdeserialize(ByteBuffer buffer) booleanbooleanbooleanstatic TimeUUIDfromBytes(long msb, long lsb) static TimeUUIDfromString(String uuidString) static TimeUUIDinthashCode()longlsb()static TimeUUIDmaxAtUnixMillis(long unixMillis) Returns the biggest possible type 1 UUID having the provided timestamp.static TimeUUIDminAtUnixMillis(long unixMillis) Returns the smaller possible type 1 UUID having the provided timestamp.longmsb()static longmsbToRawTimestamp(long msb) static longrawTimestampToMsb(long rawTimestamp) static longrawTimestampToUnixMicros(long rawTimestamp) voidserialize(DataOutput out) static longtoBytes()static byte[]toBytes(long msb, long lsb) toString()static Stringstatic StringlongThe Cassandra internal micros-resolution timestamp of the TimeUUID, as of unix epochlongThe Cassandra internal micros-resolution timestamp of the TimeUUID, as of unix epochstatic longunixMicrosToRawTimestamp(long unixMicros) static longunixMillisToRawTimestamp(long unixMillis, long tenthsOfAMicro) longThe UUID-format timestamp, i.e.
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
UUID_EPOCH_UNIX_MILLIS
public static final long UUID_EPOCH_UNIX_MILLIS- See Also:
-
TIMESTAMP_UUID_VERSION_IN_MSB
protected static final long TIMESTAMP_UUID_VERSION_IN_MSB- See Also:
-
UUID_VERSION_BITS_IN_MSB
protected static final long UUID_VERSION_BITS_IN_MSB- See Also:
-
MIN_CLOCK_SEQ_AND_NODE
public static final long MIN_CLOCK_SEQ_AND_NODE- See Also:
-
TIMEUUID_SIZE
public static final long TIMEUUID_SIZE
-
-
Constructor Details
-
TimeUUID
public TimeUUID(long uuidTimestamp, long lsb)
-
-
Method Details
-
atUnixMicrosWithLsb
-
atUnixMicrosWithLsbAsUUID
-
minAtUnixMillis
Returns the smaller possible type 1 UUID having the provided timestamp. Warning: this method should only be used for querying as this doesn't at all guarantee the uniqueness of the resulting UUID. -
maxAtUnixMillis
Returns the biggest possible type 1 UUID having the provided timestamp. Warning: this method should only be used for querying as this doesn't at all guarantee the uniqueness of the resulting UUID. -
fromString
-
fromUuid
-
fromBytes
-
deserialize
-
deserialize
- Throws:
IOException
-
serialize
- Throws:
IOException
-
toBytes
-
toBytes
public static byte[] toBytes(long msb, long lsb) -
sizeInBytes
public static long sizeInBytes() -
asUUID
-
unix
The Cassandra internal micros-resolution timestamp of the TimeUUID, as of unix epoch -
unixMicros
public long unixMicros()The Cassandra internal micros-resolution timestamp of the TimeUUID, as of unix epoch -
uuidTimestamp
public long uuidTimestamp()The UUID-format timestamp, i.e. 10x micros-resolution, as of UUIDGen.UUID_EPOCH_UNIX_MILLIS The tenths of a microsecond are used to store a flag value. -
msb
public long msb() -
lsb
public long lsb() -
rawTimestampToUnixMicros
public static long rawTimestampToUnixMicros(long rawTimestamp) -
unixMillisToRawTimestamp
public static long unixMillisToRawTimestamp(long unixMillis, long tenthsOfAMicro) -
unixMicrosToRawTimestamp
public static long unixMicrosToRawTimestamp(long unixMicros) -
msbToRawTimestamp
public static long msbToRawTimestamp(long msb) -
rawTimestampToMsb
public static long rawTimestampToMsb(long rawTimestamp) -
hashCode
public int hashCode() -
equals
-
equals
-
equals
-
toString
-
toString
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<TimeUUID>
-