public class DenseHyperLogLogEncoder extends Object implements HyperLogLogEncoder
| Constructor and Description |
|---|
DenseHyperLogLogEncoder() |
DenseHyperLogLogEncoder(int p) |
DenseHyperLogLogEncoder(int p,
byte[] register) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(long hash)
Aggregates the hash value in the HyperLogLog registers, and returns a hint if the
operation might have affected the cardinality, it is just a hint, and it relies to
the respective implementation.
|
long |
estimate()
Computes a new estimate for the current status of the registers.
|
com.hazelcast.cardinality.impl.hyperloglog.impl.HyperLogLogEncoding |
getEncodingType()
Returns the encoding type of this instance; see:
HyperLogLogEncoding |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
int |
getMemoryFootprint()
Returns the size in memory occupied (in bytes) for this implementation of HyperLogLog.
|
HyperLogLogEncoder |
merge(HyperLogLogEncoder encoder)
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 DenseHyperLogLogEncoder()
public DenseHyperLogLogEncoder(int p)
public DenseHyperLogLogEncoder(int p,
byte[] register)
public boolean add(long hash)
HyperLogLogEncoderadd in interface HyperLogLogEncoderhash - the value to aggregatepublic long estimate()
HyperLogLogEncoderestimate in interface HyperLogLogEncoderpublic HyperLogLogEncoder merge(HyperLogLogEncoder encoder)
HyperLogLogEncodermerge in interface HyperLogLogEncoderencoder - The second HLL to be merged into this oneHyperLogLogEncoder the unionpublic 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.public int getMemoryFootprint()
HyperLogLogEncodergetMemoryFootprint in interface HyperLogLogEncoderpublic com.hazelcast.cardinality.impl.hyperloglog.impl.HyperLogLogEncoding getEncodingType()
HyperLogLogEncoderHyperLogLogEncodinggetEncodingType in interface HyperLogLogEncoderHyperLogLogEncodingCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.