Package org.apache.datasketches.common
Enum Class Family
- All Implemented Interfaces:
Serializable
,Comparable<Family>
,Constable
Defines the various families of sketch and set operation classes. A family defines a set of
classes that share fundamental algorithms and behaviors. The classes within a family may
still differ by how they are stored and accessed. For example, internally there are separate
classes for the QuickSelect sketch algorithm that operate on the Java heap and off-heap.
Not all of these families have parallel forms on and off-heap but are included for completeness.
- Author:
- Lee Rhodes
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe A and not B family is an operation for the Theta Sketch Framework of sketches.The Alpha Sketch family is a member of the Theta Sketch Framework of sketches and is best suited for real-time processes where both the updating of the sketch and getting the estimate is performed directly on the sketch.Bloom FilterThe Compact Sketch family is a member of the Theta Sketch Framework of sketches.CountMin SketchCompressed Probabilistic Counting (CPC) SketchExact and Bounded, Probability Proportional to Size (EBPPS)The Frequency family of sketches.The HLL family of sketches.The Intersection family is an operation for the Theta Sketch Framework of sketches.KLL quantiles sketchThe Quantiles family of sketches.The QuickSelect Sketch family is a member of the Theta Sketch Framework of sketches and is the workhorse of the Theta Sketch Families and can be constructed for either on-heap or off-heap operation.Relative Error Quantiles SketchThe Reservoir family of sketches.The reservoir sampling family of Union operations.t-Digest for estimating quantiles and ranksThe Tuple family of sketches is a large family of sketches that are extensions of the Theta Sketch Framework.The Union family is an operation for the Theta Sketch Framework of sketches.The VarOpt family of sketches.The VarOpt family of sketches. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkFamilyID
(int id) Returns the name for this familyint
getID()
Returns the byte ID for this familyint
Returns the maximum preamble size for this family in longsint
Returns the minimum preamble size for this family in longsstatic Family
idToFamily
(int id) Returns the Family given the IDstatic Family
stringToFamily
(String famName) Returns the Family given the family nametoString()
static Family
Returns the enum constant of this class with the specified name.static Family[]
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, valueOf
-
Enum Constant Details
-
ALPHA
The Alpha Sketch family is a member of the Theta Sketch Framework of sketches and is best suited for real-time processes where both the updating of the sketch and getting the estimate is performed directly on the sketch. In this situation the AlphaSketch has roughly a 30% improvement (~1/sqrt(2*k)) in its error distribution as compared to the QuickSelect (or similar KMV-derived) sketches.If the AlphaSketch is fed into any SetOperation, the error distribution reverts back to the normal QuickSelect/KMV error distribution (~1/sqrt(k)). For this reason, the AlphaSketch does not have a sister class for off-heap operation. The Alpha Sketch has a roughly 30% faster overall update time as compared to the QuickSelect sketch family.
The Alpha Sketch is created using the UpdateSketch.builder(). See Alpha TCF and Theta Sketch Framework
-
QUICKSELECT
The QuickSelect Sketch family is a member of the Theta Sketch Framework of sketches and is the workhorse of the Theta Sketch Families and can be constructed for either on-heap or off-heap operation. The QuickSelect Sketch is created using the UpdateSketch.builder(). See Quick Select TCF -
COMPACT
The Compact Sketch family is a member of the Theta Sketch Framework of sketches. The are read-only and cannot be updated, but can participate in any of the Set Operations. The compact sketches are never created directly with a constructor or Builder. Instead they are created as a result of the compact() method of an UpdateSketch or as a result of a getSketchSamples() of a SetOperation. -
UNION
The Union family is an operation for the Theta Sketch Framework of sketches. The Union is constructed using the SetOperation.builder(). -
INTERSECTION
The Intersection family is an operation for the Theta Sketch Framework of sketches. The Intersection is constructed using the SetOperation.builder(). -
A_NOT_B
The A and not B family is an operation for the Theta Sketch Framework of sketches. The AnotB operation is constructed using the SetOperation.builder(). -
HLL
The HLL family of sketches. (Not part of TSF.) -
QUANTILES
The Quantiles family of sketches. (Not part of TSF.) -
TUPLE
The Tuple family of sketches is a large family of sketches that are extensions of the Theta Sketch Framework. -
FREQUENCY
The Frequency family of sketches. (Not part of TSF.) -
RESERVOIR
The Reservoir family of sketches. (Not part of TSF.) -
RESERVOIR_UNION
The reservoir sampling family of Union operations. (Not part of TSF.) -
VAROPT
The VarOpt family of sketches. (Not part of TSF.) -
VAROPT_UNION
The VarOpt family of sketches. (Not part of TSF.) -
KLL
KLL quantiles sketch -
CPC
Compressed Probabilistic Counting (CPC) Sketch -
REQ
Relative Error Quantiles Sketch -
COUNTMIN
CountMin Sketch -
EBPPS
Exact and Bounded, Probability Proportional to Size (EBPPS) -
TDIGEST
t-Digest for estimating quantiles and ranks -
BLOOMFILTER
Bloom Filter
-
-
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
-
getID
public int getID()Returns the byte ID for this family- Returns:
- the byte ID for this family
-
checkFamilyID
public void checkFamilyID(int id) - Parameters:
id
- the given id, a value < 128.
-
getFamilyName
Returns the name for this family- Returns:
- the name for this family
-
getMinPreLongs
public int getMinPreLongs()Returns the minimum preamble size for this family in longs- Returns:
- the minimum preamble size for this family in longs
-
getMaxPreLongs
public int getMaxPreLongs()Returns the maximum preamble size for this family in longs- Returns:
- the maximum preamble size for this family in longs
-
toString
-
idToFamily
Returns the Family given the ID- Parameters:
id
- the given ID- Returns:
- the Family given the ID
-
stringToFamily
Returns the Family given the family name- Parameters:
famName
- the family name- Returns:
- the Family given the family name
-