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 asPrepareCommand
except 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 byte
COMMAND_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 byte
getCommandId()
Used by marshallers to convert this command into an id for streaming.Map<Object,IncrementableEntryVersion>
getVersionsSeen()
boolean
isReturnValueExpected()
If true, a return value will be provided when performed remotely.void
readFrom(ObjectInput input)
Reads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput)
.void
setVersionsSeen(Map<Object,IncrementableEntryVersion> versionsSeen)
String
toString()
void
writeTo(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, logThrowable
-
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:ReplicableCommand
Used by marshallers to convert this command into an id for streaming.- Specified by:
getCommandId
in interfaceReplicableCommand
- Overrides:
getCommandId
in 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:ReplicableCommand
Writes this instance to theObjectOutput
.- Specified by:
writeTo
in interfaceReplicableCommand
- Overrides:
writeTo
in 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:ReplicableCommand
Reads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput)
.- Specified by:
readFrom
in interfaceReplicableCommand
- Overrides:
readFrom
in 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:ReplicableCommand
If true, a return value will be provided when performed remotely. Otherwise, a remoteResponseGenerator
may choose to simply return null to save on marshalling costs.- Specified by:
isReturnValueExpected
in interfaceReplicableCommand
- Overrides:
isReturnValueExpected
in classPrepareCommand
- Returns:
- true or false
-
toString
public String toString()
- Overrides:
toString
in classPrepareCommand
-
-