Class ReadWriteKeyCommand<K,V,R>
java.lang.Object
org.infinispan.commands.read.AbstractDataCommand
org.infinispan.commands.write.AbstractDataWriteCommand
org.infinispan.commands.functional.AbstractWriteKeyCommand<K,V>
org.infinispan.commands.functional.ReadWriteKeyCommand<K,V,R>
- All Implemented Interfaces:
DataCommand, FlagAffectedCommand, FunctionalCommand<K,V>, CacheRpcCommand, ReplicableCommand, SegmentSpecificCommand, TopologyAffectedCommand, TracedCommand, VisitableCommand, DataWriteCommand, WriteCommand, VersionAware, RemoteLockCommand
@ProtoTypeId(1151)
public final class ReadWriteKeyCommand<K,V,R>
extends AbstractWriteKeyCommand<K,V>
-
Nested Class Summary
Nested classes/interfaces inherited from interface VisitableCommand
VisitableCommand.LoadType -
Field Summary
Fields inherited from class AbstractDataWriteCommand
commandInvocationIdFields inherited from class AbstractDataCommand
cacheName, key, origin, segment, spanAttributes, topologyIdFields inherited from interface VisitableCommand
log -
Constructor Summary
ConstructorsConstructorDescriptionReadWriteKeyCommand(ByteString cacheName, Object key, Function<EntryView.ReadWriteEntryView<K, V>, R> f, int segment, CommandInvocationId id, ValueMatcher valueMatcher, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion) -
Method Summary
Modifier and TypeMethodDescriptionacceptVisitor(InvocationContext ctx, Visitor visitor) Accept a visitor, and return the result of accepting this visitor.voidinit(ComponentRegistry componentRegistry) booleanCertain commands only work based on a certain condition or state of the cache.loadType()Returns aNodeVersionrepresenting the Infinispan version in which this command was added.toMutation(Object key) toString()Methods inherited from class AbstractWriteKeyCommand
fail, getInternalMetadata, getKeyDataConversion, getParams, getValueDataConversion, getValueMatcher, isSuccessful, setInternalMetadata, setValueMatcherMethods inherited from class AbstractDataWriteCommand
getAffectedKeys, getCommandInvocationId, getKeyLockOwner, getKeysToLock, hasSkipLocking, hasZeroLockAcquisition, isReturnValueExpectedMethods inherited from class AbstractDataCommand
equals, getCacheName, getFlagsBitSet, getFlagsWithoutRemote, getKey, getOrigin, getSegment, getSpanAttributes, getTopologyId, getWrappedKey, hashCode, printFlags, setFlagsBitSet, setKey, setOrigin, setSpanAttributes, setTopologyIdMethods inherited from interface CacheRpcCommand
getCacheName, getOrigin, setOriginMethods inherited from interface DataCommand
getKeyMethods inherited from interface DataWriteCommand
getInternalMetadata, setInternalMetadataMethods inherited from interface FlagAffectedCommand
addFlags, getFlags, getFlagsBitSet, hasAllFlags, hasAnyFlag, setFlagsBitSetMethods inherited from interface ReplicableCommand
getCommandId, logThrowable, readFrom, writeToMethods inherited from interface SegmentSpecificCommand
getSegmentMethods inherited from interface TopologyAffectedCommand
getTopologyId, setTopologyIdMethods inherited from interface TracedCommand
getOperationName, getSpanAttributes, setSpanAttributesMethods inherited from interface VisitableCommand
invokeAsyncMethods inherited from interface WriteCommand
isWriteOnly, shouldReplicate
-
Constructor Details
-
ReadWriteKeyCommand
public ReadWriteKeyCommand(ByteString cacheName, Object key, Function<EntryView.ReadWriteEntryView<K, V>, R> f, int segment, CommandInvocationId id, ValueMatcher valueMatcher, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
-
-
Method Details
-
init
- Specified by:
initin interfaceVisitableCommand- Overrides:
initin classAbstractWriteKeyCommand<K,V>
-
isConditional
public boolean isConditional()Description copied from interface:WriteCommandCertain commands only work based on a certain condition or state of the cache. For example,ConcurrentMap.putIfAbsent(Object, Object)only does anything if a condition is met, i.e., the entry in question is not already present. This method tests whether the command in question is conditional or not.- Returns:
- true if the command is conditional, false otherwise
-
acceptVisitor
Description copied from interface:VisitableCommandAccept a visitor, and return the result of accepting this visitor.- Parameters:
ctx- invocation contextvisitor- visitor to accept- Returns:
- arbitrary return value
- Throws:
Throwable- in the event of problems
-
loadType
- Returns:
- Nodes on which the command needs to read the previous values of the keys it acts on.
-
toMutation
-
getFunction
-
supportedSince
Description copied from interface:ReplicableCommandReturns aNodeVersionrepresenting the Infinispan version in which this command was added. This value is used to ensure that when the cluster contains different Infinispan versions, only commands compatible with the oldest version are transmitted.Abstract classes should not implement this method as the version should be specific to an individual implementation. Similarly, implementations which extend another
ReplicableCommandshould always override this method.- Returns:
- a
NodeVersioncorresponding to the Infinispan version this command was added.
-
toString
- Overrides:
toStringin classAbstractWriteKeyCommand<K,V>
-