Package org.infinispan.commands.write
Class AbstractDataWriteCommand
java.lang.Object
org.infinispan.commands.read.AbstractDataCommand
org.infinispan.commands.write.AbstractDataWriteCommand
- All Implemented Interfaces:
DataCommand,FlagAffectedCommand,ReplicableCommand,SegmentSpecificCommand,TopologyAffectedCommand,TracedCommand,VisitableCommand,DataWriteCommand,WriteCommand,RemoteLockCommand
- Direct Known Subclasses:
AbstractWriteKeyCommand,ComputeCommand,ComputeIfAbsentCommand,IracPutKeyValueCommand,PutKeyValueCommand,RemoveCommand,ReplaceCommand
public abstract class AbstractDataWriteCommand
extends AbstractDataCommand
implements DataWriteCommand, RemoteLockCommand
Stuff common to WriteCommands
- Since:
- 4.0
- Author:
- Manik Surtani
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType -
Field Summary
FieldsFields inherited from class org.infinispan.commands.read.AbstractDataCommand
key, segment -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractDataWriteCommand(Object key, int segment, long flagsBitSet, CommandInvocationId commandInvocationId) -
Method Summary
Modifier and TypeMethodDescriptionCollection<?> final ObjectIt returns the lock owner of the key.Collection<?> It returns aCollectionwith the keys to be lock.final booleanIt checks if this command should acquire locks.final booleanbooleanIf true, a return value will be provided when performed remotely.Methods inherited from class org.infinispan.commands.read.AbstractDataCommand
equals, getFlagsBitSet, getKey, getSegment, getTopologyId, hashCode, printFlags, setFlagsBitSet, setKey, setTopologyId, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.commands.DataCommand
getKeyMethods inherited from interface org.infinispan.commands.write.DataWriteCommand
getInternalMetadata, getInternalMetadata, setInternalMetadata, setInternalMetadataMethods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlags, getFlags, getFlagsBitSet, hasAllFlags, hasAnyFlag, setFlagsBitSetMethods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, getCommandId, invoke, invokeAsync, logThrowable, readFrom, setOrigin, writeToMethods inherited from interface org.infinispan.commands.SegmentSpecificCommand
getSegmentMethods inherited from interface org.infinispan.commands.TopologyAffectedCommand
getTopologyId, setTopologyIdMethods inherited from interface org.infinispan.commands.TracedCommand
getOperationName, getSpanAttributes, setSpanAttributesMethods inherited from interface org.infinispan.commands.VisitableCommand
acceptVisitor, init, loadTypeMethods inherited from interface org.infinispan.commands.write.WriteCommand
fail, getValueMatcher, isConditional, isSuccessful, isWriteOnly, setValueMatcher, shouldReplicate
-
Field Details
-
commandInvocationId
-
-
Constructor Details
-
AbstractDataWriteCommand
protected AbstractDataWriteCommand() -
AbstractDataWriteCommand
protected AbstractDataWriteCommand(Object key, int segment, long flagsBitSet, CommandInvocationId commandInvocationId)
-
-
Method Details
-
getAffectedKeys
- Specified by:
getAffectedKeysin interfaceWriteCommand- Returns:
- a collection of keys affected by this write command. Some commands - such as ClearCommand - may return an empty collection for this method.
-
isReturnValueExpected
public boolean isReturnValueExpected()Description copied from interface:ReplicableCommandIf true, a return value will be provided when performed remotely. Otherwise, a remoteResponseGeneratormay choose to simply return null to save on marshalling costs.- Specified by:
isReturnValueExpectedin interfaceReplicableCommand- Overrides:
isReturnValueExpectedin classAbstractDataCommand- Returns:
- true or false
-
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- Returns:
- a
Collectionof keys to lock.
-
getKeyLockOwner
Description copied from interface:RemoteLockCommandIt returns the lock owner of the key.Usually, in transaction caches it is the
GlobalTransactionand in non-transactional caches theCommandInvocationId.- Specified by:
getKeyLockOwnerin interfaceRemoteLockCommand- Returns:
- the lock owner of the key.
-
hasZeroLockAcquisition
public final boolean hasZeroLockAcquisition()- Specified by:
hasZeroLockAcquisitionin interfaceRemoteLockCommand- Returns:
- it the locks should be acquire with 0 (zero) acquisition timeout.
-
hasSkipLocking
public final boolean hasSkipLocking()Description copied from interface:RemoteLockCommandIt checks if this command should acquire locks.- Specified by:
hasSkipLockingin interfaceRemoteLockCommand- Returns:
trueif locks should be acquired for the keys inRemoteLockCommand.getKeysToLock().
-
getCommandInvocationId
- Specified by:
getCommandInvocationIdin interfaceWriteCommand- Returns:
- the
CommandInvocationIdassociated to the command.
-