public abstract class AbstractWriteManyCommand<K,V> extends Object implements WriteCommand, FunctionalCommand<K,V>, RemoteLockCommand
VisitableCommand.LoadType
Modifier | Constructor and Description |
---|---|
protected |
AbstractWriteManyCommand() |
protected |
AbstractWriteManyCommand(AbstractWriteManyCommand<K,V> command) |
protected |
AbstractWriteManyCommand(CommandInvocationId commandInvocationId,
Params params,
DataConversion keyDataConversion,
DataConversion valueDataConversion) |
Modifier and Type | Method and Description |
---|---|
void |
fail()
Make subsequent invocations of
WriteCommand.isSuccessful() return false . |
CommandInvocationId |
getCommandInvocationId() |
long |
getFlagsBitSet() |
PrivateMetadata |
getInternalMetadata(Object key) |
DataConversion |
getKeyDataConversion() |
Object |
getKeyLockOwner()
It returns the lock owner of the key.
|
Params |
getParams() |
int |
getTopologyId() |
DataConversion |
getValueDataConversion() |
ValueMatcher |
getValueMatcher() |
boolean |
hasSkipLocking()
It checks if this command should acquire locks.
|
boolean |
hasZeroLockAcquisition() |
void |
init(ComponentRegistry componentRegistry) |
boolean |
isConditional()
Certain commands only work based on a certain condition or state of the cache.
|
boolean |
isForwarded() |
boolean |
isSuccessful()
Some commands may want to provide information on whether the command was successful or not.
|
void |
setFlagsBitSet(long bitSet)
Set the flags, replacing any existing flags.
|
void |
setForwarded(boolean forwarded) |
void |
setInternalMetadata(Object key,
PrivateMetadata internalMetadata) |
void |
setParams(Params params) |
void |
setTopologyId(int topologyId) |
void |
setValueMatcher(ValueMatcher valueMatcher) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAffectedKeys, isWriteOnly, updateStatusFromRemoteResponse
addFlag, addFlags, addFlags, getFlags, hasAllFlags, hasAnyFlag, hasFlag, setFlags
acceptVisitor, loadType
canBlock, getCommandId, invoke, invokeAsync, isReturnValueExpected, readFrom, setOrigin, writeTo
toMutation
getKeysToLock
protected AbstractWriteManyCommand(CommandInvocationId commandInvocationId, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
protected AbstractWriteManyCommand(AbstractWriteManyCommand<K,V> command)
protected AbstractWriteManyCommand()
public void init(ComponentRegistry componentRegistry)
init
in interface VisitableCommand
public int getTopologyId()
getTopologyId
in interface TopologyAffectedCommand
public void setTopologyId(int topologyId)
setTopologyId
in interface TopologyAffectedCommand
public boolean isForwarded()
public void setForwarded(boolean forwarded)
public ValueMatcher getValueMatcher()
getValueMatcher
in interface WriteCommand
public void setValueMatcher(ValueMatcher valueMatcher)
setValueMatcher
in interface WriteCommand
valueMatcher
- The new value matching policy.public boolean isSuccessful()
WriteCommand
isSuccessful
in interface ReplicableCommand
isSuccessful
in interface WriteCommand
public boolean isConditional()
WriteCommand
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.isConditional
in interface WriteCommand
public void fail()
WriteCommand
WriteCommand.isSuccessful()
return false
.fail
in interface WriteCommand
public long getFlagsBitSet()
getFlagsBitSet
in interface FlagAffectedCommand
FlagAffectedCommand.setFlagsBitSet(long)
, FlagAffectedCommand.addFlags(long)
and FlagAffectedCommand.addFlags(Set)
methods.public void setFlagsBitSet(long bitSet)
FlagAffectedCommand
setFlagsBitSet
in interface FlagAffectedCommand
public Params getParams()
getParams
in interface FunctionalCommand<K,V>
public void setParams(Params params)
public Object getKeyLockOwner()
RemoteLockCommand
Usually, in transaction caches it is the GlobalTransaction
and in
non-transactional caches the CommandInvocationId
.
getKeyLockOwner
in interface RemoteLockCommand
public CommandInvocationId getCommandInvocationId()
getCommandInvocationId
in interface WriteCommand
CommandInvocationId
associated to the command.public boolean hasZeroLockAcquisition()
hasZeroLockAcquisition
in interface RemoteLockCommand
public boolean hasSkipLocking()
RemoteLockCommand
hasSkipLocking
in interface RemoteLockCommand
true
if locks should be acquired for the keys in RemoteLockCommand.getKeysToLock()
.public DataConversion getKeyDataConversion()
getKeyDataConversion
in interface FunctionalCommand<K,V>
public DataConversion getValueDataConversion()
getValueDataConversion
in interface FunctionalCommand<K,V>
public PrivateMetadata getInternalMetadata(Object key)
getInternalMetadata
in interface WriteCommand
public void setInternalMetadata(Object key, PrivateMetadata internalMetadata)
setInternalMetadata
in interface WriteCommand
Copyright © 2021 JBoss by Red Hat. All rights reserved.