Interface AbortedTxnProcessor

All Known Implementing Classes:
SingleSnapshotAbortedTxnProcessorImpl, SnapshotSegmentAbortedTxnProcessorImpl

public interface AbortedTxnProcessor
  • 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

      CompletableFuture<Void> takeAbortedTxnsSnapshot(Position maxReadPosition)
      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()