Class 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
    • Constructor Detail

      • CacheUsageInterceptor

        public CacheUsageInterceptor()
    • Method Detail

      • visitGetKeyValueCommand

        public java.lang.Object visitGetKeyValueCommand​(InvocationContext ctx,
                                                        org.infinispan.commands.read.GetKeyValueCommand command)
                                                 throws java.lang.Throwable
        Specified by:
        visitGetKeyValueCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitGetKeyValueCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitGetAllCommand

        public java.lang.Object visitGetAllCommand​(InvocationContext ctx,
                                                   org.infinispan.commands.read.GetAllCommand command)
                                            throws java.lang.Throwable
        Specified by:
        visitGetAllCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitGetAllCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitPutKeyValueCommand

        public java.lang.Object visitPutKeyValueCommand​(InvocationContext ctx,
                                                        org.infinispan.commands.write.PutKeyValueCommand command)
                                                 throws java.lang.Throwable
        Specified by:
        visitPutKeyValueCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitPutKeyValueCommand in class DDAsyncInterceptor
        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:
        visitPrepareCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitPrepareCommand in class DDAsyncInterceptor
        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)