Package io.airlift.stats.cardinality
Class HyperLogLog
- java.lang.Object
-
- io.airlift.stats.cardinality.HyperLogLog
-
public class HyperLogLog extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(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.longcardinality()intestimatedInMemorySize()intestimatedSerializedSize()voidmakeDense()voidmergeWith(HyperLogLog other)static HyperLogLognewInstance(int numberOfBuckets)static HyperLogLognewInstance(io.airlift.slice.Slice serialized)io.airlift.slice.Sliceserialize()
-
-
-
Method Detail
-
newInstance
public static HyperLogLog newInstance(int numberOfBuckets)
-
newInstance
public static HyperLogLog newInstance(io.airlift.slice.Slice serialized)
-
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
public void mergeWith(HyperLogLog other)
-
cardinality
public long cardinality()
-
estimatedInMemorySize
public int estimatedInMemorySize()
-
estimatedSerializedSize
public int estimatedSerializedSize()
-
serialize
public io.airlift.slice.Slice serialize()
-
makeDense
public void makeDense()
-
-