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)
HyperLogLogEncoder
add
in interface HyperLogLogEncoder
hash
- the value to aggregatepublic long estimate()
HyperLogLogEncoder
estimate
in interface HyperLogLogEncoder
public 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
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
public com.hazelcast.cardinality.impl.hyperloglog.impl.HyperLogLogEncoding getEncodingType()
HyperLogLogEncoder
HyperLogLogEncoding
getEncodingType
in interface HyperLogLogEncoder
HyperLogLogEncoding
public int getMemoryFootprint()
HyperLogLogEncoder
getMemoryFootprint
in interface HyperLogLogEncoder
public HyperLogLogEncoder asDense()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.