Tejaskriya commented on code in PR #6751:
URL: https://github.com/apache/ozone/pull/6751#discussion_r1630011740


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -445,47 +447,49 @@ public MultiDeleteResponse 
multiDelete(@PathParam("bucket") String bucketName,
 
     OzoneBucket bucket = getBucket(bucketName);
     MultiDeleteResponse result = new MultiDeleteResponse();
+    Map<String, ErrorInfo> undeletedKeyResultMap;
+    List<String> deleteKeys = new ArrayList<>();
+
     if (request.getObjects() != null) {
       for (DeleteObject keyToDelete : request.getObjects()) {
-        long startNanos = Time.monotonicNowNanos();
-        try {
-          bucket.deleteKey(keyToDelete.getKey());
-          getMetrics().updateDeleteKeySuccessStats(startNanos);
-
-          if (!request.isQuiet()) {
-            result.addDeleted(new DeletedObject(keyToDelete.getKey()));
-          }
-        } catch (OMException ex) {
-          if (isAccessDenied(ex)) {
-            getMetrics().updateDeleteKeyFailureStats(startNanos);
-            result.addError(
-                new Error(keyToDelete.getKey(), "PermissionDenied",
-                    ex.getMessage()));
-          } else if (ex.getResult() != ResultCodes.KEY_NOT_FOUND) {
-            getMetrics().updateDeleteKeyFailureStats(startNanos);
-            result.addError(
-                new Error(keyToDelete.getKey(), "InternalError",
-                    ex.getMessage()));
-          } else {
+        deleteKeys.add(keyToDelete.getKey());
+      }

Review Comment:
   The main reason to create deleteKeys was for the deleteKeys API which 
required a list of string of keys
   `undeletedKeyResultMap = bucket.deleteKeys(deleteKeys, true);`
   After this operation, I just reused the list in the auditMap by removing the 
successful deletes. (instead of creating another list for failedDeletes)
   



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