public class PendingAckHandleDisabled extends Object implements PendingAckHandle
PendingAckHandle.| Constructor and Description |
|---|
PendingAckHandleDisabled() |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
abortTxn(org.apache.pulsar.client.api.transaction.TxnID txnId,
Consumer consumer,
long lowWaterMark)
Abort a transaction.
|
boolean |
checkIfPendingAckStoreInit()
Check if the PendingAckStore is init.
|
boolean |
checkIsCanDeleteConsumerPendingAck(PositionImpl position)
Judge the all ack set point have acked by normal ack and transaction pending ack.
|
void |
clearIndividualPosition(Position position)
When the position is actually deleted, we can use this method to clear the cache for individual ack messages.
|
CompletableFuture<Void> |
close()
Close the pending ack handle.
|
CompletableFuture<Void> |
commitTxn(org.apache.pulsar.client.api.transaction.TxnID txnID,
Map<String,Long> properties,
long lowWaterMark)
Commit a transaction.
|
CompletableFuture<Void> |
cumulativeAcknowledgeMessage(org.apache.pulsar.client.api.transaction.TxnID txnID,
List<PositionImpl> positions)
Acknowledge message(s) for an ongoing transaction.
|
org.apache.pulsar.common.policies.data.TransactionPendingAckStats |
getStats()
Get pending ack handle stats.
|
org.apache.pulsar.common.policies.data.TransactionInPendingAckStats |
getTransactionInPendingAckStats(org.apache.pulsar.client.api.transaction.TxnID txnID)
Get transaction in pending ack stats.
|
CompletableFuture<Void> |
individualAcknowledgeMessage(org.apache.pulsar.client.api.transaction.TxnID txnID,
List<org.apache.commons.lang3.tuple.MutablePair<PositionImpl,Integer>> positions)
Acknowledge message(s) for an ongoing transaction.
|
CompletableFuture<PendingAckHandle> |
pendingAckHandleFuture()
Pending ack recover whether ready future.
|
void |
syncBatchPositionAckSetForTransaction(PositionImpl position)
Sync the position ack set, in order to clean up the cache of this position for pending ack handle.
|
public CompletableFuture<Void> individualAcknowledgeMessage(org.apache.pulsar.client.api.transaction.TxnID txnID, List<org.apache.commons.lang3.tuple.MutablePair<PositionImpl,Integer>> positions)
PendingAckHandle
It can be of CommandAck.AckType.Individual. Single messages acked by ongoing transaction will be put
in pending_ack state and only marked as deleted after transaction is committed.
If transaction is aborted all messages acked by it will be put back to pending state.
Client will not send batch size to server, we get the batch size from consumer pending ack. When we get the Batch size, we can accurate batch ack of this position.
individualAcknowledgeMessage in interface PendingAckHandletxnID - TxnID TransactionID of an ongoing transaction trying to sck message.positions - MutablePair the pair of positions and these batch size.public CompletableFuture<Void> cumulativeAcknowledgeMessage(org.apache.pulsar.client.api.transaction.TxnID txnID, List<PositionImpl> positions)
PendingAckHandle
It can be of CommandAck.AckType.Cumulative. Single messages acked by ongoing transaction will be put in
pending_ack state and only marked as deleted after transaction is committed.
For a moment, we only allow one transaction cumulative ack multiple times when the position is greater than the old one.
We have a transaction with cumulative ack, if other transaction want to cumulative ack, we will
return TransactionConflictException.
If an ongoing transaction cumulative acked a message and then try to ack single message which is greater than that one it cumulative acked, it'll succeed.
cumulativeAcknowledgeMessage in interface PendingAckHandletxnID - TxnID TransactionID of an ongoing transaction trying to sck message.positions - MutablePair the pair of positions and these batch size.public CompletableFuture<Void> commitTxn(org.apache.pulsar.client.api.transaction.TxnID txnID, Map<String,Long> properties, long lowWaterMark)
PendingAckHandlecommitTxn in interface PendingAckHandletxnID - TxnID to identify the transaction.properties - Additional user-defined properties that can be
associated with a particular cursor position.lowWaterMark - the low water mark of this transactionpublic CompletableFuture<Void> abortTxn(org.apache.pulsar.client.api.transaction.TxnID txnId, Consumer consumer, long lowWaterMark)
PendingAckHandleabortTxn in interface PendingAckHandletxnId - TxnID to identify the transaction.consumer - Consumer which aborting transaction.lowWaterMark - the low water mark of this transactionpublic void syncBatchPositionAckSetForTransaction(PositionImpl position)
PendingAckHandlesyncBatchPositionAckSetForTransaction in interface PendingAckHandleposition - Position which position need to sync and carry it batch sizepublic boolean checkIsCanDeleteConsumerPendingAck(PositionImpl position)
PendingAckHandlecheckIsCanDeleteConsumerPendingAck in interface PendingAckHandleposition - Position which position need to checkpublic void clearIndividualPosition(Position position)
PendingAckHandleclearIndividualPosition in interface PendingAckHandleposition - Position which position need to clearpublic CompletableFuture<PendingAckHandle> pendingAckHandleFuture()
PendingAckHandlependingAckHandleFuture in interface PendingAckHandlepublic org.apache.pulsar.common.policies.data.TransactionInPendingAckStats getTransactionInPendingAckStats(org.apache.pulsar.client.api.transaction.TxnID txnID)
PendingAckHandlegetTransactionInPendingAckStats in interface PendingAckHandletxnID - the txnIDpublic org.apache.pulsar.common.policies.data.TransactionPendingAckStats getStats()
PendingAckHandlegetStats in interface PendingAckHandlepublic CompletableFuture<Void> close()
PendingAckHandleclose in interface PendingAckHandlepublic boolean checkIfPendingAckStoreInit()
PendingAckHandlecheckIfPendingAckStoreInit in interface PendingAckHandleCopyright © 2017–2022 Apache Software Foundation. All rights reserved.