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
Fields inherited from class org.infinispan.interceptors.BaseCustomAsyncInterceptor
cache, embeddedCacheManager
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getNLocalTopGets
(int n) getNLocalTopPuts
(int n) getNRemoteTopGets
(int n) getNRemoteTopPuts
(int n) getNTopContendedKeys
(int n) getNTopLockedKeys
(int n) getNTopLockFailedKeys
(int n) getNTopWriteSkewFailedKeys
(int n) void
void
setStatisticsEnabled
(boolean enabled) void
setTopKValue
(int n) protected void
start()
protected void
stop()
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, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
visitGetKeyValueCommand
in interfaceVisitor
- Overrides:
visitGetKeyValueCommand
in classDDAsyncInterceptor
-
visitGetAllCommand
public Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) - Specified by:
visitGetAllCommand
in interfaceVisitor
- Overrides:
visitGetAllCommand
in classDDAsyncInterceptor
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) - Specified by:
visitPutKeyValueCommand
in interfaceVisitor
- Overrides:
visitPutKeyValueCommand
in classDDAsyncInterceptor
-
visitPrepareCommand
public Object visitPrepareCommand(TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) - Specified by:
visitPrepareCommand
in interfaceVisitor
- Overrides:
visitPrepareCommand
in 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:
start
in classBaseCustomAsyncInterceptor
-
stop
protected void stop()- Overrides:
stop
in classBaseCustomAsyncInterceptor
-