Class InMemoryPendingAckStore
- java.lang.Object
-
- org.apache.pulsar.broker.transaction.pendingack.impl.InMemoryPendingAckStore
-
- All Implemented Interfaces:
PendingAckStore
public class InMemoryPendingAckStore extends java.lang.Object implements PendingAckStore
In memory implementation ofPendingAckStore.
-
-
Constructor Summary
Constructors Constructor Description InMemoryPendingAckStore()
-
Method Summary
All 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.voidreplayAsync(PendingAckHandleImpl pendingAckHandle, java.util.concurrent.ExecutorService scheduledExecutorService)Replay pending ack to recover the pending ack subscription pending ack state.
-
-
-
Method Detail
-
replayAsync
public void replayAsync(PendingAckHandleImpl pendingAckHandle, java.util.concurrent.ExecutorService scheduledExecutorService)
Description copied from interface:PendingAckStoreReplay pending ack to recover the pending ack subscription pending ack state.- Specified by:
replayAsyncin interfacePendingAckStore- Parameters:
pendingAckHandle- the handle of pending ackscheduledExecutorService- the replay executor service
-
closeAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> closeAsync()
Description copied from interface:PendingAckStoreClose the transaction pending ack store.- Specified by:
closeAsyncin interfacePendingAckStore- 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:PendingAckStoreAppend the individual pending ack operation to the ack persistent store.- Specified by:
appendIndividualAckin interfacePendingAckStore- Parameters:
txnID-TxnIDtransaction id.positions-Listthe 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:PendingAckStoreAppend the cumulative pending ack operation to the ack persistent store.- Specified by:
appendCumulativeAckin interfacePendingAckStore- Parameters:
txnID-TxnIDtransaction id.position-PositionImplthe 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:PendingAckStoreAppend the pending ack commit mark to the ack persistent store.- Specified by:
appendCommitMarkin interfacePendingAckStore- Parameters:
txnID-TxnIDthe transaction id for add commit mark.ackType-CommandAck.AckTypethe 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:PendingAckStoreAppend the pending ack abort mark to the ack persistent store.- Specified by:
appendAbortMarkin interfacePendingAckStore- Parameters:
txnID-Positionthe txnIDackType-CommandAck.AckTypethe ack type of the abort.- Returns:
- a future represents the result of this operation
-
-