类的使用
org.apache.pulsar.client.api.transaction.TxnID
使用TxnID的程序包
-
org.apache.pulsar.client.api.transaction中TxnID的使用
修饰符和类型方法说明Transaction.getTxnID()Get TxnID of the transaction.TransactionCoordinatorClient.newTransaction()Create a new transaction.TransactionCoordinatorClient.newTransaction(long timeout, TimeUnit unit) Create a new transaction.返回变量类型为TxnID的类型的org.apache.pulsar.client.api.transaction中的方法修饰符和类型方法说明TransactionBufferClient.abortTxnOnSubscription(String topic, String subscription, long txnIdMostBits, long txnIdLeastBits, long lowWaterMark) Abort the transaction associated with the topic subscription.TransactionBufferClient.abortTxnOnTopic(String topic, long txnIdMostBits, long txnIdLeastBits, long lowWaterMark) Abort the transaction associated with the topic.TransactionBufferClient.commitTxnOnSubscription(String topic, String subscription, long txnIdMostBits, long txnIdLeastBits, long lowWaterMark) Commit the transaction associated with the topic subscription.TransactionBufferClient.commitTxnOnTopic(String topic, long txnIdMostBits, long txnIdLeastBits, long lowWaterMark) Commit the transaction associated with the topic.TransactionCoordinatorClient.newTransactionAsync()Create a new transaction asynchronously.TransactionCoordinatorClient.newTransactionAsync(long timeout, TimeUnit unit) Create a new transaction asynchronously.修饰符和类型方法说明voidAbort txn.TransactionCoordinatorClient.abortAsync(TxnID txnID) Abort txn asynchronously.voidTransactionCoordinatorClient.addPublishPartitionToTxn(TxnID txnID, List<String> partitions) Add publish partition to txn.TransactionCoordinatorClient.addPublishPartitionToTxnAsync(TxnID txnID, List<String> partitions) Add publish partition to txn asynchronously.voidTransactionCoordinatorClient.addSubscriptionToTxn(TxnID txnID, String topic, String subscription) Add ack subscription to txn.TransactionCoordinatorClient.addSubscriptionToTxnAsync(TxnID txnID, String topic, String subscription) Add ack subscription to txn asynchronously.voidCommit txn.TransactionCoordinatorClient.commitAsync(TxnID txnID) Commit txn asynchronously.