java.lang.Object
org.elasticsearch.common.UUIDs
Utility class for generating various types of UUIDs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Supplier
<byte[]> static final int
The length of a UUID string generated byrandomBase64UUID(java.util.Random)
andrandomBase64UUIDSecureString()
.static final int
The length of a UUID string generated bybase64UUID()
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
Generates a time-based UUID (similar to Flake IDs), which is preferred when generating an ID to be indexed into a Lucene index as primary key.static String
Returns a Base64 encoded string representing a RFC4122 version 4 UUID, using a privateSecureRandom
instance.static String
randomBase64UUID
(Random random) Returns a Base64 encoded string representing a RFC4122 version 4 UUID, using the providedRandom
instance.static SecureString
Returns a Base64 encodedSecureString
representing a RFC4122 version 4 UUID, using a privateSecureRandom
instance.
-
Field Details
-
DEFAULT_TIMESTAMP_SUPPLIER
-
DEFAULT_SEQUENCE_ID_SUPPLIER
-
DEFAULT_MAC_ADDRESS_SUPPLIER
-
TIME_BASED_UUID_STRING_LENGTH
public static final int TIME_BASED_UUID_STRING_LENGTHThe length of a UUID string generated bybase64UUID()
.- See Also:
-
RANDOM_BASED_UUID_STRING_LENGTH
public static final int RANDOM_BASED_UUID_STRING_LENGTHThe length of a UUID string generated byrandomBase64UUID(java.util.Random)
andrandomBase64UUIDSecureString()
.- See Also:
-
-
Constructor Details
-
UUIDs
public UUIDs()
-
-
Method Details
-
base64UUID
Generates a time-based UUID (similar to Flake IDs), which is preferred when generating an ID to be indexed into a Lucene index as primary key. The id is opaque and the implementation is free to change at any time! The resulting string has lengthTIME_BASED_UUID_STRING_LENGTH
. -
base64TimeBasedKOrderedUUIDWithHash
-
randomBase64UUID
Returns a Base64 encoded string representing a RFC4122 version 4 UUID, using the providedRandom
instance. The resulting string has lengthRANDOM_BASED_UUID_STRING_LENGTH
. -
randomBase64UUID
Returns a Base64 encoded string representing a RFC4122 version 4 UUID, using a privateSecureRandom
instance. The resulting string has lengthRANDOM_BASED_UUID_STRING_LENGTH
. -
randomBase64UUIDSecureString
Returns a Base64 encodedSecureString
representing a RFC4122 version 4 UUID, using a privateSecureRandom
instance. The resulting string has lengthRANDOM_BASED_UUID_STRING_LENGTH
.
-