Interface TransactionCursor
public interface TransactionCursor
The transaction Cursor maintains the index of all transactions.
-
Method Summary
Modifier and TypeMethodDescriptionabortTxn(org.apache.pulsar.client.api.transaction.TxnID txnID) Abort transaction.commitTxn(long committedLedgerId, long committedEntryId, org.apache.pulsar.client.api.transaction.TxnID txnID, org.apache.bookkeeper.mledger.Position position) Commit transaction.CompletableFuture<Set<org.apache.pulsar.client.api.transaction.TxnID>>getAllTxnsCommittedAtLedger(long ledgerId) Get all the transaction id on the specified ledger.getTxnMeta(org.apache.pulsar.client.api.transaction.TxnID txnID, boolean createIfNotExist) Get the specified transaction meta.removeTxnsCommittedAtLedger(long ledgerId) Remove the transactions on the specified ledger.
-
Method Details
-
getTxnMeta
CompletableFuture<TransactionMeta> getTxnMeta(org.apache.pulsar.client.api.transaction.TxnID txnID, boolean createIfNotExist) Get the specified transaction meta.- Parameters:
txnID-createIfNotExist-- Returns:
-
commitTxn
CompletableFuture<Void> commitTxn(long committedLedgerId, long committedEntryId, org.apache.pulsar.client.api.transaction.TxnID txnID, org.apache.bookkeeper.mledger.Position position) Commit transaction.- Parameters:
committedLedgerId- the ledger which txn committed at.committedEntryId- the entry which txn committed at.txnID- the id which txn committed.position- the commit position at transaction log.- Returns:
-
abortTxn
Abort transaction.- Parameters:
txnID- aborted transaction id.- Returns:
-
getAllTxnsCommittedAtLedger
CompletableFuture<Set<org.apache.pulsar.client.api.transaction.TxnID>> getAllTxnsCommittedAtLedger(long ledgerId) Get all the transaction id on the specified ledger.- Parameters:
ledgerId- the transaction committed ledger id- Returns:
-
removeTxnsCommittedAtLedger
Remove the transactions on the specified ledger.- Parameters:
ledgerId- the remove transaction id- Returns:
-