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> boolean
checkIfOpen
(CompletableFuture<T> completableFuture) commit()
getState()
getTxnID()
registerAckedTopic
(String topic, String subscription) void
registerAckOp
(CompletableFuture<Void> newAckFuture) registerProducedTopic
(String topic) void
registerSendOp
(CompletableFuture<MessageId> newSendFuture) void
run
(io.netty.util.Timeout timeout)
-
Method Details
-
run
- Specified by:
run
in interfaceio.netty.util.TimerTask
- Throws:
Exception
-
registerProducedTopic
-
registerSendOp
-
registerAckedTopic
-
registerAckOp
-
commit
- Specified by:
commit
in interfaceTransaction
-
abort
- Specified by:
abort
in interfaceTransaction
-
getTxnID
- Specified by:
getTxnID
in interfaceTransaction
-
getState
- Specified by:
getState
in interfaceTransaction
-
checkIfOpen
-