Class HyperLogLogPlusPlus

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

public final class HyperLogLogPlusPlus extends AbstractHyperLogLogPlusPlus
Hyperloglog++ counter, implemented based on pseudo code from http://static.googleusercontent.com/media/research.google.com/fr//pubs/archive/40671.pdf and its appendix https://docs.google.com/document/d/1gyjfMHy43U9OWBXxfaeG-3MjGzejW1dlpyMwEYAAWEI/view?fullscreen This implementation is different from the original implementation in that it uses a hash table instead of a sorted list for linear counting. Although this requires more space and makes hyperloglog (which is less accurate) used sooner, this is also considerably faster. Trying to understand what this class does without having read the paper is considered adventurous. The HyperLogLogPlusPlus contains two algorithms, one for linear counting and the HyperLogLog algorithm. Initially hashes added to the data structure are processed using the linear counting until a threshold defined by the precision is reached where the data is replayed to the HyperLogLog algorithm and then this is used. It supports storing several HyperLogLogPlusPlus structures which are identified by a bucket number.