Class StreamSummaryContainer

  • public class StreamSummaryContainer
    extends java.lang.Object
    This contains all the stream lib top keys. Stream lib is a space efficient technique to obtains the top-most counters.
    Pedro Ruivo
    • Constructor Detail

      • StreamSummaryContainer

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

      • isEnabled

        public boolean isEnabled()
        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​(java.lang.Object key,
                           boolean remote)
        Adds the key to the read top-key.
        remote - true if the key is remote, false otherwise.
      • addPut

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

        public void addLockInformation​(java.lang.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.
        contention - true if the key was contented.
        failLock - true if the key was not locked.
      • addWriteSkewFailed

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

        public java.util.Map<java.lang.Object,​java.lang.Long> getTopKFrom​(StreamSummaryContainer.Stat stat,
                                                                                int topK)
        topK - the topK-th first key.
        the topK-th first key referring to the stat.
      • 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​(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object