YARN-5905. Update the RM webapp host that is reported as part of Federation membership to current primary RM's IP.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d48ddca9 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d48ddca9 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d48ddca9 Branch: refs/heads/YARN-2915 Commit: d48ddca9861fc169ab76a54d2e6160f37ceb14a8 Parents: d37cfd0 Author: Subru Krishnan <su...@apache.org> Authored: Tue Nov 22 18:30:40 2016 -0800 Committer: Subru Krishnan <su...@apache.org> Committed: Mon May 8 16:44:16 2017 -0700 ---------------------------------------------------------------------- .../federation/FederationStateStoreService.java | 4 ++-- .../federation/TestFederationRMStateStoreService.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/d48ddca9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java index 9a01d7e..530184f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java @@ -177,8 +177,8 @@ public class FederationStateStoreService extends AbstractService config.getSocketAddr(YarnConfiguration.RM_ADMIN_ADDRESS, YarnConfiguration.DEFAULT_RM_ADMIN_ADDRESS, YarnConfiguration.DEFAULT_RM_ADMIN_PORT)); - String webAppAddress = - WebAppUtils.getResolvedRemoteRMWebAppURLWithoutScheme(config); + String webAppAddress = getServiceAddress(NetUtils + .createSocketAddr(WebAppUtils.getRMWebAppURLWithScheme(config))); SubClusterInfo subClusterInfo = SubClusterInfo.newInstance(subClusterId, amRMAddress, clientRMAddress, rmAdminAddress, webAppAddress, http://git-wip-us.apache.org/repos/asf/hadoop/blob/d48ddca9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java index 30f69b5..d92a793 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java @@ -19,6 +19,7 @@ package org.apache.hadoop.yarn.server.resourcemanager.federation; import java.io.IOException; import java.io.StringReader; +import java.net.UnknownHostException; import javax.xml.bind.JAXBException; @@ -157,12 +158,20 @@ public class TestFederationRMStateStoreService { } private String checkSubClusterInfo(SubClusterState state) - throws YarnException { + throws YarnException, UnknownHostException { Assert.assertNotNull(stateStore.getSubCluster(request)); SubClusterInfo response = stateStore.getSubCluster(request).getSubClusterInfo(); Assert.assertEquals(state, response.getState()); Assert.assertTrue(response.getLastHeartBeat() >= lastHearbeatTS); + String expectedAddress = + (response.getClientRMServiceAddress().split(":"))[0]; + Assert.assertEquals(expectedAddress, + (response.getAMRMServiceAddress().split(":"))[0]); + Assert.assertEquals(expectedAddress, + (response.getRMAdminServiceAddress().split(":"))[0]); + Assert.assertEquals(expectedAddress, + (response.getRMWebServiceAddress().split(":"))[0]); lastHearbeatTS = response.getLastHeartBeat(); return response.getCapability(); } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org