public final class HyperLogLogPlusPlus extends java.lang.Object implements Releasable
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PRECISION |
static int |
MAX_PRECISION |
static int |
MIN_PRECISION |
| Constructor and Description |
|---|
HyperLogLogPlusPlus(int precision,
BigArrays bigArrays,
long initialBucketCount) |
| Modifier and Type | Method and Description |
|---|---|
long |
cardinality(long bucket) |
void |
close() |
void |
collect(long bucket,
long hash) |
boolean |
equals(long bucket,
HyperLogLogPlusPlus other) |
int |
hashCode(long bucket) |
long |
maxBucket() |
static long |
memoryUsage(int precision)
Return the expected per-bucket memory usage for the given precision.
|
void |
merge(long thisBucket,
HyperLogLogPlusPlus other,
long otherBucket) |
int |
precision() |
static int |
precisionFromThreshold(long count)
Compute the required precision so that
count distinct entries
would be counted with linear counting. |
static HyperLogLogPlusPlus |
readFrom(StreamInput in,
BigArrays bigArrays) |
void |
writeTo(long bucket,
StreamOutput out) |
public static final int MIN_PRECISION
public static final int DEFAULT_PRECISION
public static final int MAX_PRECISION
public HyperLogLogPlusPlus(int precision,
BigArrays bigArrays,
long initialBucketCount)
public static int precisionFromThreshold(long count)
count distinct entries
would be counted with linear counting.public static long memoryUsage(int precision)
public int precision()
public long maxBucket()
public void merge(long thisBucket,
HyperLogLogPlusPlus other,
long otherBucket)
public void collect(long bucket,
long hash)
public long cardinality(long bucket)
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface Releasablepublic int hashCode(long bucket)
public boolean equals(long bucket,
HyperLogLogPlusPlus other)
public void writeTo(long bucket,
StreamOutput out)
throws java.io.IOException
java.io.IOExceptionpublic static HyperLogLogPlusPlus readFrom(StreamInput in, BigArrays bigArrays) throws java.io.IOException
java.io.IOException