Class TotalOrderVersionedPrepareCommand
- java.lang.Object
-
- org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
-
- org.infinispan.commands.tx.PrepareCommand
-
- org.infinispan.commands.tx.VersionedPrepareCommand
-
- org.infinispan.commands.tx.totalorder.TotalOrderVersionedPrepareCommand
-
- All Implemented Interfaces:
CacheRpcCommand
,ReplicableCommand
,TopologyAffectedCommand
,TotalOrderPrepareCommand
,TransactionBoundaryCommand
,VisitableCommand
,RemoteLockCommand
,TransactionalRemoteLockCommand
public class TotalOrderVersionedPrepareCommand extends VersionedPrepareCommand implements TotalOrderPrepareCommand
Command corresponding to the 1st phase of 2PC when Total Order based protocol is used. This command is used when versioned entries are needed.- Since:
- 5.3
- Author:
- Pedro Ruivo
-
-
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, notifier, onePhaseCommit, recoveryManager, retriedCommand
-
-
Constructor Summary
Constructors Constructor Description TotalOrderVersionedPrepareCommand(ByteString cacheName)
TotalOrderVersionedPrepareCommand(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.TotalOrderRemoteTransactionState
getOrCreateState()
returns theTotalOrderRemoteTransactionState
associated with this transaction, creating one if no one was associated to this transaction.void
markAsOnePhaseCommit()
marks the prepare phase as 1PC to apply immediately the modifications.void
markSkipWriteSkewCheck()
it signals that the write skew check is not needed (for versioned entries).boolean
skipWriteSkewCheck()
-
Methods inherited from class org.infinispan.commands.tx.VersionedPrepareCommand
getVersionsSeen, isReturnValueExpected, readFrom, setVersionsSeen, toString, writeTo
-
Methods inherited from class org.infinispan.commands.tx.PrepareCommand
acceptVisitor, copy, createContext, getAffectedKeys, getKeyLockOwner, getKeysToLock, getModifications, hasModifications, hasSkipLocking, hasZeroLockAcquisition, initialize, invokeAsync, isOnePhaseCommit, isReplayEntryWrapping, isRetriedCommand, setReplayEntryWrapping, setRetriedCommand
-
Methods inherited from class org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
canBlock, equals, getCacheName, getGlobalTransaction, getOrigin, getTopologyId, hashCode, init, invalidRemoteTxReturnValue, loadType, markTransactionAsRemote, perform, 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.remote.CacheRpcCommand
getCacheName, getOrigin, setOrigin
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, invoke, invokeAsync, isReturnValueExpected, isSuccessful, readFrom, writeTo
-
Methods inherited from interface org.infinispan.commands.TopologyAffectedCommand
getTopologyId, setTopologyId
-
Methods inherited from interface org.infinispan.commands.tx.totalorder.TotalOrderPrepareCommand
getModifications
-
Methods inherited from interface org.infinispan.commands.tx.TransactionBoundaryCommand
getGlobalTransaction, markTransactionAsRemote
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
acceptVisitor, ignoreCommandOnStatus, loadType, perform, shouldInvoke
-
-
-
-
Field Detail
-
COMMAND_ID
public static final byte COMMAND_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TotalOrderVersionedPrepareCommand
public TotalOrderVersionedPrepareCommand(ByteString cacheName, GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
-
TotalOrderVersionedPrepareCommand
public TotalOrderVersionedPrepareCommand(ByteString cacheName)
-
-
Method Detail
-
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 classVersionedPrepareCommand
- Returns:
- the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
-
markAsOnePhaseCommit
public void markAsOnePhaseCommit()
Description copied from interface:TotalOrderPrepareCommand
marks the prepare phase as 1PC to apply immediately the modifications. It is used when theorg.infinispan.commands.tx.CommitCommand
is received before theorg.infinispan.commands.tx.PrepareCommand
.- Specified by:
markAsOnePhaseCommit
in interfaceTotalOrderPrepareCommand
-
markSkipWriteSkewCheck
public void markSkipWriteSkewCheck()
Description copied from interface:TotalOrderPrepareCommand
it signals that the write skew check is not needed (for versioned entries). It is used when theorg.infinispan.commands.tx.CommitCommand
is received before theorg.infinispan.commands.tx.PrepareCommand
.- Specified by:
markSkipWriteSkewCheck
in interfaceTotalOrderPrepareCommand
-
skipWriteSkewCheck
public boolean skipWriteSkewCheck()
- Specified by:
skipWriteSkewCheck
in interfaceTotalOrderPrepareCommand
- Returns:
true
when the write skew check is not needed.
-
getOrCreateState
public TotalOrderRemoteTransactionState getOrCreateState()
Description copied from interface:TotalOrderPrepareCommand
returns theTotalOrderRemoteTransactionState
associated with this transaction, creating one if no one was associated to this transaction.- Specified by:
getOrCreateState
in interfaceTotalOrderPrepareCommand
- Returns:
- returns the
TotalOrderRemoteTransactionState
associated with this transaction.
-
-