szetszwo commented on code in PR #5644:
URL: https://github.com/apache/ozone/pull/5644#discussion_r1403790168


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -217,17 +219,19 @@ public Response put(
       @QueryParam("uploadId") @DefaultValue("") String uploadID,
       InputStream body) throws IOException, OS3Exception {
     long startNanos = Time.monotonicNowNanos();
-    S3GAction s3GAction = S3GAction.CREATE_KEY;
-
+    // Set to an Array so that S3GAction can be changed within the function.
+    final S3GAction[] s3GAction = new S3GAction[] {S3GAction.CREATE_KEY};
     boolean auditSuccess = true;
+    Map<String, String> perf = new HashMap<>();

Review Comment:
   Add a `PerformanceStringBuilder` to build the performance string instead of 
a `Map`.
   ```java 
   //AuditLogger.java
     public static class PerformanceStringBuilder {
       private final StringBuilder builder = new 
StringBuilder(1024).append('[');
   
       public void appendNanos(String name,long nanos){
         append(name, TimeUnit.NANOSECONDS.toMillis(nanos));
       }
   
       public void append(String name,long value){
         builder.append(name)
             .append('=')
             .append(value)
             .append(", ");
       }
   
       public String build() {
         final int length = builder.length();
         if (length < 2) {
           return "[]";
         }
         builder.setCharAt(length - 2, ']');
         builder.setLength(length - 1);
         return builder.toString();
       }
     }
   ```



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