Class AbstractHyperLogLog
java.lang.Object
org.elasticsearch.search.aggregations.metrics.AbstractHyperLogLog
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
Trying to understand what this class does without having read the paper is considered adventurous.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Iterator over a HyperLogLog register -
Field Summary
Modifier and TypeFieldDescriptionprotected int
static int
static int
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addRunLen(long bucketOrd, int register, int runLen)
Add a new runLen to the register.long
cardinality(long bucketOrd)
Returns the current computed cardinalityvoid
collect(long bucketOrd, long hash)
void
collectEncoded(long bucketOrd, int encoded)
protected abstract AbstractHyperLogLog.RunLenIterator
getRunLens(long bucketOrd)
Returns an iterator over all values of the register.int
Precision of the algorithm
-
Field Details
-
m
protected final int m -
MIN_PRECISION
public static final int MIN_PRECISION- See Also:
- Constant Field Values
-
MAX_PRECISION
public static final int MAX_PRECISION- See Also:
- Constant Field Values
-
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
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
-