Package org.apache.datasketches.hll
Enum Class TgtHllType
- All Implemented Interfaces:
Serializable
,Comparable<TgtHllType>
,Constable
Specifies the target type of HLL sketch to be created. It is a target in that the actual
allocation of the HLL array is deferred until sufficient number of items have been received by
the warm-up phases.
These three target types are isomorphic representations of the same underlying HLL algorithm. Thus, given the same value of lgConfigK and the same input, all three HLL target types will produce identical estimates and have identical error distributions.
The memory (and also the serialization) of the sketch during this early warmup phase starts out very small (8 bytes, when empty) and then grows in increments of 4 bytes as required until the full HLL array is allocated. This transition point occurs at about 10% of K for sketches where lgConfigK is > 8.
- HLL 8 This uses an 8-bit byte per HLL bucket. It is generally the fastest in terms of update time, but has the largest storage footprint of about K bytes.
- HLL 6 This uses a 6-bit field per HLL bucket. It is the generally the next fastest in terms of update time with a storage footprint of about 3/4 * K bytes.
- HLL 4 This uses a 4-bit field per HLL bucket and for large counts may require the use of a small internal auxiliary array for storing statistical exceptions, which are rare. For the values of lgConfigK > 13 (K = 8192), this additional array adds about 3% to the overall storage. It is generally the slowest in terms of update time, but has the smallest storage footprint of about K/2 * 1.03 bytes.
- Author:
- Lee Rhodes
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final TgtHllType
fromOrdinal
(int typeId) Convert the typeId to the enum typestatic TgtHllType
Returns the enum constant of this class with the specified name.static TgtHllType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
HLL_4
An HLL sketch with a bin size of 4 bits -
HLL_6
An HLL sketch with a bin size of 6 bits -
HLL_8
An Hll Sketch with a bin size of 8 bits
-
-
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
-
fromOrdinal
Convert the typeId to the enum type- Parameters:
typeId
- the given typeId- Returns:
- the enum type
-