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



##########
File path: 
hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/BootstrapFunction.java
##########
@@ -203,17 +241,44 @@ private void loadRecords(String partitionPath, 
Collector<O> out) {
         this.getClass().getSimpleName(), taskID, partitionPath, cost);
   }
 
+  private HoodieMergedLogRecordScanner scanLog(
+          List<String> logPaths,
+          Schema logSchema,
+          String latestInstantTime) {
+    String basePath = this.hoodieTable.getMetaClient().getBasePath();
+    return HoodieMergedLogRecordScanner.newBuilder()
+        .withFileSystem(FSUtils.getFs(basePath, this.hadoopConf))
+        .withBasePath(basePath)
+        .withLogFilePaths(logPaths)
+        .withReaderSchema(logSchema)
+        .withLatestInstantTime(latestInstantTime)
+        
.withReadBlocksLazily(this.writeConfig.getCompactionLazyBlockReadEnabled())
+        .withReverseReader(false)
+        .withBufferSize(this.writeConfig.getMaxDFSStreamBufferSize())
+        
.withMaxMemorySizeInBytes(this.writeConfig.getMaxMemoryPerPartitionMerge())
+        .withSpillableMapBasePath(this.writeConfig.getSpillableMapBasePath())
+        .build();
+  }
+
   @SuppressWarnings("unchecked")
-  public static HoodieRecord generateHoodieRecord(HoodieKey hoodieKey, 
HoodieBaseFile baseFile) {
+  public static HoodieRecord generateHoodieRecord(HoodieKey hoodieKey, 
FileSlice fileSlice) {
     HoodieRecord hoodieRecord = new HoodieRecord(hoodieKey, null);
-    hoodieRecord.setCurrentLocation(new 
HoodieRecordGlobalLocation(hoodieKey.getPartitionPath(), 
baseFile.getCommitTime(), baseFile.getFileId()));
+    hoodieRecord.setCurrentLocation(new 
HoodieRecordGlobalLocation(hoodieKey.getPartitionPath(), 
fileSlice.getBaseInstantTime(), fileSlice.getFileId()));
     hoodieRecord.seal();
 
     return hoodieRecord;
   }
 
+  private static boolean shouldLoadFileId(String fileId,

Review comment:
       `shouldLoadFile` seems better?

##########
File path: 
hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/BootstrapFunction.java
##########
@@ -18,19 +18,23 @@
 
 package org.apache.hudi.sink.bootstrap;
 
+import org.apache.avro.Schema;

Review comment:
       we follow `hudi class first` rule, please split it.




-- 
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-unsubscr...@hudi.apache.org

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


Reply via email to