Class StreamSummaryContainer

java.lang.Object
org.infinispan.extendedstats.topK.StreamSummaryContainer

public class StreamSummaryContainer extends Object
This contains all the stream lib top keys. Stream lib is a space efficient technique to obtains the top-most counters.
Since:
6.0
Author:
Pedro Ruivo
  • Constructor Details

    • StreamSummaryContainer

      public StreamSummaryContainer(String cacheName, String address)
  • Method Details

    • getOrCreateStreamLibContainer

      public static StreamSummaryContainer getOrCreateStreamLibContainer(Cache cache)
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if the top-key collection is enabled, false otherwise.
    • setEnabled

      public void setEnabled(boolean enabled)
      Enables or disables the top-key collection
    • getCapacity

      public int getCapacity()
    • setCapacity

      public void setCapacity(int capacity)
      Sets the capacity of the top-key. The capacity defines the maximum number of keys that are tracked. Remember that top-key is a probabilistic counter so the higher the number of keys, the more precise will be the counters
    • addGet

      public void addGet(Object key, boolean remote)
      Adds the key to the read top-key.
      Parameters:
      remote - true if the key is remote, false otherwise.
    • addPut

      public void addPut(Object key, boolean remote)
      Adds the key to the put top-key.
      Parameters:
      remote - true if the key is remote, false otherwise.
    • addLockInformation

      public void addLockInformation(Object key, boolean contention, boolean failLock)
      Adds the lock information about the key, namely if the key suffer some contention and if the keys was locked or not.
      Parameters:
      contention - true if the key was contented.
      failLock - true if the key was not locked.
    • addWriteSkewFailed

      public void addWriteSkewFailed(Object key)
      Adds the key to the write skew failed top-key.
    • getTopKFrom

      public Map<Object,Long> getTopKFrom(StreamSummaryContainer.Stat stat)
      Returns:
      the top-key referring to the stat for all the keys.
    • getTopKFrom

      public Map<Object,Long> getTopKFrom(StreamSummaryContainer.Stat stat, int topK)
      Parameters:
      topK - the topK-th first key.
      Returns:
      the topK-th first key referring to the stat.
    • getTopKFromAsKeyString

      public Map<String,Long> getTopKFromAsKeyString(StreamSummaryContainer.Stat stat)
      Same as getTopKFrom(StreamSummaryContainer.Stat) but the keys are returned in their String format.
    • getTopKFromAsKeyString

      public Map<String,Long> getTopKFromAsKeyString(StreamSummaryContainer.Stat stat, int topK)
      Same as getTopKFrom(StreamSummaryContainer.Stat, int) but the keys are returned in their String format.
    • resetAll

      public final void resetAll()
      Resets all the top-key collected so far.
    • tryFlushAll

      public final void tryFlushAll()
      Tries to flush all the enqueue offers to be visible globally.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object