Enum Class StringEncoding
- All Implemented Interfaces:
Serializable,Comparable<StringEncoding>,Constable,Cacheable
An enum that provides a way for users to specify what encoding should be used when hashing strings.
The main reason for this setting's existence is getting the best performance possible. When operating on memory
mapped segments -- which store strings as UTF-8 -- it is fastest to use "UTF8". When operating on the result of
expressions, or on an in-heap IncrementalIndex -- which use Java strings -- it is fastest to use "UTF16LE".
This decision cannot be made locally, because different encodings do not generate equivalent hashes, and therefore
they are not mergeable. The decision must be made globally by the end user or by the SQL planner, and should be
based on where most input strings are expected to come from.
Currently, UTF8 and UTF16LE are the only two options, because there are no situations where other options would be
higher-performing.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic StringEncodingfromString(String name) byte[]Get a byte array used as a cache key.toString()static StringEncodingReturns the enum constant of this class with the specified name.static StringEncoding[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UTF8
-
UTF16LE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromString
-
getCacheKey
public byte[] getCacheKey()Description copied from interface:CacheableGet a byte array used as a cache key.- Specified by:
getCacheKeyin interfaceCacheable- Returns:
- bytes to be used as cache key - or null if this object should not be cached.
-
toString
- Overrides:
toStringin classEnum<StringEncoding>
-