public final class IgniteUuid extends Object implements Comparable<IgniteUuid>, Iterable<IgniteUuid>, Cloneable, Externalizable, Binarylizable
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.Constructor and Description |
---|
IgniteUuid()
Empty constructor required for
Externalizable . |
IgniteUuid(UUID gid,
long locId)
Constructs
GridUuid from a global and local identifiers. |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
int |
compareTo(IgniteUuid o) |
boolean |
equals(Object obj) |
static IgniteUuid |
fromString(String s)
Converts string into
GridUuid . |
static IgniteUuid |
fromUuid(UUID id)
Constructs new
GridUuid based on global and local ID portions. |
UUID |
globalId()
Gets global ID portion of this
GridUuid . |
int |
hashCode() |
org.apache.ignite.internal.util.lang.GridIterator<IgniteUuid> |
iterator() |
static long |
lastLocalId()
Gets last generated local ID.
|
long |
localId()
Gets local ID portion of this
GridUuid . |
static IgniteUuid |
randomUuid()
Creates new pseudo-random ID.
|
void |
readBinary(BinaryReader reader)
Reads fields from provided reader.
|
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 |
writeBinary(BinaryWriter writer)
Writes fields to provided writer.
|
void |
writeExternal(ObjectOutput out) |
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final UUID VM_ID
public IgniteUuid()
Externalizable
.public IgniteUuid(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 IgniteUuid randomUuid()
public static IgniteUuid fromUuid(UUID id)
GridUuid
based on global and local ID portions.id
- UUID instance.public static IgniteUuid 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 void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
public int compareTo(IgniteUuid o)
compareTo
in interface Comparable<IgniteUuid>
public org.apache.ignite.internal.util.lang.GridIterator<IgniteUuid> iterator()
iterator
in interface Iterable<IgniteUuid>
public void writeBinary(BinaryWriter writer) throws BinaryObjectException
writeBinary
in interface Binarylizable
writer
- Binary object writer.BinaryObjectException
- In case of error.public void readBinary(BinaryReader reader) throws BinaryObjectException
readBinary
in interface Binarylizable
reader
- Binary object reader.BinaryObjectException
- In case of error.public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019