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()
HyperLogLogestimate in interface HyperLogLogpublic void add(long hash)
HyperLogLogadd in interface HyperLogLoghash - the value to aggregatepublic void addAll(long[] hashes)
HyperLogLogaddAll in interface HyperLogLoghashes - the hash values array to aggregatepublic void merge(HyperLogLog other)
HyperLogLogmerge in interface HyperLogLogother - The second HLL to be merged into this onepublic int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getId()
IdentifiedDataSerializablegetId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - 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
DataSerializablereadData in interface DataSerializablein - 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.