Class ExplicitSet
java.lang.Object
org.infinispan.server.resp.hll.internal.ExplicitSet
- All Implemented Interfaces:
HLLRepresentation
The
HyperLogLog explicit representation.
This implementation hashes a new element and stores the value in a set. Although it keeps the hashes, it is still probabilistic, as a hash conflict is possible. And then again, since the whole hash value is stored, this structure has a threshold size. After reaching the threshold, it should convert to a compact representation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongEstimates the cardinality of the set.booleaninthashCode()voidmigrate(CompactSet cs) booleanbooleanset(byte[] data) Add the given to the representation set.
-
Constructor Details
-
ExplicitSet
public ExplicitSet()
-
-
Method Details
-
set
public boolean set(byte[] data) Description copied from interface:HLLRepresentationAdd the given to the representation set.- Specified by:
setin interfaceHLLRepresentation- Parameters:
data- : The data to include.- Returns:
- true if the data was added, and false otherwise.
-
cardinality
public long cardinality()Description copied from interface:HLLRepresentationEstimates the cardinality of the set.- Specified by:
cardinalityin interfaceHLLRepresentation- Returns:
- An estimation of the real cardinality.
-
needsMigration
public boolean needsMigration() -
migrate
-
equals
-
hashCode
-