public class HyperLogLogImpl extends Object implements HyperLogLog, Versioned
Constructor and Description |
---|
HyperLogLogImpl() |
HyperLogLogImpl(int p) |
Modifier and Type | Method and Description |
---|---|
void |
add(long hash)
Aggregates the hash in the HyperLogLog registers.
|
void |
addAll(long[] hashes)
Batch aggregation of hash values in the HyperLogLog registers.
|
long |
estimate()
Computes a new estimate for the current status of the registers.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
void |
merge(HyperLogLog other)
Merge the two HyperLogLog structures in one.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public HyperLogLogImpl()
public HyperLogLogImpl(int p)
public long estimate()
HyperLogLog
estimate
in interface HyperLogLog
public void add(long hash)
HyperLogLog
add
in interface HyperLogLog
hash
- the value to aggregatepublic void addAll(long[] hashes)
HyperLogLog
addAll
in interface HyperLogLog
hashes
- the hash values array to aggregatepublic void merge(HyperLogLog other)
HyperLogLog
merge
in interface HyperLogLog
other
- The second HLL to be merged into this onepublic int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.