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 TypeMethodDescriptionlong
Estimates the cardinality of the set.boolean
int
hashCode()
void
migrate
(CompactSet cs) boolean
boolean
set
(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:HLLRepresentation
Add the given to the representation set.- Specified by:
set
in 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:HLLRepresentation
Estimates the cardinality of the set.- Specified by:
cardinality
in interfaceHLLRepresentation
- Returns:
- An estimation of the real cardinality.
-
needsMigration
public boolean needsMigration() -
migrate
-
equals
-
hashCode
public int hashCode()
-