|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.astyanax.util.TimeUUIDUtils
public final class TimeUUIDUtils
Utilitary class to generate TimeUUID (type 1)
| Constructor Summary | |
|---|---|
TimeUUIDUtils()
|
|
| Method Summary | |
|---|---|
static byte[] |
asByteArray(java.util.UUID uuid)
As byte array. |
static java.nio.ByteBuffer |
asByteBuffer(java.util.UUID uuid)
Coverts a java.util.UUID into a ByteBuffer. |
static long |
getMicrosTimeFromUUID(java.util.UUID uuid)
|
static java.util.UUID |
getMicrosTimeUUID(long time)
|
static long |
getTimeFromUUID(byte[] uuid)
Retrieves the time as long based on the byte[] representation of a UUID. |
static long |
getTimeFromUUID(java.util.UUID uuid)
|
static java.util.UUID |
getTimeUUID(Clock clock)
Gets a new time uuid using ClockResolution#createClock() as a
time generator. |
static java.util.UUID |
getTimeUUID(long time)
Gets a new time uuid based on time |
static java.util.UUID |
getUniqueTimeUUIDinMicros()
|
static java.util.UUID |
getUniqueTimeUUIDinMillis()
Gets a new and unique time uuid in milliseconds. |
static java.util.UUID |
toUUID(byte[] uuid)
Returns an instance of uuid. |
static java.util.UUID |
uuid(byte[] uuid,
int offset)
|
static java.util.UUID |
uuid(java.nio.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 java.util.UUID getUniqueTimeUUIDinMillis()
public static java.util.UUID getUniqueTimeUUIDinMicros()
public static java.util.UUID getTimeUUID(Clock clock)
ClockResolution#createClock() as a
time generator. It is useful to use in a TimeUUIDType sorted column
family.
clock - a ClockResolution
public static java.util.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 java.util.UUID getMicrosTimeUUID(long time)
public static java.util.UUID toUUID(byte[] uuid)
uuid - the uuid
public static long getTimeFromUUID(byte[] uuid)
uuid - byte[] uuid representation
public static long getTimeFromUUID(java.util.UUID uuid)
public static long getMicrosTimeFromUUID(java.util.UUID uuid)
public static byte[] asByteArray(java.util.UUID uuid)
#getTimeUUID()
uuid - the uuid
public static java.nio.ByteBuffer asByteBuffer(java.util.UUID uuid)
uuid - a java.util.UUID
public static java.util.UUID uuid(byte[] uuid,
int offset)
public static java.util.UUID uuid(java.nio.ByteBuffer bb)
bb - a ByteBuffer containing a UUID
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||