amogh-jahagirdar commented on code in PR #5379:
URL: https://github.com/apache/iceberg/pull/5379#discussion_r933901480
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -244,26 +231,34 @@ private void tagFileToDelete(String path, Set<Tag>
deleteTags) throws S3Exceptio
client().putObjectTagging(putObjectTaggingRequest);
}
- private List<String> deleteObjectsInBucket(String bucket, Collection<String>
objects) {
- if (!objects.isEmpty()) {
- List<ObjectIdentifier> objectIds =
- objects.stream()
- .map(objectKey ->
ObjectIdentifier.builder().key(objectKey).build())
- .collect(Collectors.toList());
- DeleteObjectsRequest deleteObjectsRequest =
- DeleteObjectsRequest.builder()
- .bucket(bucket)
- .delete(Delete.builder().objects(objectIds).build())
- .build();
- DeleteObjectsResponse response =
client().deleteObjects(deleteObjectsRequest);
- if (response.hasErrors()) {
- return response.errors().stream()
- .map(error -> String.format("s3://%s/%s", bucket, error.key()))
- .collect(Collectors.toList());
- }
- }
+ // Helper to batch delete objects in a single bucket
+ private List<String> batchDeleteObjects(
+ String bucket, Iterable<String> objects, List<String> failures)
+ throws BulkDeletionFailureException {
+ Iterable<List<String>> batches =
Review Comment:
Now that we're parallelizing by default we should partition up front as well
so that we can clearly assign a partition to a thread. Or another way is to
lazily come up with the partitions and then submit the task to the underlying
executor service. I opted for just following the Tasks pattern, but in case
folks prefer not having to compute the partitions up front open to the other
way as well.
--
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]