Class AbstractDataWriteCommand
java.lang.Object
org.infinispan.commands.read.AbstractDataCommand
org.infinispan.commands.write.AbstractDataWriteCommand
- All Implemented Interfaces:
DataCommand, FlagAffectedCommand, CacheRpcCommand, ReplicableCommand, SegmentSpecificCommand, TopologyAffectedCommand, TracedCommand, VisitableCommand, DataWriteCommand, WriteCommand, VersionAware, RemoteLockCommand
- Direct Known Subclasses:
AbstractWriteKeyCommand, ComputeCommand, ComputeIfAbsentCommand, IracPutKeyValueCommand, PutKeyValueCommand, RemoveCommand, ReplaceCommand
public abstract class AbstractDataWriteCommand
extends AbstractDataCommand
implements CacheRpcCommand, DataWriteCommand, RemoteLockCommand
Stuff common to WriteCommands
- Since:
- 4.0
- Author:
- Manik Surtani
-
Nested Class Summary
Nested classes/interfaces inherited from interface VisitableCommand
VisitableCommand.LoadType -
Field Summary
FieldsFields inherited from class AbstractDataCommand
cacheName, key, origin, segment, spanAttributes, topologyIdFields inherited from interface VisitableCommand
log -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDataWriteCommand(ByteString cacheName, Object key, int segment, long flagsBitSet, CommandInvocationId commandInvocationId) protectedAbstractDataWriteCommand(ByteString cacheName, MarshallableObject<?> wrappedKey, long flags, int topologyId, int segment, 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 AbstractDataCommand
equals, getCacheName, getFlagsBitSet, getFlagsWithoutRemote, getKey, getOrigin, getSegment, getSpanAttributes, getTopologyId, getWrappedKey, hashCode, printFlags, setFlagsBitSet, setKey, setOrigin, setSpanAttributes, setTopologyId, toStringMethods inherited from interface CacheRpcCommand
getCacheName, getOrigin, setOriginMethods inherited from interface DataCommand
getKeyMethods inherited from interface DataWriteCommand
getInternalMetadata, getInternalMetadata, setInternalMetadata, setInternalMetadataMethods inherited from interface FlagAffectedCommand
addFlags, getFlags, getFlagsBitSet, hasAllFlags, hasAnyFlag, setFlagsBitSetMethods inherited from interface ReplicableCommand
getCommandId, logThrowable, readFrom, supportedSince, writeToMethods inherited from interface SegmentSpecificCommand
getSegmentMethods inherited from interface TopologyAffectedCommand
getTopologyId, setTopologyIdMethods inherited from interface TracedCommand
getOperationName, getSpanAttributes, setSpanAttributesMethods inherited from interface VisitableCommand
acceptVisitor, init, invokeAsync, loadTypeMethods inherited from interface WriteCommand
fail, getValueMatcher, isConditional, isSuccessful, isWriteOnly, setValueMatcher, shouldReplicate
-
Field Details
-
commandInvocationId
-
-
Constructor Details
-
AbstractDataWriteCommand
protected AbstractDataWriteCommand(ByteString cacheName, MarshallableObject<?> wrappedKey, long flags, int topologyId, int segment, CommandInvocationId commandInvocationId) -
AbstractDataWriteCommand
protected AbstractDataWriteCommand(ByteString cacheName, 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.
-