You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/07/29 15:13:19 UTC

[GitHub] [hadoop] goiri commented on a diff in pull request #4658: YARN-11237. Fix Bug while disabling proxy failover with Federation

goiri commented on code in PR #4658:
URL: https://github.com/apache/hadoop/pull/4658#discussion_r933372728


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java:
##########
@@ -99,7 +99,8 @@ protected static <T> T createRMProxy(final Configuration configuration,
         ? (YarnConfiguration) configuration
         : new YarnConfiguration(configuration);
     RetryPolicy retryPolicy = createRetryPolicy(conf,
-        (HAUtil.isHAEnabled(conf) || HAUtil.isFederationFailoverEnabled(conf)));
+        (HAUtil.isHAEnabled(conf) || (HAUtil.isFederationEnabled(conf)

Review Comment:
   This boolean is not easy to read.
   Can we extract with some nice comment and reuse it?
   Something like:
   ```
   /**
    * Explain the logic
    */
   private static boolean isFailoveEnabled(conf) {
     if (HAUtil.isHAEnabled(conf)) {
       // Comment explaining why
       return true;
     }
     if (HAUtil.isFederationEnabled(conf) && HAUtil.isFederationFailoverEnabled(conf)) {
       // Comment explaining why
       return true;
     }
     return false;
   }
   ```



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org