Package org.infinispan.stats.topK
Class CacheUsageInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.BaseCustomAsyncInterceptor
-
- org.infinispan.stats.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 intDEFAULT_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 intgetCapacity()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()voidresetStatistics()voidsetStatisticsEnabled(boolean enabled)voidsetTopKValue(int n)protected voidstart()protected voidstop()java.lang.ObjectvisitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)java.lang.ObjectvisitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)java.lang.ObjectvisitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)java.lang.ObjectvisitPutKeyValueCommand(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) throws java.lang.Throwable
- Specified by:
visitGetKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetKeyValueCommandin classDDAsyncInterceptor- Throws:
java.lang.Throwable
-
visitGetAllCommand
public java.lang.Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) throws java.lang.Throwable
- Specified by:
visitGetAllCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetAllCommandin classDDAsyncInterceptor- Throws:
java.lang.Throwable
-
visitPutKeyValueCommand
public java.lang.Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) throws java.lang.Throwable
- Specified by:
visitPutKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitPutKeyValueCommandin classDDAsyncInterceptor- Throws:
java.lang.Throwable
-
visitPrepareCommand
public java.lang.Object visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) throws java.lang.Throwable- Specified by:
visitPrepareCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitPrepareCommandin classDDAsyncInterceptor- Throws:
java.lang.Throwable
-
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:
startin classBaseCustomAsyncInterceptor
-
stop
protected void stop()
- Overrides:
stopin classBaseCustomAsyncInterceptor
-
-