Class AbstractHyperLogLogPlusPlus
java.lang.Object
org.elasticsearch.search.aggregations.metrics.AbstractHyperLogLogPlusPlus
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Releasable
- Direct Known Subclasses:
HyperLogLogPlusPlus
public abstract class AbstractHyperLogLogPlusPlus extends java.lang.Object implements Releasable
Base class for HLL++ algorithms.
It contains methods for cloning and serializing the data structure.
-
Field Summary
Fields Modifier and Type Field Description static booleanHYPERLOGLOGstatic booleanLINEAR_COUNTINGstatic intMAX_PRECISIONstatic intMIN_PRECISIONprotected intp -
Constructor Summary
Constructors Constructor Description AbstractHyperLogLogPlusPlus(int precision) -
Method Summary
Modifier and Type Method Description abstract longcardinality(long bucketOrd)Returns the current computed cardinalityAbstractHyperLogLogPlusPlusclone(long bucketOrd, BigArrays bigArrays)Clone the data structure at the given bucketabstract voidcollect(long bucketOrd, long hash)Collect a value in the given bucketbooleanequals(long thisBucket, AbstractHyperLogLogPlusPlus other, long otherBucket)protected abstract booleangetAlgorithm(long bucketOrd)Algorithm used in the given bucketprotected abstract AbstractHyperLogLog.RunLenIteratorgetHyperLogLog(long bucketOrd)Get HyperLogLog algorithmprotected abstract AbstractLinearCounting.HashesIteratorgetLinearCounting(long bucketOrd)Get linear counting algorithminthashCode(long bucket)abstract longmaxOrd()Get the number of data structuresintprecision()Precision of the algorithmstatic AbstractHyperLogLogPlusPlusreadFrom(StreamInput in, BigArrays bigArrays)voidwriteTo(long bucket, StreamOutput out)
-
Field Details
-
LINEAR_COUNTING
public static final boolean LINEAR_COUNTING- See Also:
- Constant Field Values
-
HYPERLOGLOG
public static final boolean HYPERLOGLOG- See Also:
- Constant Field Values
-
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
-
AbstractHyperLogLogPlusPlus
public AbstractHyperLogLogPlusPlus(int precision)
-
-
Method Details
-
getAlgorithm
protected abstract boolean getAlgorithm(long bucketOrd)Algorithm used in the given bucket -
getLinearCounting
Get linear counting algorithm -
getHyperLogLog
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
Clone the data structure at the given bucket -
writeTo
- Throws:
java.io.IOException
-
readFrom
public static AbstractHyperLogLogPlusPlus readFrom(StreamInput in, BigArrays bigArrays) throws java.io.IOException- Throws:
java.io.IOException
-
equals
-
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
-