Class HyperLogLogPlusPlus
- java.lang.Object
-
- org.apache.flink.table.runtime.functions.aggregate.hyperloglog.HyperLogLogPlusPlus
-
public class HyperLogLogPlusPlus extends Object
The implement of HyperLogLogPlusPlus is inspired from Apache Spark.
-
-
Constructor Summary
Constructors Constructor Description HyperLogLogPlusPlus(double relativeSD)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
estimateBias(double e)
Estimate the bias using the raw estimates with their respective biases from the HLL++ appendix.int
getNumWords()
void
merge(HllBuffer buffer1, HllBuffer buffer2)
Merge the HLL buffers by iterating through the registers in both buffers and select the maximum number of leading zeros for each register.long
query(HllBuffer buffer)
Compute the HyperLogLog estimate.double
trueRsd()
Thersd
of HLL++ is always equal to or better than thersd
requested.void
updateByHashcode(HllBuffer buffer, long hash)
Update the HLL++ buffer.
-
-
-
Method Detail
-
getNumWords
public int getNumWords()
-
updateByHashcode
public void updateByHashcode(HllBuffer buffer, long hash)
Update the HLL++ buffer.
-
merge
public void merge(HllBuffer buffer1, HllBuffer buffer2)
Merge the HLL buffers by iterating through the registers in both buffers and select the maximum number of leading zeros for each register.
-
estimateBias
public double estimateBias(double e)
Estimate the bias using the raw estimates with their respective biases from the HLL++ appendix. We currently use KNN interpolation to determine the bias (as suggested in the paper).
-
query
public long query(HllBuffer buffer)
Compute the HyperLogLog estimate.Variable names in the HLL++ paper match variable names in the code.
-
trueRsd
public double trueRsd()
Thersd
of HLL++ is always equal to or better than thersd
requested. This method returns thersd
this instance actually guarantees.- Returns:
- the actual
rsd
.
-
-