Package org.apache.cassandra.utils
Class UUIDGen
java.lang.Object
org.apache.cassandra.utils.UUIDGen
The goods are here: www.ietf.org/rfc/rfc4122.txt.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]decomposes a uuid into raw bytes.static longgetAdjustedTimestamp(UUID uuid) Returns a milliseconds-since-epoch value for a type-1 UUID.static UUIDgetUUID(ByteBuffer raw) creates a type 1 uuid from raw bytes.static ByteBuffertoByteBuffer(UUID uuid)
-
Field Details
-
UUID_LEN
public static final int UUID_LEN- See Also:
-
-
Constructor Details
-
UUIDGen
public UUIDGen()
-
-
Method Details
-
getUUID
creates a type 1 uuid from raw bytes. -
toByteBuffer
-
decompose
decomposes a uuid into raw bytes. -
getAdjustedTimestamp
Returns a milliseconds-since-epoch value for a type-1 UUID.- Parameters:
uuid- a type-1 (time-based) UUID- Returns:
- the number of milliseconds since the unix epoch
- Throws:
IllegalArgumentException- if the UUID is not version 1
-