adoroszlai commented on a change in pull request #2772:
URL: https://github.com/apache/ozone/pull/2772#discussion_r745435622



##########
File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java
##########
@@ -622,4 +631,48 @@ public static long getShutDownTimeOut(ConfigurationSource 
conf) {
   public static int roundupMb(long bytes) {
     return (int)Math.ceil((double) bytes/(double) ONE_MB);
   }
+
+  /**
+   * Unwrap exception to check if it is some kind of access control problem
+   * ({@link AccessControlException} or {@link SecretManager.InvalidToken})
+   * or a RpcException.
+   */
+  public static Throwable getUnwrappedException(Exception ex) {
+    if (ex instanceof ServiceException) {
+      Throwable t = ex.getCause();
+      if (t instanceof RemoteException) {
+        t = ((RemoteException) t).unwrapRemoteException();
+      }
+      while (t != null) {
+        if (t instanceof RpcException ||
+            t instanceof AccessControlException ||
+            t instanceof SecretManager.InvalidToken) {
+          return t;
+        }
+        t = t.getCause();
+      }
+    }
+    Map<Integer, Integer> map = new HashMap();

Review comment:
       Findbugs complains about this unused map.




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