xiarixiaoyao commented on code in PR #6337:
URL: https://github.com/apache/hudi/pull/6337#discussion_r940849240


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/StreamReadMonitoringFunction.java:
##########
@@ -195,35 +193,40 @@ public void 
monitorDirAndForwardSplits(SourceContext<MergeOnReadInputSplit> cont
       // table does not exist
       return;
     }
+
+    long start = System.currentTimeMillis();
     IncrementalInputSplits.Result result =
         incrementalInputSplits.inputSplits(metaClient, this.hadoopConf, 
this.issuedInstant);
     if (result.isEmpty()) {
       // no new instants, returns early
       return;
     }
 
-    for (MergeOnReadInputSplit split : result.getInputSplits()) {
-      context.collect(split);
+    LOG.debug(
+        "Discovered {} splits, time elapsed {}ms",
+        result.getInputSplits().size(),
+        System.currentTimeMillis() - start);
+
+    // only need to hold the checkpoint lock when emitting the splits
+    start = System.currentTimeMillis();
+    synchronized (context.getCheckpointLock()) {

Review Comment:
   use checkpointLock ?



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