Package org.apache.ignite.lang
Class IgniteUuid
- java.lang.Object
- 
- org.apache.ignite.lang.IgniteUuid
 
- 
- All Implemented Interfaces:
- Externalizable,- Serializable,- Cloneable,- Comparable<IgniteUuid>,- Iterable<IgniteUuid>,- Binarylizable
 
 public final class IgniteUuid extends Object implements Comparable<IgniteUuid>, Iterable<IgniteUuid>, Cloneable, Externalizable, Binarylizable This is a faster performing version ofUUID. 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.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description IgniteUuid()Empty constructor required forExternalizable.IgniteUuid(UUID gid, long locId)ConstructsIgniteUuidfrom a global and local identifiers.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()intcompareTo(IgniteUuid o)booleanequals(Object obj)static IgniteUuidfromString(String s)Converts string intoIgniteUuid.static IgniteUuidfromUuid(UUID id)Constructs newIgniteUuidbased on global and local ID portions.UUIDglobalId()Gets global ID portion of thisIgniteUuid.inthashCode()org.apache.ignite.internal.util.lang.GridIterator<IgniteUuid>iterator()static longlastLocalId()Gets last generated local ID.longlocalId()Gets local ID portion of thisIgniteUuid.static IgniteUuidrandomUuid()Creates new pseudo-random ID.voidreadBinary(BinaryReader reader)Reads fields from provided reader.voidreadExternal(ObjectInput in)StringshortString()Gets a short string version of this ID.StringtoString()static UUIDvmId()GetsUUIDassociated with local VM.voidwriteBinary(BinaryWriter writer)Writes fields to provided writer.voidwriteExternal(ObjectOutput out)- 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 
- 
 
- 
- 
- 
Field Detail- 
VM_IDpublic static final UUID VM_ID VM ID.
 
- 
 - 
Constructor Detail- 
IgniteUuidpublic IgniteUuid() Empty constructor required forExternalizable.
 - 
IgniteUuidpublic IgniteUuid(UUID gid, long locId) ConstructsIgniteUuidfrom a global and local identifiers.- Parameters:
- gid- UUID.
- locId- Counter.
 
 
- 
 - 
Method Detail- 
vmIdpublic static UUID vmId() GetsUUIDassociated with local VM.- Returns:
- UUIDassociated with local VM.
 
 - 
lastLocalIdpublic static long lastLocalId() Gets last generated local ID.- Returns:
- Last generated local ID.
 
 - 
randomUuidpublic static IgniteUuid randomUuid() Creates new pseudo-random ID.- Returns:
- Newly created pseudo-random ID.
 
 - 
fromUuidpublic static IgniteUuid fromUuid(UUID id) Constructs newIgniteUuidbased on global and local ID portions.- Parameters:
- id- UUID instance.
- Returns:
- Newly created pseudo-random ID.
 
 - 
fromStringpublic static IgniteUuid fromString(String s) Converts string intoIgniteUuid. The String must be in the format generated bytoString()method.- Parameters:
- s- String to convert to- IgniteUuid.
- Returns:
- IgniteUuidinstance representing given string.
 
 - 
shortStringpublic String shortString() Gets a short string version of this ID. Use it only for UI where full version is available to the application.- Returns:
- Short string version of this ID.
 
 - 
globalIdpublic UUID globalId() Gets global ID portion of thisIgniteUuid.- Returns:
- Global ID portion of this IgniteUuid.
 
 - 
localIdpublic long localId() Gets local ID portion of thisIgniteUuid.- Returns:
- Local ID portion of this IgniteUuid.
 
 - 
writeExternalpublic void writeExternal(ObjectOutput out) throws IOException - Specified by:
- writeExternalin interface- Externalizable
- Throws:
- IOException
 
 - 
readExternalpublic void readExternal(ObjectInput in) throws IOException - Specified by:
- readExternalin interface- Externalizable
- Throws:
- IOException
 
 - 
compareTopublic int compareTo(IgniteUuid o) - Specified by:
- compareToin interface- Comparable<IgniteUuid>
 
 - 
iteratorpublic org.apache.ignite.internal.util.lang.GridIterator<IgniteUuid> iterator() - Specified by:
- iteratorin interface- Iterable<IgniteUuid>
 
 - 
writeBinarypublic void writeBinary(BinaryWriter writer) throws BinaryObjectException Writes fields to provided writer.- Specified by:
- writeBinaryin interface- Binarylizable
- Parameters:
- writer- Binary object writer.
- Throws:
- BinaryObjectException- In case of error.
 
 - 
readBinarypublic void readBinary(BinaryReader reader) throws BinaryObjectException Reads fields from provided reader.- Specified by:
- readBinaryin interface- Binarylizable
- Parameters:
- reader- Binary object reader.
- Throws:
- BinaryObjectException- In case of error.
 
 - 
clonepublic Object clone() throws CloneNotSupportedException - Overrides:
- clonein class- Object
- Throws:
- CloneNotSupportedException
 
 
- 
 
-