Carl-Zhou-CN commented on code in PR #10158:
URL: https://github.com/apache/seatunnel/pull/10158#discussion_r2646815936


##########
seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSinkWriter.java:
##########
@@ -161,7 +174,22 @@ public void write(InputT element, SinkWriter.Context 
context) throws IOException
 
     @Override
     public List<CommitWrapper<CommT>> prepareCommit(boolean flush) throws 
IOException {
+        // 1. Let SeaTunnel SinkWriter prepare the commit for the current 
checkpointId
         Optional<CommT> commTOptional = sinkWriter.prepareCommit(checkpointId);
+
+        // 2. Immediately snapshot state for the same checkpointId, so from 
SeaTunnel's
+        //    perspective prepareCommit(checkpointId) and 
snapshotState(checkpointId) are
+        //    executed back-to-back with no further writes to the same 
transaction.
+        List<FlinkWriterState<WriterStateT>> states =

Review Comment:
   @yzeng1618 CC



-- 
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]

Reply via email to