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 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
-
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 Detail
-
DEFAULT_TOP_KEY
public static final int DEFAULT_TOP_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
@ManagedAttribute(description="Show the top 10 keys most read remotely by this instance", displayName="Top Remote Read Keys") public Map<String,Long> getRemoteTopGets()
-
getNRemoteTopGets
@ManagedOperation(description="Show the top n keys most read remotely by this instance", displayName="Nth Top Remote Read Keys") public Map<String,Long> getNRemoteTopGets(@Parameter(name="n",description="the n-th top key to return") int n)
-
getLocalTopGets
@ManagedAttribute(description="Show the top 10 keys most read locally by this instance", displayName="Top Local Read Keys") public Map<String,Long> getLocalTopGets()
-
getNLocalTopGets
@ManagedOperation(description="Show the top n keys most read locally by this instance", displayName="Nth Top Local Read Keys") public Map<String,Long> getNLocalTopGets(@Parameter(name="n",description="the n-th top key to return") int n)
-
getRemoteTopPuts
@ManagedAttribute(description="Show the top 10 keys most write remotely by this instance", displayName="Top Remote Write Keys") public Map<String,Long> getRemoteTopPuts()
-
getNRemoteTopPuts
@ManagedOperation(description="Show the top n keys most write remotely by this instance", displayName="Nth Top Remote Write Keys") public Map<String,Long> getNRemoteTopPuts(@Parameter(name="n",description="the n-th top key to return") int n)
-
getLocalTopPuts
@ManagedAttribute(description="Show the top 10 keys most write locally by this instance", displayName="Top Local Write Keys") public Map<String,Long> getLocalTopPuts()
-
getNLocalTopPuts
@ManagedOperation(description="Show the top n keys most write locally by this instance", displayName="Nth Top Local Write Keys") public Map<String,Long> getNLocalTopPuts(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopLockedKeys
@ManagedAttribute(description="Show the top 10 keys most locked", displayName="Top Locked Keys") public Map<String,Long> getTopLockedKeys()
-
getNTopLockedKeys
@ManagedOperation(description="Show the top n keys most locked", displayName="Nth Top Locked Keys") public Map<String,Long> getNTopLockedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopContendedKeys
@ManagedAttribute(description="Show the top 10 keys most contended", displayName="Top Contended Keys") public Map<String,Long> getTopContendedKeys()
-
getNTopContendedKeys
@ManagedOperation(description="Show the top n keys most contended", displayName="Nth Top Contended Keys") public Map<String,Long> getNTopContendedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopLockFailedKeys
@ManagedAttribute(description="Show the top 10 keys whose lock acquisition failed by timeout", displayName="Top Keys whose Lock Acquisition Failed by Timeout") public Map<String,Long> getTopLockFailedKeys()
-
getNTopLockFailedKeys
@ManagedOperation(description="Show the top n keys whose lock acquisition failed ", displayName="Nth Top Keys whose Lock Acquisition Failed by Timeout") public Map<String,Long> getNTopLockFailedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopWriteSkewFailedKeys
@ManagedAttribute(description="Show the top 10 keys whose write skew check was failed", displayName="Top Keys whose Write Skew Check was failed") public Map<String,Long> getTopWriteSkewFailedKeys()
-
getNTopWriteSkewFailedKeys
@ManagedOperation(description="Show the top n keys whose write skew check was failed", displayName="Nth Top Keys whose Write Skew Check was failed") public Map<String,Long> getNTopWriteSkewFailedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
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
-
-