Class SingleSnapshotAbortedTxnProcessorImpl
java.lang.Object
org.apache.pulsar.broker.transaction.buffer.impl.SingleSnapshotAbortedTxnProcessorImpl
- All Implemented Interfaces:
AbortedTxnProcessor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.pulsar.broker.transaction.buffer.AbortedTxnProcessor
AbortedTxnProcessor.SnapshotType -
Constructor Summary
Constructors -
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 abortedTxnId, 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.
-
Constructor Details
-
SingleSnapshotAbortedTxnProcessorImpl
-
-
Method Details
-
putAbortedTxnAndPosition
public void putAbortedTxnAndPosition(org.apache.pulsar.client.api.transaction.TxnID abortedTxnId, Position abortedMarkerPersistentPosition) Description copied from interface:AbortedTxnProcessorAfter 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.- Specified by:
putAbortedTxnAndPositionin interfaceAbortedTxnProcessor- Parameters:
abortedTxnId- aborted transaction ID.abortedMarkerPersistentPosition- the position of the abort txn marker.
-
trimExpiredAbortedTxns
public void trimExpiredAbortedTxns()Description copied from interface:AbortedTxnProcessorClean up invalid aborted transactions.- Specified by:
trimExpiredAbortedTxnsin interfaceAbortedTxnProcessor
-
checkAbortedTransaction
public boolean checkAbortedTransaction(org.apache.pulsar.client.api.transaction.TxnID txnID) Description copied from interface:AbortedTxnProcessorCheck whether the transaction ID is an aborted transaction ID.- Specified by:
checkAbortedTransactionin interfaceAbortedTxnProcessor- Parameters:
txnID- the transaction ID that needs to be checked.- Returns:
- a boolean, whether the transaction ID is an aborted transaction ID.
-
recoverFromSnapshot
Description copied from interface:AbortedTxnProcessorRecover transaction buffer by transaction buffer snapshot.- Specified by:
recoverFromSnapshotin interfaceAbortedTxnProcessor- Returns:
- a Position (startReadCursorPosition) determiner where to start to recover in the original topic.
-
clearAbortedTxnSnapshot
Description copied from interface:AbortedTxnProcessorDelete the transaction buffer aborted transaction snapshot.- Specified by:
clearAbortedTxnSnapshotin interfaceAbortedTxnProcessor- Returns:
- a completableFuture.
-
takeAbortedTxnsSnapshot
Description copied from interface:AbortedTxnProcessorTake aborted transactions snapshot.- Specified by:
takeAbortedTxnsSnapshotin interfaceAbortedTxnProcessor- Returns:
- a completableFuture.
-
generateSnapshotStats
public org.apache.pulsar.common.policies.data.TransactionBufferStats generateSnapshotStats(boolean segmentStats) Description copied from interface:AbortedTxnProcessorGet the lastSnapshotTimestamps.- Specified by:
generateSnapshotStatsin interfaceAbortedTxnProcessor- Returns:
- a transactionBufferStats with the stats in the abortedTxnProcessor.
-
closeAsync
- Specified by:
closeAsyncin interfaceAbortedTxnProcessor
-