Class TotalOrderManager


  • public class TotalOrderManager
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void ensureOrder​(org.infinispan.transaction.impl.TotalOrderRemoteTransactionState state, java.util.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.
      java.util.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TotalOrderManager

        public TotalOrderManager()
    • Method Detail

      • ensureOrder

        public final void ensureOrder​(org.infinispan.transaction.impl.TotalOrderRemoteTransactionState state,
                                      java.util.Collection<?> keysModified)
                               throws java.lang.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:
        java.lang.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 java.util.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()