Package org.apache.datasketches
Enum Family
- All Implemented Interfaces:
Serializable,Comparable<Family>,Constable
public enum Family extends Enum<Family>
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
-
Enum Constant Summary
Enum Constants Enum Constant Description A_NOT_BThe A and not B family is an operation for the Theta Sketch Framework of sketches.ALPHAThe 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.COMPACTThe Compact Sketch family is a member of the Theta Sketch Framework of sketches.CPCCompressed Probabilistic Counting (CPC) SketchFREQUENCYThe Frequency family of sketches.HLLThe HLL family of sketches.INTERSECTIONThe Intersection family is an operation for the Theta Sketch Framework of sketches.KLLKLL quanliles sketchQUANTILESThe Quantiles family of sketches.QUICKSELECTThe 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.REQRelative Error Quantiles SketchRESERVOIRThe Reservoir family of sketches.RESERVOIR_UNIONThe reservoir sampling family of Union operations.TUPLEThe Tuple family of sketches is a large family of sketches that are extensions of the Theta Sketch Framework.UNIONThe Union family is an operation for the Theta Sketch Framework of sketches.VAROPTThe VarOpt family of sketches.VAROPT_UNIONThe VarOpt family of sketches. -
Method Summary
Modifier and Type Method Description voidcheckFamilyID(int id)StringgetFamilyName()Returns the name for this familyintgetID()Returns the byte ID for this familyintgetMaxPreLongs()Returns the maximum preamble size for this family in longsintgetMinPreLongs()Returns the minimum preamble size for this family in longsstatic FamilyidToFamily(int id)Returns the Family given the IDstatic FamilystringToFamily(String famName)Returns the Family given the family nameStringtoString()static FamilyvalueOf(String name)Returns the enum constant of this type with the specified name.static Family[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
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 quanliles sketch -
CPC
Compressed Probabilistic Counting (CPC) Sketch -
REQ
Relative Error Quantiles Sketch
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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
-