You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ey...@apache.org on 2019/06/28 18:55:27 UTC

[hadoop] branch trunk updated: YARN-9581. Add support for get multiple RM webapp URLs. Contributed by Prabhu Joseph

This is an automated email from the ASF dual-hosted git repository.

eyang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f02b0e1  YARN-9581. Add support for get multiple RM webapp URLs.            Contributed by Prabhu Joseph
f02b0e1 is described below

commit f02b0e19940dc6fc1e19258a40db37d1eed89d21
Author: Eric Yang <ey...@apache.org>
AuthorDate: Fri Jun 28 14:51:58 2019 -0400

    YARN-9581. Add support for get multiple RM webapp URLs.
               Contributed by Prabhu Joseph
---
 .../java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java
index 5b1c3bb..09daf42 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java
@@ -102,8 +102,16 @@ public class WebAppUtils {
       return func.apply(rm1Address, arg);
     } catch (Exception e) {
       if (HAUtil.isHAEnabled(conf)) {
-        String rm2Address = getRMWebAppURLWithScheme(conf, 1);
-        return func.apply(rm2Address, arg);
+        int rms = HAUtil.getRMHAIds(conf).size();
+        for (int i=1; i<rms; i++) {
+          try {
+            rm1Address = getRMWebAppURLWithScheme(conf, i);
+            return func.apply(rm1Address, arg);
+          } catch (Exception e1) {
+            // ignore and try next one when RM is down
+            e = e1;
+          }
+        }
       }
       throw e;
     }


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