|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object me.prettyprint.cassandra.utils.TimeUUIDUtils
public final class TimeUUIDUtils
Utilitary class to generate TimeUUID (type 1)
Constructor Summary | |
---|---|
TimeUUIDUtils()
|
Method Summary | |
---|---|
static byte[] |
asByteArray(UUID uuid)
As byte array. |
static ByteBuffer |
asByteBuffer(UUID uuid)
Coverts a java.util.UUID into a ByteBuffer. |
static long |
getTimeFromUUID(byte[] uuid)
Retrieves the time as long based on the byte[] representation of a UUID. |
static long |
getTimeFromUUID(UUID uuid)
|
static UUID |
getTimeUUID(ClockResolution clock)
Gets a new time uuid using ClockResolution.createClock() as a time generator. |
static UUID |
getTimeUUID(long time)
Gets a new time uuid based on time |
static UUID |
getUniqueTimeUUIDinMillis()
Gets a new and unique time uuid in milliseconds. |
static UUID |
toUUID(byte[] uuid)
Returns an instance of uuid. |
static UUID |
uuid(byte[] uuid,
int offset)
|
static UUID |
uuid(ByteBuffer bb)
Converts a ByteBuffer containing a UUID into a java.util.UUID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeUUIDUtils()
Method Detail |
---|
public static UUID getUniqueTimeUUIDinMillis()
public static UUID getTimeUUID(ClockResolution clock)
ClockResolution.createClock()
as a time generator.
It is useful to use in a TimeUUIDType sorted column family.
clock
- a ClockResolution
public static UUID getTimeUUID(long time)
time.
NOTE: this algorithm does not resolve duplicates. To avoid duplicates use
getTimeUUID(ClockResolution clock)
with an implementaion that provides unique timestamp resolution, like
MicrosecondsSyncClockResolution
It is useful to use in a TimeUUIDType sorted column family.
- Parameters:
clock
- a ClockResolution
- Returns:
- the time uuid
public static UUID toUUID(byte[] uuid)
uuid
- the uuid
public static long getTimeFromUUID(byte[] uuid)
uuid
- byte[] uuid representation
public static long getTimeFromUUID(UUID uuid)
public static byte[] asByteArray(UUID uuid)
#getTimeUUID()
uuid
- the uuid
public static ByteBuffer asByteBuffer(UUID uuid)
uuid
- a java.util.UUID
public static UUID uuid(byte[] uuid, int offset)
public static UUID uuid(ByteBuffer bb)
bb
- a ByteBuffer containing a UUID
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |