Class CacheUsageInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.BaseCustomAsyncInterceptor
-
- org.infinispan.extendedstats.topK.CacheUsageInterceptor
-
- All Implemented Interfaces:
org.infinispan.commands.Visitor
,AsyncInterceptor
public class CacheUsageInterceptor extends BaseCustomAsyncInterceptor
Intercepts the VisitableCommands to calculate the corresponding top-key values.- Since:
- 6.0
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_TOP_KEY
-
Fields inherited from class org.infinispan.interceptors.BaseCustomAsyncInterceptor
cache, embeddedCacheManager
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description CacheUsageInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCapacity()
java.util.Map<java.lang.String,java.lang.Long>
getLocalTopGets()
java.util.Map<java.lang.String,java.lang.Long>
getLocalTopPuts()
java.util.Map<java.lang.String,java.lang.Long>
getNLocalTopGets(int n)
java.util.Map<java.lang.String,java.lang.Long>
getNLocalTopPuts(int n)
java.util.Map<java.lang.String,java.lang.Long>
getNRemoteTopGets(int n)
java.util.Map<java.lang.String,java.lang.Long>
getNRemoteTopPuts(int n)
java.util.Map<java.lang.String,java.lang.Long>
getNTopContendedKeys(int n)
java.util.Map<java.lang.String,java.lang.Long>
getNTopLockedKeys(int n)
java.util.Map<java.lang.String,java.lang.Long>
getNTopLockFailedKeys(int n)
java.util.Map<java.lang.String,java.lang.Long>
getNTopWriteSkewFailedKeys(int n)
java.util.Map<java.lang.String,java.lang.Long>
getRemoteTopGets()
java.util.Map<java.lang.String,java.lang.Long>
getRemoteTopPuts()
java.util.Map<java.lang.String,java.lang.Long>
getTopContendedKeys()
java.util.Map<java.lang.String,java.lang.Long>
getTopLockedKeys()
java.util.Map<java.lang.String,java.lang.Long>
getTopLockFailedKeys()
java.util.Map<java.lang.String,java.lang.Long>
getTopWriteSkewFailedKeys()
void
resetStatistics()
void
setStatisticsEnabled(boolean enabled)
void
setTopKValue(int n)
protected void
start()
protected void
stop()
java.lang.Object
visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)
java.lang.Object
visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)
java.lang.Object
visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)
java.lang.Object
visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitClearCommand, visitCommand, visitCommitCommand, visitComputeCommand, visitComputeIfAbsentCommand, visitEntrySetCommand, visitEvictCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPutMapCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand
-
Methods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
-
-
-
-
Field Detail
-
DEFAULT_TOP_KEY
public static final int DEFAULT_TOP_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
visitGetKeyValueCommand
public java.lang.Object visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)
- Specified by:
visitGetKeyValueCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitGetKeyValueCommand
in classDDAsyncInterceptor
-
visitGetAllCommand
public java.lang.Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)
- Specified by:
visitGetAllCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitGetAllCommand
in classDDAsyncInterceptor
-
visitPutKeyValueCommand
public java.lang.Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
- Specified by:
visitPutKeyValueCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitPutKeyValueCommand
in classDDAsyncInterceptor
-
visitPrepareCommand
public java.lang.Object visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)
- Specified by:
visitPrepareCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitPrepareCommand
in classDDAsyncInterceptor
-
resetStatistics
public void resetStatistics()
-
setTopKValue
public void setTopKValue(int n)
-
getCapacity
public int getCapacity()
-
getRemoteTopGets
public java.util.Map<java.lang.String,java.lang.Long> getRemoteTopGets()
-
getNRemoteTopGets
public java.util.Map<java.lang.String,java.lang.Long> getNRemoteTopGets(int n)
-
getLocalTopGets
public java.util.Map<java.lang.String,java.lang.Long> getLocalTopGets()
-
getNLocalTopGets
public java.util.Map<java.lang.String,java.lang.Long> getNLocalTopGets(int n)
-
getRemoteTopPuts
public java.util.Map<java.lang.String,java.lang.Long> getRemoteTopPuts()
-
getNRemoteTopPuts
public java.util.Map<java.lang.String,java.lang.Long> getNRemoteTopPuts(int n)
-
getLocalTopPuts
public java.util.Map<java.lang.String,java.lang.Long> getLocalTopPuts()
-
getNLocalTopPuts
public java.util.Map<java.lang.String,java.lang.Long> getNLocalTopPuts(int n)
-
getTopLockedKeys
public java.util.Map<java.lang.String,java.lang.Long> getTopLockedKeys()
-
getNTopLockedKeys
public java.util.Map<java.lang.String,java.lang.Long> getNTopLockedKeys(int n)
-
getTopContendedKeys
public java.util.Map<java.lang.String,java.lang.Long> getTopContendedKeys()
-
getNTopContendedKeys
public java.util.Map<java.lang.String,java.lang.Long> getNTopContendedKeys(int n)
-
getTopLockFailedKeys
public java.util.Map<java.lang.String,java.lang.Long> getTopLockFailedKeys()
-
getNTopLockFailedKeys
public java.util.Map<java.lang.String,java.lang.Long> getNTopLockFailedKeys(int n)
-
getTopWriteSkewFailedKeys
public java.util.Map<java.lang.String,java.lang.Long> getTopWriteSkewFailedKeys()
-
getNTopWriteSkewFailedKeys
public java.util.Map<java.lang.String,java.lang.Long> getNTopWriteSkewFailedKeys(int n)
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
-
start
protected void start()
- Overrides:
start
in classBaseCustomAsyncInterceptor
-
stop
protected void stop()
- Overrides:
stop
in classBaseCustomAsyncInterceptor
-
-