Class AbstractWriteManyCommand<K,V>
java.lang.Object
org.infinispan.commands.functional.AbstractWriteManyCommand<K,V>
- All Implemented Interfaces:
FlagAffectedCommand,FunctionalCommand<K,,V> ReplicableCommand,TopologyAffectedCommand,TracedCommand,VisitableCommand,WriteCommand,RemoteLockCommand
- Direct Known Subclasses:
ReadWriteManyCommand,ReadWriteManyEntriesCommand,WriteOnlyManyCommand,WriteOnlyManyEntriesCommand
public abstract class AbstractWriteManyCommand<K,V>
extends Object
implements WriteCommand, FunctionalCommand<K,V>, RemoteLockCommand
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractWriteManyCommand(CommandInvocationId commandInvocationId, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion) protectedAbstractWriteManyCommand(AbstractWriteManyCommand<K, V> command) -
Method Summary
Modifier and TypeMethodDescriptionvoidfail()Make subsequent invocations ofWriteCommand.isSuccessful()returnfalse.longIt returns the lock owner of the key.intbooleanIt checks if this command should acquire locks.booleanvoidinit(ComponentRegistry componentRegistry) booleanCertain commands only work based on a certain condition or state of the cache.booleanbooleanSome commands may want to provide information on whether the command was successful or not.voidsetFlagsBitSet(long bitSet) Set the flags, replacing any existing flags.voidsetForwarded(boolean forwarded) voidsetInternalMetadata(Object key, PrivateMetadata internalMetadata) voidvoidsetTopologyId(int topologyId) voidsetValueMatcher(ValueMatcher valueMatcher) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlags, getFlags, hasAllFlags, hasAnyFlagMethods inherited from interface org.infinispan.commands.functional.FunctionalCommand
toMutationMethods inherited from interface org.infinispan.util.concurrent.locks.RemoteLockCommand
getKeysToLockMethods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, getCommandId, invoke, invokeAsync, isReturnValueExpected, logThrowable, readFrom, setOrigin, writeToMethods inherited from interface org.infinispan.commands.TracedCommand
getOperationName, getSpanAttributes, setSpanAttributesMethods inherited from interface org.infinispan.commands.VisitableCommand
acceptVisitor, loadTypeMethods inherited from interface org.infinispan.commands.write.WriteCommand
getAffectedKeys, isWriteOnly, shouldReplicate
-
Constructor Details
-
AbstractWriteManyCommand
protected AbstractWriteManyCommand(CommandInvocationId commandInvocationId, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion) -
AbstractWriteManyCommand
-
AbstractWriteManyCommand
protected AbstractWriteManyCommand()
-
-
Method Details
-
init
- Specified by:
initin interfaceVisitableCommand
-
getTopologyId
public int getTopologyId()- Specified by:
getTopologyIdin interfaceTopologyAffectedCommand
-
setTopologyId
public void setTopologyId(int topologyId) - Specified by:
setTopologyIdin interfaceTopologyAffectedCommand
-
isForwarded
public boolean isForwarded() -
setForwarded
public void setForwarded(boolean forwarded) -
getValueMatcher
- Specified by:
getValueMatcherin interfaceWriteCommand- Returns:
- The current value matching policy.
-
setValueMatcher
- Specified by:
setValueMatcherin interfaceWriteCommand- Parameters:
valueMatcher- The new value matching policy.
-
isSuccessful
public boolean isSuccessful()Description copied from interface:WriteCommandSome commands may want to provide information on whether the command was successful or not. This is different from a failure, which usually would result in an exception being thrown. An example is a putIfAbsent() not doing anything because the key in question was present. This would result in a isSuccessful() call returning false.- Specified by:
isSuccessfulin interfaceReplicableCommand- Specified by:
isSuccessfulin interfaceWriteCommand- Returns:
- true if the command completed successfully, false otherwise.
-
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.- Specified by:
isConditionalin interfaceWriteCommand- Returns:
- true if the command is conditional, false otherwise
-
fail
public void fail()Description copied from interface:WriteCommandMake subsequent invocations ofWriteCommand.isSuccessful()returnfalse.- Specified by:
failin interfaceWriteCommand
-
getFlagsBitSet
public long getFlagsBitSet()- Specified by:
getFlagsBitSetin interfaceFlagAffectedCommand- Returns:
- The command flags. Flags can be modified with
FlagAffectedCommand.setFlagsBitSet(long),FlagAffectedCommand.addFlags(long)andFlagAffectedCommand.addFlags(long)methods.
-
setFlagsBitSet
public void setFlagsBitSet(long bitSet) Description copied from interface:FlagAffectedCommandSet the flags, replacing any existing flags.- Specified by:
setFlagsBitSetin interfaceFlagAffectedCommand
-
getParams
- Specified by:
getParamsin interfaceFunctionalCommand<K,V>
-
setParams
-
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.
-
getCommandInvocationId
- Specified by:
getCommandInvocationIdin interfaceWriteCommand- Returns:
- the
CommandInvocationIdassociated to the command.
-
hasZeroLockAcquisition
public boolean hasZeroLockAcquisition()- Specified by:
hasZeroLockAcquisitionin interfaceRemoteLockCommand- Returns:
- it the locks should be acquire with 0 (zero) acquisition timeout.
-
hasSkipLocking
public 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().
-
getKeyDataConversion
- Specified by:
getKeyDataConversionin interfaceFunctionalCommand<K,V>
-
getValueDataConversion
- Specified by:
getValueDataConversionin interfaceFunctionalCommand<K,V>
-
getInternalMetadata
- Specified by:
getInternalMetadatain interfaceWriteCommand
-
setInternalMetadata
- Specified by:
setInternalMetadatain interfaceWriteCommand
-