Class ExplicitSet

java.lang.Object
org.infinispan.server.resp.hll.internal.ExplicitSet
All Implemented Interfaces:
HLLRepresentation

@ThreadSafe @ProtoTypeId(6102) public class ExplicitSet extends Object implements 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 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 interface HLLRepresentation
      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 interface HLLRepresentation
      Returns:
      An estimation of the real cardinality.
    • needsMigration

      public boolean needsMigration()
    • migrate

      public void migrate(CompactSet cs)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object