You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/10 14:11:13 UTC

[GitHub] [iceberg] RussellSpitzer commented on a change in pull request #1313: Move RemoveOrphanFilesAction run in Driver to Excutor

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org