kfaraz commented on code in PR #18891:
URL: https://github.com/apache/druid/pull/18891#discussion_r2915915008


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentKiller.java:
##########
@@ -94,32 +97,34 @@ public void kill(List<DataSegment> segments) throws 
SegmentLoadingException
     final ServerSideEncryptingAmazonS3 s3Client = this.s3ClientSupplier.get();
 
     // create a map of bucket to keys to delete
-    Map<String, List<DeleteObjectsRequest.KeyVersion>> bucketToKeysToDelete = 
new HashMap<>();
+    Map<String, List<ObjectIdentifier>> bucketToKeysToDelete = new HashMap<>();
     for (DataSegment segment : segments) {
       String s3Bucket = MapUtils.getString(segment.getLoadSpec(), 
S3DataSegmentPuller.BUCKET);
       String path = MapUtils.getString(segment.getLoadSpec(), 
S3DataSegmentPuller.KEY);
-      List<DeleteObjectsRequest.KeyVersion> keysToDelete = 
bucketToKeysToDelete.computeIfAbsent(
+      List<ObjectIdentifier> keysToDelete = 
bucketToKeysToDelete.computeIfAbsent(
           s3Bucket,
           k -> new ArrayList<>()
       );
       if (path.endsWith("/")) {
         // segment is not compressed, list objects and add them all to delete 
list
-        final ListObjectsV2Result list = s3Client.listObjectsV2(
-            new 
ListObjectsV2Request().withBucketName(s3Bucket).withPrefix(path)
-        );
-        for (S3ObjectSummary objectSummary : list.getObjectSummaries()) {
-          keysToDelete.add(new 
DeleteObjectsRequest.KeyVersion(objectSummary.getKey()));
+        ListObjectsV2Request request = ListObjectsV2Request.builder()

Review Comment:
   Nit: The `.builder()` in several of the files will lead to unnecessary 
reformats later. Please check if they can be moved to the next line in all such 
places.



-- 
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]

Reply via email to