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 doubleestimateBias(double e)Estimate the bias using the raw estimates with their respective biases from the HLL++ appendix.intgetNumWords()voidmerge(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.longquery(HllBuffer buffer)Compute the HyperLogLog estimate.doubletrueRsd()Thersdof HLL++ is always equal to or better than thersdrequested.voidupdateByHashcode(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()
Thersdof HLL++ is always equal to or better than thersdrequested. This method returns thersdthis instance actually guarantees.- Returns:
- the actual
rsd.
-
-