Class AbstractHyperLogLog


public abstract class AbstractHyperLogLog extends Object
Hyperloglog counter, implemented based on pseudo code from and its appendix Trying to understand what this class does without having read the paper is considered adventurous.
  • Field Details

    • m

      protected final int m

      public static final int MIN_PRECISION
      See Also:

      public static final int MAX_PRECISION
      See Also:
    • p

      protected final int p
  • Constructor Details

    • AbstractHyperLogLog

      public AbstractHyperLogLog(int precision)
  • Method Details

    • addRunLen

      protected abstract void addRunLen(long bucketOrd, int register, int runLen)
      Add a new runLen to the register. Implementor should only keep the value if it is bigger that the current value of the register provided.
    • getRunLens

      protected abstract AbstractHyperLogLog.RunLenIterator getRunLens(long bucketOrd)
      Returns an iterator over all values of the register.
    • collect

      public void collect(long bucketOrd, long hash)
    • cardinality

      public long cardinality(long bucketOrd)
      Returns the current computed cardinality
    • collectEncoded

      public void collectEncoded(long bucketOrd, int encoded)
    • precision

      public int precision()
      Precision of the algorithm