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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the key to the read top-key.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.void
Adds the key to the put top-key.void
addWriteSkewFailed
(Object key) Adds the key to the write skew failed top-key.boolean
int
static StreamSummaryContainer
getTopKFrom
(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.int
hashCode()
boolean
final void
resetAll()
Resets all the top-key collected so far.void
setCapacity
(int capacity) Sets the capacity of the top-key.void
setEnabled
(boolean enabled) Enables or disables the top-key collectiontoString()
final void
Tries to flush all the enqueue offers to be visible globally.
-
Constructor Details
-
StreamSummaryContainer
-
-
Method Details
-
getOrCreateStreamLibContainer
-
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
Adds the key to the read top-key.- Parameters:
remote
-true
if the key is remote,false
otherwise.
-
addPut
Adds the key to the put top-key.- Parameters:
remote
-true
if the key is remote,false
otherwise.
-
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
-true
if the key was contented.failLock
-true
if 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
-