Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B0AD3200CF7 for ; Mon, 14 Aug 2017 22:18:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AF771165C9F; Mon, 14 Aug 2017 20:18:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D063B165C92 for ; Mon, 14 Aug 2017 22:18:06 +0200 (CEST) Received: (qmail 28054 invoked by uid 500); 14 Aug 2017 20:18:06 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 27561 invoked by uid 99); 14 Aug 2017 20:18:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2017 20:18:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5FED9E0262; Mon, 14 Aug 2017 20:18:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jonathanhurley@apache.org To: commits@ambari.apache.org Date: Mon, 14 Aug 2017 20:18:11 -0000 Message-Id: <217e52065e594ee2acb1f0924d24bc5c@git.apache.org> In-Reply-To: <07dadd64525148b382d825d016229a94@git.apache.org> References: <07dadd64525148b382d825d016229a94@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/17] ambari git commit: AMBARI-21619. More ResourceManager HA host group placeholders in blueprints archived-at: Mon, 14 Aug 2017 20:18:07 -0000 AMBARI-21619. More ResourceManager HA host group placeholders in blueprints Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/78684fb7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/78684fb7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/78684fb7 Branch: refs/heads/branch-feature-AMBARI-21450 Commit: 78684fb7cb5058eb5ada6ab8fc8bcf664c24df9e Parents: 9e8a039 Author: Attila Doroszlai Authored: Tue Aug 1 14:22:37 2017 +0200 Committer: Attila Doroszlai Committed: Fri Aug 11 13:50:47 2017 +0200 ---------------------------------------------------------------------- .../BlueprintConfigurationProcessor.java | 18 +++++------ .../BlueprintConfigurationProcessorTest.java | 34 +++++++++++++------- 2 files changed, 31 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/78684fb7/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java index 5fd2b5b..ab6a586 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java @@ -899,14 +899,14 @@ public class BlueprintConfigurationProcessor { Map yarnSiteConfig = clusterTopology.getConfiguration().getFullProperties().get("yarn-site"); // generate the property names based on the current HA config for the ResourceManager deployments for (String resourceManager : parseResourceManagers(yarnSiteConfig)) { - final String rmHostPropertyName = "yarn.resourcemanager.hostname." + resourceManager; - yarnSiteUpdatersForAvailability.put(rmHostPropertyName, new SingleHostTopologyUpdater("RESOURCEMANAGER")); - - final String rmHTTPAddress = "yarn.resourcemanager.webapp.address." + resourceManager; - yarnSiteUpdatersForAvailability.put(rmHTTPAddress, new SingleHostTopologyUpdater("RESOURCEMANAGER")); - - final String rmHTTPSAddress = "yarn.resourcemanager.webapp.https.address." + resourceManager; - yarnSiteUpdatersForAvailability.put(rmHTTPSAddress, new SingleHostTopologyUpdater("RESOURCEMANAGER")); + SingleHostTopologyUpdater updater = new SingleHostTopologyUpdater("RESOURCEMANAGER"); + yarnSiteUpdatersForAvailability.put("yarn.resourcemanager.hostname." + resourceManager, updater); + yarnSiteUpdatersForAvailability.put("yarn.resourcemanager.address." + resourceManager, updater); + yarnSiteUpdatersForAvailability.put("yarn.resourcemanager.admin.address." + resourceManager, updater); + yarnSiteUpdatersForAvailability.put("yarn.resourcemanager.resource-tracker.address." + resourceManager, updater); + yarnSiteUpdatersForAvailability.put("yarn.resourcemanager.scheduler.address." + resourceManager, updater); + yarnSiteUpdatersForAvailability.put("yarn.resourcemanager.webapp.address." + resourceManager, updater); + yarnSiteUpdatersForAvailability.put("yarn.resourcemanager.webapp.https.address." + resourceManager, updater); } return highAvailabilityUpdaters; @@ -1341,7 +1341,7 @@ public class BlueprintConfigurationProcessor { /** * Component name */ - private String component; + private final String component; /** * Constructor. http://git-wip-us.apache.org/repos/asf/ambari/blob/78684fb7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java index c5af0d9..1959610 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java @@ -3359,6 +3359,14 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { yarnSiteProperties.put("yarn.resourcemanager.ha.rm-ids", "rm1, rm2"); yarnSiteProperties.put("yarn.resourcemanager.hostname.rm1", expectedHostName); yarnSiteProperties.put("yarn.resourcemanager.hostname.rm2", expectedHostNameTwo); + yarnSiteProperties.put("yarn.resourcemanager.address.rm1", expectedHostName + ":" + expectedPortNum); + yarnSiteProperties.put("yarn.resourcemanager.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); + yarnSiteProperties.put("yarn.resourcemanager.admin.address.rm1", expectedHostName + ":" + expectedPortNum); + yarnSiteProperties.put("yarn.resourcemanager.admin.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); + yarnSiteProperties.put("yarn.resourcemanager.resource-tracker.address.rm1", expectedHostName + ":" + expectedPortNum); + yarnSiteProperties.put("yarn.resourcemanager.resource-tracker.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); + yarnSiteProperties.put("yarn.resourcemanager.scheduler.address.rm1", expectedHostName + ":" + expectedPortNum); + yarnSiteProperties.put("yarn.resourcemanager.scheduler.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.webapp.address.rm1", expectedHostName + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.webapp.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.webapp.https.address.rm1", expectedHostName + ":" + expectedPortNum); @@ -3411,18 +3419,20 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { createExportedHostName(expectedHostGroupName, expectedPortNum), yarnSiteProperties.get("yarn.timeline-service.webapp.https.address")); // verify that dynamically-named RM HA properties are exported as expected - assertEquals("Yarn ResourceManager rm1 hostname not exported properly", - createExportedHostName(expectedHostGroupName), yarnSiteProperties.get("yarn.resourcemanager.hostname.rm1")); - assertEquals("Yarn ResourceManager rm2 hostname not exported properly", - createExportedHostName(expectedHostGroupNameTwo), yarnSiteProperties.get("yarn.resourcemanager.hostname.rm2")); - assertEquals("Yarn ResourceManager rm1 web address not exported properly", - createExportedHostName(expectedHostGroupName, expectedPortNum), yarnSiteProperties.get("yarn.resourcemanager.webapp.address.rm1")); - assertEquals("Yarn ResourceManager rm2 web address not exported properly", - createExportedHostName(expectedHostGroupNameTwo, expectedPortNum), yarnSiteProperties.get("yarn.resourcemanager.webapp.address.rm2")); - assertEquals("Yarn ResourceManager rm1 HTTPS address not exported properly", - createExportedHostName(expectedHostGroupName, expectedPortNum), yarnSiteProperties.get("yarn.resourcemanager.webapp.https.address.rm1")); - assertEquals("Yarn ResourceManager rm2 HTTPS address not exported properly", - createExportedHostName(expectedHostGroupNameTwo, expectedPortNum), yarnSiteProperties.get("yarn.resourcemanager.webapp.https.address.rm2")); + List properties = Arrays.asList( + "yarn.resourcemanager.address", + "yarn.resourcemanager.admin.address", + "yarn.resourcemanager.resource-tracker.address", + "yarn.resourcemanager.scheduler.address", + "yarn.resourcemanager.webapp.address", + "yarn.resourcemanager.webapp.https.address" + ); + for (String property : properties) { + String propertyWithID = property + ".rm1"; + assertEquals(propertyWithID, createExportedHostName(expectedHostGroupName, expectedPortNum), yarnSiteProperties.get(propertyWithID)); + propertyWithID = property + ".rm2"; + assertEquals(propertyWithID, createExportedHostName(expectedHostGroupNameTwo, expectedPortNum), yarnSiteProperties.get(propertyWithID)); + } assertEquals("Yarn Zookeeper address property not exported properly", createExportedHostName(expectedHostGroupName, "2181") + "," + createExportedHostName(expectedHostGroupNameTwo, "2181"),