Class MLPendingAckStore

  • All Implemented Interfaces:
    PendingAckStore

    public class MLPendingAckStore
    extends java.lang.Object
    implements PendingAckStore
    The implement of the pending ack store by manageLedger.
    • Constructor Summary

      Constructors 
      Constructor Description
      MLPendingAckStore​(org.apache.bookkeeper.mledger.ManagedLedger managedLedger, org.apache.bookkeeper.mledger.ManagedCursor cursor, org.apache.bookkeeper.mledger.ManagedCursor subManagedCursor, long transactionPendingAckLogIndexMinLag)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> appendAbortMark​(org.apache.pulsar.client.api.transaction.TxnID txnID, org.apache.pulsar.common.api.proto.CommandAck.AckType ackType)
      Append the pending ack abort mark to the ack persistent store.
      java.util.concurrent.CompletableFuture<java.lang.Void> appendCommitMark​(org.apache.pulsar.client.api.transaction.TxnID txnID, org.apache.pulsar.common.api.proto.CommandAck.AckType ackType)
      Append the pending ack commit mark to the ack persistent store.
      java.util.concurrent.CompletableFuture<java.lang.Void> appendCumulativeAck​(org.apache.pulsar.client.api.transaction.TxnID txnID, org.apache.bookkeeper.mledger.impl.PositionImpl position)
      Append the cumulative pending ack operation to the ack persistent store.
      java.util.concurrent.CompletableFuture<java.lang.Void> appendIndividualAck​(org.apache.pulsar.client.api.transaction.TxnID txnID, java.util.List<org.apache.commons.lang3.tuple.MutablePair<org.apache.bookkeeper.mledger.impl.PositionImpl,​java.lang.Integer>> positions)
      Append the individual pending ack operation to the ack persistent store.
      java.util.concurrent.CompletableFuture<java.lang.Void> closeAsync()
      Close the transaction pending ack store.
      java.util.concurrent.CompletableFuture<org.apache.bookkeeper.mledger.ManagedLedger> getManagedLedger()  
      static java.lang.String getTransactionPendingAckStoreCursorName()  
      static java.lang.String getTransactionPendingAckStoreSuffix​(java.lang.String originTopicName, java.lang.String subName)  
      void replayAsync​(PendingAckHandleImpl pendingAckHandle, java.util.concurrent.ExecutorService transactionReplayExecutor)
      Replay pending ack to recover the pending ack subscription pending ack state.
      • Methods inherited from class java.lang.Object

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

      • PENDING_ACK_STORE_SUFFIX

        public static final java.lang.String PENDING_ACK_STORE_SUFFIX
        See Also:
        Constant Field Values
      • PENDING_ACK_STORE_CURSOR_NAME

        public static final java.lang.String PENDING_ACK_STORE_CURSOR_NAME
        See Also:
        Constant Field Values
      • maxAckPosition

        protected org.apache.bookkeeper.mledger.impl.PositionImpl maxAckPosition
    • Constructor Detail

      • MLPendingAckStore

        public MLPendingAckStore​(org.apache.bookkeeper.mledger.ManagedLedger managedLedger,
                                 org.apache.bookkeeper.mledger.ManagedCursor cursor,
                                 org.apache.bookkeeper.mledger.ManagedCursor subManagedCursor,
                                 long transactionPendingAckLogIndexMinLag)
    • Method Detail

      • replayAsync

        public void replayAsync​(PendingAckHandleImpl pendingAckHandle,
                                java.util.concurrent.ExecutorService transactionReplayExecutor)
        Description copied from interface: PendingAckStore
        Replay pending ack to recover the pending ack subscription pending ack state.
        Specified by:
        replayAsync in interface PendingAckStore
        Parameters:
        pendingAckHandle - the handle of pending ack
        transactionReplayExecutor - the replay executor service
      • closeAsync

        public java.util.concurrent.CompletableFuture<java.lang.Void> closeAsync()
        Description copied from interface: PendingAckStore
        Close the transaction pending ack store.
        Specified by:
        closeAsync in interface PendingAckStore
        Returns:
        a future represents the result of this operation
      • appendIndividualAck

        public java.util.concurrent.CompletableFuture<java.lang.Void> appendIndividualAck​(org.apache.pulsar.client.api.transaction.TxnID txnID,
                                                                                          java.util.List<org.apache.commons.lang3.tuple.MutablePair<org.apache.bookkeeper.mledger.impl.PositionImpl,​java.lang.Integer>> positions)
        Description copied from interface: PendingAckStore
        Append the individual pending ack operation to the ack persistent store.
        Specified by:
        appendIndividualAck in interface PendingAckStore
        Parameters:
        txnID - TxnID transaction id.
        positions - List the list of position and batch size.
        Returns:
        a future represents the result of this operation
      • appendCumulativeAck

        public java.util.concurrent.CompletableFuture<java.lang.Void> appendCumulativeAck​(org.apache.pulsar.client.api.transaction.TxnID txnID,
                                                                                          org.apache.bookkeeper.mledger.impl.PositionImpl position)
        Description copied from interface: PendingAckStore
        Append the cumulative pending ack operation to the ack persistent store.
        Specified by:
        appendCumulativeAck in interface PendingAckStore
        Parameters:
        txnID - TxnID transaction id.
        position - PositionImpl the pending ack position.
        Returns:
        a future represents the result of this operation
      • appendCommitMark

        public java.util.concurrent.CompletableFuture<java.lang.Void> appendCommitMark​(org.apache.pulsar.client.api.transaction.TxnID txnID,
                                                                                       org.apache.pulsar.common.api.proto.CommandAck.AckType ackType)
        Description copied from interface: PendingAckStore
        Append the pending ack commit mark to the ack persistent store.
        Specified by:
        appendCommitMark in interface PendingAckStore
        Parameters:
        txnID - TxnID the transaction id for add commit mark.
        ackType - CommandAck.AckType the ack type of the commit.
        Returns:
        a future represents the result of this operation
      • appendAbortMark

        public java.util.concurrent.CompletableFuture<java.lang.Void> appendAbortMark​(org.apache.pulsar.client.api.transaction.TxnID txnID,
                                                                                      org.apache.pulsar.common.api.proto.CommandAck.AckType ackType)
        Description copied from interface: PendingAckStore
        Append the pending ack abort mark to the ack persistent store.
        Specified by:
        appendAbortMark in interface PendingAckStore
        Parameters:
        txnID - Position the txnID
        ackType - CommandAck.AckType the ack type of the abort.
        Returns:
        a future represents the result of this operation
      • getManagedLedger

        public java.util.concurrent.CompletableFuture<org.apache.bookkeeper.mledger.ManagedLedger> getManagedLedger()
      • getTransactionPendingAckStoreSuffix

        public static java.lang.String getTransactionPendingAckStoreSuffix​(java.lang.String originTopicName,
                                                                           java.lang.String subName)
      • getTransactionPendingAckStoreCursorName

        public static java.lang.String getTransactionPendingAckStoreCursorName()