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:
Visitor,AsyncInterceptor
@MBean(objectName="CacheUsageStatistics",
description="Keeps tracks of the accessed keys")
public class CacheUsageInterceptor
extends BaseCustomAsyncInterceptor
Intercepts the VisitableCommands to calculate the corresponding top-key values.
- Since:
- 6.0
- Author:
- Pedro Ruivo
-
Field Summary
FieldsFields inherited from class org.infinispan.interceptors.BaseCustomAsyncInterceptor
cache, embeddedCacheManagerFields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetNLocalTopGets(int n) getNLocalTopPuts(int n) getNRemoteTopGets(int n) getNRemoteTopPuts(int n) getNTopContendedKeys(int n) getNTopLockedKeys(int n) getNTopLockFailedKeys(int n) getNTopWriteSkewFailedKeys(int n) voidvoidsetStatisticsEnabled(boolean enabled) voidsetTopKValue(int n) protected voidstart()protected voidstop()visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command) visitPrepareCommand(TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) 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, visitInvalidateCommand, visitInvalidateL1Command, visitIracPutKeyValueCommand, visitKeySetCommand, visitLockControlCommand, visitPutMapCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitTouchCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommandMethods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.commands.Visitor
visitRemoveExpiredCommand
-
Field Details
-
DEFAULT_TOP_KEY
public static final int DEFAULT_TOP_KEY- See Also:
-
-
Constructor Details
-
CacheUsageInterceptor
public CacheUsageInterceptor()
-
-
Method Details
-
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command) - Specified by:
visitGetKeyValueCommandin interfaceVisitor- Overrides:
visitGetKeyValueCommandin classDDAsyncInterceptor
-
visitGetAllCommand
public Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) - Specified by:
visitGetAllCommandin interfaceVisitor- Overrides:
visitGetAllCommandin classDDAsyncInterceptor
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) - Specified by:
visitPutKeyValueCommandin interfaceVisitor- Overrides:
visitPutKeyValueCommandin classDDAsyncInterceptor
-
visitPrepareCommand
public Object visitPrepareCommand(TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) - Specified by:
visitPrepareCommandin interfaceVisitor- Overrides:
visitPrepareCommandin classDDAsyncInterceptor
-
resetStatistics
@ManagedOperation(description="Resets statistics gathered by this component", displayName="Reset Statistics (Statistics)") public void resetStatistics() -
setTopKValue
@ManagedOperation(description="Set K for the top-K values", displayName="Set capacity") public void setTopKValue(@Parameter(name="n",description="the n-th top key to collect") int n) -
getCapacity
@ManagedAttribute(description="Shows the current capacity for top-K values", displayName="getCapacity") public int getCapacity() -
getRemoteTopGets
-
getNRemoteTopGets
-
getLocalTopGets
-
getNLocalTopGets
-
getRemoteTopPuts
-
getNRemoteTopPuts
-
getLocalTopPuts
-
getNLocalTopPuts
-
getTopLockedKeys
-
getNTopLockedKeys
-
getTopContendedKeys
-
getNTopContendedKeys
-
getTopLockFailedKeys
-
getNTopLockFailedKeys
-
getTopWriteSkewFailedKeys
-
getNTopWriteSkewFailedKeys
-
setStatisticsEnabled
@ManagedOperation(description="Show the top n keys whose write skew check was failed", displayName="Top Keys whose Write Skew Check was failed") public void setStatisticsEnabled(@Parameter(name="enabled",description="true to enable the top-k collection") boolean enabled) -
start
protected void start()- Overrides:
startin classBaseCustomAsyncInterceptor
-
stop
protected void stop()- Overrides:
stopin classBaseCustomAsyncInterceptor
-