parisni commented on code in PR #6580:
URL: https://github.com/apache/hudi/pull/6580#discussion_r973439309


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanActionExecutor.java:
##########
@@ -110,9 +112,15 @@ HoodieCleanerPlan requestClean(HoodieEngineContext 
context) {
       context.setJobStatus(this.getClass().getSimpleName(), "Generating list 
of file slices to be cleaned: " + config.getTableName());
 
       Map<String, Pair<Boolean, List<CleanFileInfo>>> 
cleanOpsWithPartitionMeta = context
-          .map(partitionsToClean, partitionPathToClean -> 
Pair.of(partitionPathToClean, planner.getDeletePaths(partitionPathToClean)), 
cleanerParallelism)
+          .parallelize(partitionsToClean, cleanerParallelism)
+          .mapPartitions((Iterator<String> it) -> {
+            List<String> list = new ArrayList<>();
+            it.forEachRemaining(list::add);
+            Map<String, Pair<Boolean, List<CleanFileInfo>>> res = 
planner.getDeletePaths(list);
+            return res.entrySet().iterator();
+          }, false).collectAsList()
           .stream()
-          .collect(Collectors.toMap(Pair::getKey, Pair::getValue));
+          .collect(Collectors.toMap(it -> it.getKey(), it -> it.getValue()));

Review Comment:
   ``Pair::getX` is not applicable anymore since the stream type has changed 
from `Stream<Pair...>` to `Stream<Entry...>` 



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