RussellSpitzer commented on a change in pull request #1313:
URL: https://github.com/apache/iceberg/pull/1313#discussion_r467931062



##########
File path: 
spark/src/main/java/org/apache/iceberg/actions/RemoveOrphanFilesAction.java
##########
@@ -161,15 +172,44 @@ public RemoveOrphanFilesAction 
deleteWith(Consumer<String> newDeleteFunc) {
         .as(Encoders.STRING())
         .collectAsList();
 
-    Tasks.foreach(orphanFiles)
-        .noRetry()
-        .suppressFailureWhenFinished()
-        .onFailure((file, exc) -> LOG.warn("Failed to delete file: {}", file, 
exc))
-        .run(deleteFunc::accept);
+    paralleExecutor(sparkContext, orphanFiles, excutorTaskNum, deleteFunc);
 
     return orphanFiles;
   }
 
+  private void paralleExecutor(JavaSparkContext javaSc, List<String> 
orphanFiles,
+                              int numSlices, Consumer deleteConsumer) {
+    if (numSlices == 0) {

Review comment:
       I'm not a big fan of parameters which trigger different behaviors on 
certain values. Perhaps there should be a boolean which enables the different 
execution mode?




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to