Class AbstractHyperLogLogPlusPlus

java.lang.Object
org.elasticsearch.search.aggregations.metrics.AbstractHyperLogLogPlusPlus
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.Releasable
Direct Known Subclasses:
HyperLogLogPlusPlus

public abstract class AbstractHyperLogLogPlusPlus extends Object implements org.elasticsearch.core.Releasable
Base class for HLL++ algorithms. It contains methods for cloning and serializing the data structure.
  • Field Details

  • Constructor Details

    • AbstractHyperLogLogPlusPlus

      public AbstractHyperLogLogPlusPlus(int precision)
  • Method Details

    • getAlgorithm

      protected abstract boolean getAlgorithm(long bucketOrd)
      Algorithm used in the given bucket
    • getLinearCounting

      protected abstract AbstractLinearCounting.HashesIterator getLinearCounting(long bucketOrd)
      Get linear counting algorithm
    • getHyperLogLog

      protected abstract AbstractHyperLogLog.RunLenIterator getHyperLogLog(long bucketOrd)
      Get HyperLogLog algorithm
    • maxOrd

      public abstract long maxOrd()
      Get the number of data structures
    • collect

      public abstract void collect(long bucketOrd, long hash)
      Collect a value in the given bucket
    • clone

      public AbstractHyperLogLogPlusPlus clone(long bucketOrd, BigArrays bigArrays)
      Clone the data structure at the given bucket
    • writeTo

      public void writeTo(long bucket, StreamOutput out) throws IOException
      Throws:
      IOException
    • readFrom

      public static AbstractHyperLogLogPlusPlus readFrom(StreamInput in, BigArrays bigArrays) throws IOException
      Throws:
      IOException
    • equals

      public boolean equals(long thisBucket, AbstractHyperLogLogPlusPlus other, long otherBucket)
    • hashCode

      public int hashCode(long bucket)
    • precision

      public int precision()
      Precision of the algorithm
    • cardinality

      public abstract long cardinality(long bucketOrd)
      Returns the current computed cardinality