curcur commented on pull request #17120:
URL: https://github.com/apache/flink/pull/17120#issuecomment-914931221
Hey @dawidwys and @gaoyunhaii, does TransactionHolder#empty increases
complexity for serialization/deserialization?
The reason to introduce an empty state is to reduce complexities between
state "null"
As commented here:
* Current Transaction Holder, including three states:
* 1. Normal Transaction: created when a new snapshot is taken during
normal task running
* 2. Empty Transaction: created when a new snapshot is taken after the
task is finished. At this point, there is no need to initiate real transactions
due to no more input data.
* 3. null: After task/function is closed.
*/
There is an implicit assumption that `currentTransactionHolder` != null in
the previous implementation.
currentTransactionHolder is initialized with in `initState`
currentTransactionHolder is set to null after `close`.
Conceptually, I think differentiating these states help to make the code
easier to understand.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]