You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/08/09 03:08:51 UTC

[GitHub] [hudi] xiarixiaoyao commented on a diff in pull request #6337: [HUDI-4578] Reduce the scope and duration of holding checkpoint lock …

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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org