You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "stream2000 (via GitHub)" <gi...@apache.org> on 2023/02/07 10:00:33 UTC

[GitHub] [hudi] stream2000 commented on a diff in pull request #7865: [HUDI-5710] Load all partitions in advance when using KEEP_LATEST_FILE_VERSIONS clean policy and MDT enable

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

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