Package io.airlift.stats.cardinality
Class HyperLogLog
java.lang.Object
io.airlift.stats.cardinality.HyperLogLog
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(long value) voidadd(io.airlift.slice.Slice value) voidaddHash(long hash) Adds a value that has already been hashed to the set of values tracked by this HyperLogLog instance.longintintvoidvoidmergeWith(HyperLogLog other) static HyperLogLognewInstance(int numberOfBuckets) static HyperLogLognewInstance(io.airlift.slice.Slice serialized) io.airlift.slice.Slice
-
Method Details
-
newInstance
-
newInstance
-
add
public void add(long value) -
add
public void add(io.airlift.slice.Slice value) -
addHash
public void addHash(long hash) Adds a value that has already been hashed to the set of values tracked by this HyperLogLog instance.- Parameters:
hash- The hash should be the 64 least significant bits of the murmur3_128 hash of the value. For example: io.airlift.slice.Murmur3.hash64(value).
-
mergeWith
-
cardinality
public long cardinality() -
estimatedInMemorySize
public int estimatedInMemorySize() -
estimatedSerializedSize
public int estimatedSerializedSize() -
serialize
public io.airlift.slice.Slice serialize() -
makeDense
public void makeDense()
-