RussellSpitzer commented on a change in pull request #1313:
URL: https://github.com/apache/iceberg/pull/1313#discussion_r467938888
##########
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,
Review comment:
I'm sure others have different opinions, but I would take the branch out
of this function, currently it reads as though on line 175 all deletes are
parallelized and then you need to look into this function to see that it's not
actually the case. So either a rename "maybeExecuteParallel" or move the if
branch out.
----------------------------------------------------------------
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]