Class TotalOrderManager
- java.lang.Object
-
- org.infinispan.transaction.totalorder.TotalOrderManager
-
public class TotalOrderManager extends Object
This class behaves as a synchronization point between incoming transactions (totally ordered) and between incoming transactions and state transfer. Main functions:- ensure an order between prepares before sending them to the thread pool, i.e. non-conflicting prepares can be processed concurrently;
- ensure that the state transfer waits for the previous delivered prepares;
- ensure that the prepare waits for state transfer in progress.
- Since:
- 5.3
- Author:
- Pedro Ruivo
-
-
Constructor Summary
Constructors Constructor Description TotalOrderManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ensureOrder(org.infinispan.transaction.impl.TotalOrderRemoteTransactionState state, Collection<?> keysModified)
It ensures the validation order for the transaction corresponding to the prepare command.boolean
hasAnyLockAcquired()
void
notifyStateTransferEnd()
It notifies the end of the state transfer possibly unblock waiting prepares.Collection<TotalOrderLatch>
notifyStateTransferStart(int topologyId, boolean isRebalance)
It notifies that a state transfer is about to start.void
release(org.infinispan.transaction.impl.TotalOrderRemoteTransactionState state)
Release the locked key possibly unblock waiting prepares.
-
-
-
Method Detail
-
ensureOrder
public final void ensureOrder(org.infinispan.transaction.impl.TotalOrderRemoteTransactionState state, Collection<?> keysModified) throws InterruptedException
It ensures the validation order for the transaction corresponding to the prepare command. This allow the prepare command to be moved to a thread pool.- Parameters:
state
- the total order prepare state- Throws:
InterruptedException
-
release
public final void release(org.infinispan.transaction.impl.TotalOrderRemoteTransactionState state)
Release the locked key possibly unblock waiting prepares.- Parameters:
state
- the state
-
notifyStateTransferStart
public final Collection<TotalOrderLatch> notifyStateTransferStart(int topologyId, boolean isRebalance)
It notifies that a state transfer is about to start.- Parameters:
topologyId
- the new topology ID- Returns:
- the current pending prepares
-
notifyStateTransferEnd
public final void notifyStateTransferEnd()
It notifies the end of the state transfer possibly unblock waiting prepares.
-
hasAnyLockAcquired
public final boolean hasAnyLockAcquired()
-
-