amogh-jahagirdar commented on code in PR #5379:
URL: https://github.com/apache/iceberg/pull/5379#discussion_r933901430
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -168,56 +169,42 @@ public Map<String, String> properties() {
@Override
public void deleteFiles(Iterable<String> paths) throws
BulkDeletionFailureException {
if (awsProperties.s3DeleteTags() != null &&
!awsProperties.s3DeleteTags().isEmpty()) {
+ Set<Tag> deleteTags = awsProperties.s3DeleteTags();
Tasks.foreach(paths)
.noRetry()
.executeWith(executorService())
.suppressFailureWhenFinished()
.onFailure(
- (path, exc) ->
- LOG.warn(
- "Failed to add delete tags: {} to {}",
- awsProperties.s3DeleteTags(),
- path,
- exc))
- .run(path -> tagFileToDelete(path, awsProperties.s3DeleteTags()));
+ (path, exc) -> LOG.warn("Failed to add delete tags: {} to {}",
deleteTags, path, exc))
+ .run(path -> tagFileToDelete(path, deleteTags));
}
- if (!awsProperties.isS3DeleteEnabled()) {
- return;
+ if (awsProperties.isS3DeleteEnabled()) {
+ SetMultimap<String, String> bucketToObjects =
computeBucketToObjects(paths);
Review Comment:
We are now eagerly computing the bucket to objects mapping up front, as
opposed to before where we would iterate over the paths, keep track of the
objects per bucket and if for a given bucket the size of the objects is the
batch size, the deletion would get triggered (and the mapping would get
removed).
Now, it's all up front, so there would be more memory consumption but I
think it should be ok. 1 million objects with a max key of 1024 bytes is 1 GB
representation of paths.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]