Enum Class Family

java.lang.Object
java.lang.Enum<Family>
org.apache.datasketches.common.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

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The 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 Filter
    The Compact Sketch family is a member of the Theta Sketch Framework of sketches.
    CountMin Sketch
    Compressed Probabilistic Counting (CPC) Sketch
    Exact 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 sketch
    The 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 Sketch
    The Reservoir family of sketches.
    The reservoir sampling family of Union operations.
    t-Digest for estimating quantiles and ranks
    The 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 Type
    Method
    Description
    void
    checkFamilyID(int id)
     
    Returns the name for this family
    int
    Returns the byte ID for this family
    int
    Returns the maximum preamble size for this family in longs
    int
    Returns the minimum preamble size for this family in longs
    static Family
    idToFamily(int id)
    Returns the Family given the ID
    static Family
    Returns the Family given the family name
     
    static Family
    Returns the enum constant of this class with the specified name.
    static Family[]
    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

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • ALPHA

      public static final Family 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

      public static final Family 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

      public static final Family 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

      public static final Family UNION
      The Union family is an operation for the Theta Sketch Framework of sketches. The Union is constructed using the SetOperation.builder().
    • INTERSECTION

      public static final Family 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

      public static final Family 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

      public static final Family HLL
      The HLL family of sketches. (Not part of TSF.)
    • QUANTILES

      public static final Family QUANTILES
      The Quantiles family of sketches. (Not part of TSF.)
    • TUPLE

      public static final Family TUPLE
      The Tuple family of sketches is a large family of sketches that are extensions of the Theta Sketch Framework.
    • FREQUENCY

      public static final Family FREQUENCY
      The Frequency family of sketches. (Not part of TSF.)
    • RESERVOIR

      public static final Family RESERVOIR
      The Reservoir family of sketches. (Not part of TSF.)
    • RESERVOIR_UNION

      public static final Family RESERVOIR_UNION
      The reservoir sampling family of Union operations. (Not part of TSF.)
    • VAROPT

      public static final Family VAROPT
      The VarOpt family of sketches. (Not part of TSF.)
    • VAROPT_UNION

      public static final Family VAROPT_UNION
      The VarOpt family of sketches. (Not part of TSF.)
    • KLL

      public static final Family KLL
      KLL quantiles sketch
    • CPC

      public static final Family CPC
      Compressed Probabilistic Counting (CPC) Sketch
    • REQ

      public static final Family REQ
      Relative Error Quantiles Sketch
    • COUNTMIN

      public static final Family COUNTMIN
      CountMin Sketch
    • EBPPS

      public static final Family EBPPS
      Exact and Bounded, Probability Proportional to Size (EBPPS)
    • TDIGEST

      public static final Family TDIGEST
      t-Digest for estimating quantiles and ranks
    • BLOOMFILTER

      public static final Family BLOOMFILTER
      Bloom Filter
  • Method Details

    • values

      public static Family[] 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

      public static Family valueOf(String name)
      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 name
      NullPointerException - 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

      public String 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

      public String toString()
      Overrides:
      toString in class Enum<Family>
    • idToFamily

      public static Family idToFamily(int id)
      Returns the Family given the ID
      Parameters:
      id - the given ID
      Returns:
      the Family given the ID
    • stringToFamily

      public static Family stringToFamily(String famName)
      Returns the Family given the family name
      Parameters:
      famName - the family name
      Returns:
      the Family given the family name