Class StreamSummaryContainer
java.lang.Object
org.infinispan.extendedstats.topK.StreamSummaryContainer
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the key to the read top-key.voidaddLockInformation(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.voidAdds the key to the put top-key.voidaddWriteSkewFailed(Object key) Adds the key to the write skew failed top-key.booleanintstatic StreamSummaryContainergetTopKFrom(StreamSummaryContainer.Stat stat, int topK) Same asgetTopKFrom(StreamSummaryContainer.Stat)but the keys are returned in their String format.getTopKFromAsKeyString(StreamSummaryContainer.Stat stat, int topK) Same asgetTopKFrom(StreamSummaryContainer.Stat, int)but the keys are returned in their String format.inthashCode()booleanfinal voidresetAll()Resets all the top-key collected so far.voidsetCapacity(int capacity) Sets the capacity of the top-key.voidsetEnabled(boolean enabled) Enables or disables the top-key collectiontoString()final voidTries to flush all the enqueue offers to be visible globally.
-
Constructor Details
-
StreamSummaryContainer
-
-
Method Details
-
getOrCreateStreamLibContainer
-
isEnabled
public boolean isEnabled()- Returns:
trueif the top-key collection is enabled,falseotherwise.
-
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
Adds the key to the read top-key.- Parameters:
remote-trueif the key is remote,falseotherwise.
-
addPut
Adds the key to the put top-key.- Parameters:
remote-trueif the key is remote,falseotherwise.
-
addLockInformation
Adds the lock information about the key, namely if the key suffer some contention and if the keys was locked or not.- Parameters:
contention-trueif the key was contented.failLock-trueif the key was not locked.
-
addWriteSkewFailed
Adds the key to the write skew failed top-key. -
getTopKFrom
- Returns:
- the top-key referring to the stat for all the keys.
-
getTopKFrom
- Parameters:
topK- the topK-th first key.- Returns:
- the topK-th first key referring to the stat.
-
getTopKFromAsKeyString
Same asgetTopKFrom(StreamSummaryContainer.Stat)but the keys are returned in their String format. -
getTopKFromAsKeyString
Same asgetTopKFrom(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
-
hashCode
public int hashCode() -
toString
-