public class SparseHyperLogLogEncoder extends Object implements HyperLogLogEncoder
| Constructor and Description |
|---|
SparseHyperLogLogEncoder() |
SparseHyperLogLogEncoder(int p,
int pPrime) |
| 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 migth have affected the cardinality, it is just a hint, and it relies to
the respective implementation.
|
HyperLogLogEncoder |
asDense() |
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.
|
void |
init(int p,
int pPrime,
com.hazelcast.cardinality.impl.hyperloglog.impl.SparseHyperLogLogEncoder.VariableLengthDiffArray register) |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public SparseHyperLogLogEncoder()
public SparseHyperLogLogEncoder(int p,
int pPrime)
public void init(int p,
int pPrime,
com.hazelcast.cardinality.impl.hyperloglog.impl.SparseHyperLogLogEncoder.VariableLengthDiffArray register)
public boolean add(long hash)
HyperLogLogEncoderadd in interface HyperLogLogEncoderhash - the value to aggregatepublic long estimate()
HyperLogLogEncoderestimate in interface HyperLogLogEncoderpublic int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getId()
IdentifiedDataSerializablegetId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOExceptionpublic void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOExceptionpublic com.hazelcast.cardinality.impl.hyperloglog.impl.HyperLogLogEncoding getEncodingType()
HyperLogLogEncoderHyperLogLogEncodinggetEncodingType in interface HyperLogLogEncoderHyperLogLogEncodingpublic int getMemoryFootprint()
HyperLogLogEncodergetMemoryFootprint in interface HyperLogLogEncoderpublic HyperLogLogEncoder asDense()
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.