Class 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 Detail

      • StreamSummaryContainer

        public StreamSummaryContainer​(String cacheName,
                                      String address)
    • Method Detail

      • 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.
      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object