public final class GridUuid extends Object implements Comparable<GridUuid>, Iterable<GridUuid>, Cloneable, Externalizable, GridOptimizedMarshallable
UUID. On basic tests this version is at least
10x time faster for ID creation. It uses extra memory for 8-byte counter additionally to
internal UUID.| Modifier and Type | Field and Description |
|---|---|
static UUID |
VM_ID
VM ID.
|
CLS_ID_FIELD_NAME| Constructor and Description |
|---|
GridUuid()
Empty constructor required for
Externalizable. |
GridUuid(UUID gid,
long locId)
Constructs
GridUuid from a global and local identifiers. |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
int |
compareTo(GridUuid o) |
boolean |
equals(Object obj) |
static GridUuid |
fromString(String s)
Converts string into
GridUuid. |
static GridUuid |
fromUuid(UUID id)
Constructs new
GridUuid based on global and local ID portions. |
Object |
ggClassId()
Implementation of this method should simply return value of
GG_CLASS_ID field. |
UUID |
globalId()
Gets global ID portion of this
GridUuid. |
int |
hashCode() |
GridIterator<GridUuid> |
iterator() |
static long |
lastLocalId()
Gets last generated local ID.
|
long |
localId()
Gets local ID portion of this
GridUuid. |
static GridUuid |
randomUuid()
Creates new pseudo-random ID.
|
void |
readExternal(ObjectInput in) |
String |
shortString()
Gets a short string version of this ID.
|
String |
toString() |
static UUID |
vmId()
Gets
UUID associated with local VM. |
void |
writeExternal(ObjectOutput out) |
public static final UUID VM_ID
public GridUuid()
Externalizable.public GridUuid(UUID gid, long locId)
GridUuid from a global and local identifiers.gid - UUID.locId - Counter.public static UUID vmId()
UUID associated with local VM.UUID associated with local VM.public static long lastLocalId()
public static GridUuid randomUuid()
public static GridUuid fromUuid(UUID id)
GridUuid based on global and local ID portions.id - UUID instance.public static GridUuid fromString(String s)
GridUuid. The String must be in the format generated
by GridUuid.toString() method.s - String to convert to GridUuid.GridUuid instance representing given string.public String shortString()
public UUID globalId()
GridUuid.GridUuid.public long localId()
GridUuid.GridUuid.public Object ggClassId()
GG_CLASS_ID field.ggClassId in interface GridOptimizedMarshallablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic int compareTo(GridUuid o)
compareTo in interface Comparable<GridUuid>public GridIterator<GridUuid> iterator()
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2014. All rights reserved.