duongkame commented on code in PR #4433:
URL: https://github.com/apache/ozone/pull/4433#discussion_r1142501710


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/AWSV4AuthValidator.java:
##########
@@ -43,6 +43,20 @@ final class AWSV4AuthValidator {
   private AWSV4AuthValidator() {
   }
 
+  /**
+   * ThreadLocal cache of Mac instances.
+   */
+  private static final ThreadLocal<Mac> THREAD_LOCAL_MAC =
+      ThreadLocal.withInitial(() -> {
+        try {
+          return Mac.getInstance(HMAC_SHA256_ALGORITHM);
+        } catch (NoSuchAlgorithmException nsa) {
+          throw new IllegalArgumentException(
+              "Failed to initialize Mac instance that implements the " +
+                  HMAC_SHA256_ALGORITHM + " algorithm" + nsa);

Review Comment:
   ```suggestion
                 "Failed to initialize Mac instance that implements the " +
                     HMAC_SHA256_ALGORITHM + " algorithm.", nsa);
   ```



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