Class UUIDGen

java.lang.Object
org.apache.cassandra.utils.UUIDGen

public class UUIDGen extends Object
The goods are here: www.ietf.org/rfc/rfc4122.txt.
  • Field Details

  • Constructor Details

    • UUIDGen

      public UUIDGen()
  • Method Details

    • getUUID

      public static UUID getUUID(ByteBuffer raw)
      creates a type 1 uuid from raw bytes.
    • toByteBuffer

      public static ByteBuffer toByteBuffer(UUID uuid)
    • decompose

      public static byte[] decompose(UUID uuid)
      decomposes a uuid into raw bytes.
    • getAdjustedTimestamp

      public static long getAdjustedTimestamp(UUID uuid)
      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