Package org.infinispan.commands.tx
Class VersionedPrepareCommand
- java.lang.Object
-
- org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
-
- org.infinispan.commands.tx.PrepareCommand
-
- org.infinispan.commands.tx.VersionedPrepareCommand
-
- All Implemented Interfaces:
CacheRpcCommand,ReplicableCommand,TopologyAffectedCommand,TransactionBoundaryCommand,VisitableCommand,RemoteLockCommand,TransactionalRemoteLockCommand
public class VersionedPrepareCommand extends PrepareCommand
Same asPrepareCommandexcept that the transaction originator makes evident the versions of entries touched and stored in a transaction context so that accurate write skew checks may be performed by the lock owner(s).- Since:
- 5.1
- Author:
- Manik Surtani
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType
-
-
Field Summary
Fields Modifier and Type Field Description static byteCOMMAND_ID-
Fields inherited from class org.infinispan.commands.tx.PrepareCommand
modifications, onePhaseCommit, retriedCommand
-
Fields inherited from class org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
cacheName, globalTx
-
-
Constructor Summary
Constructors Constructor Description VersionedPrepareCommand()VersionedPrepareCommand(ByteString cacheName)VersionedPrepareCommand(ByteString cacheName, GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetCommandId()Used by marshallers to convert this command into an id for streaming.Map<Object,IncrementableEntryVersion>getVersionsSeen()booleanisReturnValueExpected()If true, a return value will be provided when performed remotely.voidreadFrom(ObjectInput input)Reads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput).voidsetVersionsSeen(Map<Object,IncrementableEntryVersion> versionsSeen)StringtoString()voidwriteTo(ObjectOutput output)Writes this instance to theObjectOutput.-
Methods inherited from class org.infinispan.commands.tx.PrepareCommand
acceptVisitor, copy, createContext, getAffectedKeys, getKeyLockOwner, getKeysToLock, getModifications, hasModifications, hasSkipLocking, hasZeroLockAcquisition, invokeAsync, isOnePhaseCommit, isReplayEntryWrapping, isRetriedCommand, setReplayEntryWrapping, setRetriedCommand
-
Methods inherited from class org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
equals, getCacheName, getGlobalTransaction, getOrigin, getTopologyId, hashCode, invalidRemoteTxReturnValue, loadType, markTransactionAsRemote, setOrigin, setTopologyId, visitRemoteTransaction
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, invoke, invokeAsync, isSuccessful
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
init
-
-
-
-
Field Detail
-
COMMAND_ID
public static final byte COMMAND_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VersionedPrepareCommand
public VersionedPrepareCommand()
-
VersionedPrepareCommand
public VersionedPrepareCommand(ByteString cacheName, GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
-
VersionedPrepareCommand
public VersionedPrepareCommand(ByteString cacheName)
-
-
Method Detail
-
getVersionsSeen
public Map<Object,IncrementableEntryVersion> getVersionsSeen()
-
setVersionsSeen
public void setVersionsSeen(Map<Object,IncrementableEntryVersion> versionsSeen)
-
getCommandId
public byte getCommandId()
Description copied from interface:ReplicableCommandUsed by marshallers to convert this command into an id for streaming.- Specified by:
getCommandIdin interfaceReplicableCommand- Overrides:
getCommandIdin classPrepareCommand- Returns:
- the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
-
writeTo
public void writeTo(ObjectOutput output) throws IOException
Description copied from interface:ReplicableCommandWrites this instance to theObjectOutput.- Specified by:
writeToin interfaceReplicableCommand- Overrides:
writeToin classPrepareCommand- Parameters:
output- the stream.- Throws:
IOException- if an error occurred during the I/O.
-
readFrom
public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
Description copied from interface:ReplicableCommandReads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput).- Specified by:
readFromin interfaceReplicableCommand- Overrides:
readFromin classPrepareCommand- Parameters:
input- the stream to read.- Throws:
IOException- if an error occurred during the I/O.ClassNotFoundException- if it tries to load an undefined class.
-
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 classPrepareCommand- Returns:
- true or false
-
toString
public String toString()
- Overrides:
toStringin classPrepareCommand
-
-