adoroszlai commented on code in PR #4753:
URL: https://github.com/apache/ozone/pull/4753#discussion_r1201571760


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -418,25 +420,33 @@ public MultiDeleteResponse 
multiDelete(@PathParam("bucket") String bucketName,
     MultiDeleteResponse result = new MultiDeleteResponse();
     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 if (!request.isQuiet()) {
-            result.addDeleted(new DeletedObject(keyToDelete.getKey()));
+          } else {
+            if (request.isQuiet()) {
+              result.addDeleted(new DeletedObject(keyToDelete.getKey()));

Review Comment:
   Is this change in condition (`!isQuiet` -> `isQuiet`) intentional?



##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -281,6 +281,7 @@ public Response put(
       }
       if (output != null) {
         output.close();
+        getMetrics().updateCreateKeySuccessStats(startNanos);

Review Comment:
   This may be executed for both success and failure.  Success stats should be 
updated inside `if (auditSuccess)`.



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