LadyForest commented on a change in pull request #23:
URL: https://github.com/apache/flink-table-store/pull/23#discussion_r815405678



##########
File path: 
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/sink/global/GlobalCommittingSinkTranslator.java
##########
@@ -38,21 +36,34 @@
     private static final String WRITER_NAME = "Writer";
 
     public static <T, CommT, GlobalCommT> DataStreamSink<?> translate(
-            DataStream<T> input, GlobalCommittingSink<T, CommT, GlobalCommT> 
sink)
-            throws IOException {
+            DataStream<T> input, GlobalCommittingSink<T, CommT, GlobalCommT> 
sink) {
         TypeInformation<CommittableMessage<CommT>> commitType =
                 CommittableMessageTypeInfo.of(sink::getCommittableSerializer);
+
+        boolean checkpointingEnabled =
+                
input.getExecutionEnvironment().getCheckpointConfig().isCheckpointingEnabled();
+
+        // We cannot determine the mode, when the execution mode is auto.
+        // We set inBatch to false and only use checkpointingEnabled to 
determine if we want to do
+        // the final commit.
+        // When inBatch is true, only the checkpointID is different, which has 
no effect on the
+        // commit operator.
+        boolean isBatchMode = false;
+
         SingleOutputStreamOperator<CommittableMessage<CommT>> written =
-                input.transform(WRITER_NAME, commitType, new 
SinkWriterOperatorFactory<>(sink));
+                input.transform(
+                        WRITER_NAME,
+                        commitType,
+                        new SinkWriterOperatorFactory<>(sink, isBatchMode, 
checkpointingEnabled));

Review comment:
       `isBacthMode` is always `false` here




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