stream2000 commented on code in PR #7865:
URL: https://github.com/apache/hudi/pull/7865#discussion_r1098438588


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java:
##########
@@ -101,6 +102,16 @@ public CleanPlanner(HoodieEngineContext context, 
HoodieTable<T, I, K, O> hoodieT
     this.fgIdToPendingLogCompactionOperations = 
fileSystemView.getPendingLogCompactionOperations()
         .map(entry -> Pair.of(new 
HoodieFileGroupId(entry.getValue().getPartitionPath(), 
entry.getValue().getFileId()), entry.getValue()))
         .collect(Collectors.toMap(Pair::getKey, Pair::getValue));
+
+    // load all partitions in advance if necessary.
+    if (config.isMetadataTableEnabled()
+        && 
config.getCleanerPolicy().equals(HoodieCleaningPolicy.KEEP_LATEST_FILE_VERSIONS)
+        && 
(config.getViewStorageConfig().getStorageType().equals(FileSystemViewStorageType.MEMORY)
+            || 
(config.getViewStorageConfig().getStorageType().equals(FileSystemViewStorageType.REMOTE_FIRST)
+                && 
config.getViewStorageConfig().getSecondaryStorageType().equals(FileSystemViewStorageType.MEMORY))))
 {
+      LOG.info("Load all partitions and files into file system view in advance 
when using KEEP_LATEST_FILE_VERSIONS.");
+      fileSystemView.loadAllPartitions();

Review Comment:
   Will this approach be slower than master branch implementation in spark?  In 
spark engine,  partitions will be loaded parallelly in subtasks while here 
partitions will be loaded by a single thread. 



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