Package org.infinispan.commands.read
Class SizeCommand
- java.lang.Object
-
- org.infinispan.commands.AbstractFlagAffectedCommand
-
- org.infinispan.commands.read.AbstractLocalCommand
-
- org.infinispan.commands.read.SizeCommand
-
- All Implemented Interfaces:
FlagAffectedCommand
,LocalCommand
,ReplicableCommand
,VisitableCommand
public class SizeCommand extends AbstractLocalCommand implements VisitableCommand
Command to calculate the size of the cache- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com, Trustin Lee
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType
-
-
Constructor Summary
Constructors Constructor Description SizeCommand(Cache<Object,?> cache, long flags)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
acceptVisitor(InvocationContext ctx, Visitor visitor)
Accept a visitor, and return the result of accepting this visitor.VisitableCommand.LoadType
loadType()
Integer
perform(InvocationContext ctx)
Performs the primary function of the command.String
toString()
-
Methods inherited from class org.infinispan.commands.read.AbstractLocalCommand
canBlock, getCommandId, isReturnValueExpected, readFrom, writeTo
-
Methods inherited from class org.infinispan.commands.AbstractFlagAffectedCommand
getFlagsBitSet, hasSameFlags, printFlags, setFlagsBitSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlag, addFlags, addFlags, getFlags, hasAllFlags, hasAnyFlag, hasFlag, setFlags
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, getCommandId, invoke, invokeAsync, isReturnValueExpected, isSuccessful, readFrom, setOrigin, writeTo
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
ignoreCommandOnStatus, shouldInvoke
-
-
-
-
Method Detail
-
acceptVisitor
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Description copied from interface:VisitableCommand
Accept a visitor, and return the result of accepting this visitor.- Specified by:
acceptVisitor
in interfaceVisitableCommand
- Parameters:
ctx
- invocation contextvisitor
- visitor to accept- Returns:
- arbitrary return value
- Throws:
Throwable
- in the event of problems
-
loadType
public VisitableCommand.LoadType loadType()
- Specified by:
loadType
in interfaceVisitableCommand
- Returns:
- Nodes on which the command needs to read the previous values of the keys it acts on.
-
perform
public Integer perform(InvocationContext ctx) throws Throwable
Description copied from interface:VisitableCommand
Performs the primary function of the command. Please see specific implementation classes for details on what is performed as well as return types. Important: this method will be invoked at the end of interceptors chain. It should never be called directly from a custom interceptor.- Specified by:
perform
in interfaceReplicableCommand
- Specified by:
perform
in interfaceVisitableCommand
- Parameters:
ctx
- invocation context- Returns:
- arbitrary return value generated by performing this command
- Throws:
Throwable
- in the event of problems.
-
-