Class TransactionImpl
java.lang.Object
org.apache.pulsar.client.impl.transaction.TransactionImpl
- All Implemented Interfaces:
io.netty.util.TimerTask,Transaction
The default implementation of
Transaction.
All the error handling and retry logic are handled by this class. The original pulsar client doesn't handle any transaction logic. It is only responsible for sending the messages and acknowledgements carrying the transaction id and retrying on failures. This decouples the transactional operations from non-transactional operations as much as possible.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.pulsar.client.api.transaction.Transaction
Transaction.State -
Method Summary
Modifier and TypeMethodDescriptionabort()<T> booleancheckIfOpen(CompletableFuture<T> completableFuture) commit()getState()getTxnID()registerAckedTopic(String topic, String subscription) voidregisterAckOp(CompletableFuture<Void> newAckFuture) registerProducedTopic(String topic) voidregisterSendOp(CompletableFuture<MessageId> newSendFuture) voidrun(io.netty.util.Timeout timeout)
-
Method Details
-
run
- Specified by:
runin interfaceio.netty.util.TimerTask- Throws:
Exception
-
registerProducedTopic
-
registerSendOp
-
registerAckedTopic
-
registerAckOp
-
commit
- Specified by:
commitin interfaceTransaction
-
abort
- Specified by:
abortin interfaceTransaction
-
getTxnID
- Specified by:
getTxnIDin interfaceTransaction
-
getState
- Specified by:
getStatein interfaceTransaction
-
checkIfOpen
-