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 2021/06/24 02:40:30 UTC

[GitHub] [hudi] yuzhaojing commented on a change in pull request #3134: [HUDI-2052] Support load logFile in BootstrapFunction

yuzhaojing commented on a change in pull request #3134:
URL: https://github.com/apache/hudi/pull/3134#discussion_r657583870



##########
File path: hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/BootstrapFunction.java
##########
@@ -197,10 +219,70 @@ private void loadRecords(String partitionPath, Collector<O> out) {
         }
       }
     }
+  }
 
-    long cost = System.currentTimeMillis() - start;
-    LOG.info("Task [{}}:{}}] finish loading the index under partition {} and sending them to downstream, time cost: {} milliseconds.",
-        this.getClass().getSimpleName(), taskID, partitionPath, cost);
+  @SuppressWarnings("unchecked")
+  private void loadLogFiles(String partitionPath, Collector<O> out) throws Exception {
+    Option<HoodieInstant> latestCommitTime = this.hoodieTable.getMetaClient().getCommitsTimeline()
+            .filterCompletedInstants().lastInstant();
+    if (!latestCommitTime.isPresent()) {
+      return;
+    }
+
+    List<HoodieLogFile> logFiles = this.hoodieTable.getSliceView()
+            .getLatestFileSlicesBeforeOrOn(partitionPath, latestCommitTime.get().getTimestamp(), true)
+            .map(fileSlice -> fileSlice.getLogFiles().collect(toList()))

Review comment:
       I think so, I will modify this logic.




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

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