Interface AbortedTxnProcessor
- All Known Implementing Classes:
SingleSnapshotAbortedTxnProcessorImpl,SnapshotSegmentAbortedTxnProcessorImpl
public interface AbortedTxnProcessor
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckAbortedTransaction(org.apache.pulsar.client.api.transaction.TxnID txnID) Check whether the transaction ID is an aborted transaction ID.Delete the transaction buffer aborted transaction snapshot.org.apache.pulsar.common.policies.data.TransactionBufferStatsgenerateSnapshotStats(boolean segmentStats) Get the lastSnapshotTimestamps.voidputAbortedTxnAndPosition(org.apache.pulsar.client.api.transaction.TxnID txnID, Position abortedMarkerPersistentPosition) After the transaction buffer writes a transaction aborted marker to the topic, the transaction buffer will put the aborted txnID and the aborted marker position to AbortedTxnProcessor.Recover transaction buffer by transaction buffer snapshot.takeAbortedTxnsSnapshot(Position maxReadPosition) Take aborted transactions snapshot.voidClean up invalid aborted transactions.
-
Method Details
-
putAbortedTxnAndPosition
void putAbortedTxnAndPosition(org.apache.pulsar.client.api.transaction.TxnID txnID, Position abortedMarkerPersistentPosition) After the transaction buffer writes a transaction aborted marker to the topic, the transaction buffer will put the aborted txnID and the aborted marker position to AbortedTxnProcessor.- Parameters:
txnID- aborted transaction ID.abortedMarkerPersistentPosition- the position of the abort txn marker.
-
trimExpiredAbortedTxns
void trimExpiredAbortedTxns()Clean up invalid aborted transactions. -
checkAbortedTransaction
boolean checkAbortedTransaction(org.apache.pulsar.client.api.transaction.TxnID txnID) Check whether the transaction ID is an aborted transaction ID.- Parameters:
txnID- the transaction ID that needs to be checked.- Returns:
- a boolean, whether the transaction ID is an aborted transaction ID.
-
recoverFromSnapshot
CompletableFuture<Position> recoverFromSnapshot()Recover transaction buffer by transaction buffer snapshot.- Returns:
- a Position (startReadCursorPosition) determiner where to start to recover in the original topic.
-
clearAbortedTxnSnapshot
CompletableFuture<Void> clearAbortedTxnSnapshot()Delete the transaction buffer aborted transaction snapshot.- Returns:
- a completableFuture.
-
takeAbortedTxnsSnapshot
Take aborted transactions snapshot.- Returns:
- a completableFuture.
-
generateSnapshotStats
org.apache.pulsar.common.policies.data.TransactionBufferStats generateSnapshotStats(boolean segmentStats) Get the lastSnapshotTimestamps.- Returns:
- a transactionBufferStats with the stats in the abortedTxnProcessor.
-
closeAsync
CompletableFuture<Void> closeAsync()
-