Package org.infinispan.commands.write
Class InvalidateL1Command
- java.lang.Object
-
- org.infinispan.commands.AbstractFlagAffectedCommand
-
- org.infinispan.commands.AbstractTopologyAffectedCommand
-
- org.infinispan.commands.write.InvalidateCommand
-
- org.infinispan.commands.write.InvalidateL1Command
-
- All Implemented Interfaces:
FlagAffectedCommand,ReplicableCommand,TopologyAffectedCommand,VisitableCommand,WriteCommand,RemoteLockCommand
public class InvalidateL1Command extends InvalidateCommand
Invalidates an entry in a L1 cache (used with DIST mode)- Since:
- 4.0
- Author:
- Manik Surtani, Mircea.Markus@jboss.com
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType
-
-
Field Summary
Fields Modifier and Type Field Description static intCOMMAND_ID-
Fields inherited from class org.infinispan.commands.write.InvalidateCommand
commandInvocationId, keys
-
-
Constructor Summary
Constructors Constructor Description InvalidateL1Command()InvalidateL1Command(long flagsBitSet, Collection<Object> keys, CommandInvocationId commandInvocationId)InvalidateL1Command(long flagsBitSet, CommandInvocationId commandInvocationId, Object... keys)InvalidateL1Command(Address writeOrigin, long flagsBitSet, Collection<Object> keys, CommandInvocationId commandInvocationId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectacceptVisitor(InvocationContext ctx, Visitor visitor)Accept a visitor, and return the result of accepting this visitor.bytegetCommandId()Used by marshallers to convert this command into an id for streaming.Collection<?>getKeysToLock()It returns aCollectionwith the keys to be lock.booleanisCausedByALocalWrite(Address address)Returns true if the write that caused the invalidation was performed on this node.voidreadFrom(ObjectInput input)Reads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput).voidsetKeys(Object[] keys)StringtoString()voidwriteTo(ObjectOutput output)Writes this instance to theObjectOutput.-
Methods inherited from class org.infinispan.commands.write.InvalidateCommand
equals, fail, getAffectedKeys, getCommandInvocationId, getInternalMetadata, getKeyLockOwner, getKeys, getValueMatcher, hashCode, hasSkipLocking, hasZeroLockAcquisition, isConditional, isReturnValueExpected, isSuccessful, loadType, setInternalMetadata, setValueMatcher
-
Methods inherited from class org.infinispan.commands.AbstractTopologyAffectedCommand
getTopologyId, setTopologyId
-
Methods inherited from class org.infinispan.commands.AbstractFlagAffectedCommand
getFlagsBitSet, hasSameFlags, printFlags, setFlagsBitSet
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlag, addFlags, addFlags, getFlags, getFlagsBitSet, hasAllFlags, hasAnyFlag, hasFlag, setFlags, setFlagsBitSet
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, invoke, invokeAsync, setOrigin
-
Methods inherited from interface org.infinispan.commands.TopologyAffectedCommand
getTopologyId, setTopologyId
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
init
-
Methods inherited from interface org.infinispan.commands.write.WriteCommand
isWriteOnly, updateStatusFromRemoteResponse
-
-
-
-
Field Detail
-
COMMAND_ID
public static final int COMMAND_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InvalidateL1Command
public InvalidateL1Command()
-
InvalidateL1Command
public InvalidateL1Command(long flagsBitSet, CommandInvocationId commandInvocationId, Object... keys)
-
InvalidateL1Command
public InvalidateL1Command(long flagsBitSet, Collection<Object> keys, CommandInvocationId commandInvocationId)
-
InvalidateL1Command
public InvalidateL1Command(Address writeOrigin, long flagsBitSet, Collection<Object> keys, CommandInvocationId commandInvocationId)
-
-
Method Detail
-
getCommandId
public byte getCommandId()
Description copied from interface:ReplicableCommandUsed by marshallers to convert this command into an id for streaming.- Specified by:
getCommandIdin interfaceReplicableCommand- Overrides:
getCommandIdin classInvalidateCommand- Returns:
- the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
-
setKeys
public void setKeys(Object[] keys)
-
getKeysToLock
public Collection<?> getKeysToLock()
Description copied from interface:RemoteLockCommandIt returns aCollectionwith the keys to be lock.It may return an empty collection if no keys needs to be locked independently of the return value of
RemoteLockCommand.hasSkipLocking(). It may contains duplicated keys andnullis not a valid return value.- Specified by:
getKeysToLockin interfaceRemoteLockCommand- Overrides:
getKeysToLockin classInvalidateCommand- Returns:
- a
Collectionof keys to lock.
-
writeTo
public void writeTo(ObjectOutput output) throws IOException
Description copied from interface:ReplicableCommandWrites this instance to theObjectOutput.- Specified by:
writeToin interfaceReplicableCommand- Overrides:
writeToin classInvalidateCommand- Parameters:
output- the stream.- Throws:
IOException- if an error occurred during the I/O.
-
readFrom
public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
Description copied from interface:ReplicableCommandReads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput).- Specified by:
readFromin interfaceReplicableCommand- Overrides:
readFromin classInvalidateCommand- Parameters:
input- the stream to read.- Throws:
IOException- if an error occurred during the I/O.ClassNotFoundException- if it tries to load an undefined class.
-
acceptVisitor
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Description copied from interface:VisitableCommandAccept a visitor, and return the result of accepting this visitor.- Specified by:
acceptVisitorin interfaceVisitableCommand- Overrides:
acceptVisitorin classInvalidateCommand- Parameters:
ctx- invocation contextvisitor- visitor to accept- Returns:
- arbitrary return value
- Throws:
Throwable- in the event of problems
-
toString
public String toString()
- Overrides:
toStringin classInvalidateCommand
-
isCausedByALocalWrite
public boolean isCausedByALocalWrite(Address address)
Returns true if the write that caused the invalidation was performed on this node. More formal, if a put(k) happens on node A and ch(A)={B}, then an invalidation message might be multicasted by B to all cluster members including A. This method returns true if and only if the node where it is invoked is A.
-
-