This is an automated email from the ASF dual-hosted git repository. benyoka pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push: new e440c50 [AMBARI-24870] Allow blueprint install without HISTORYMANAGER, APP_TIMELINE_SERVER (benyoka) (#2590) e440c50 is described below commit e440c50d73c96c9772f2594a23de061f9786d586 Author: benyoka <beny...@users.noreply.github.com> AuthorDate: Fri Nov 9 19:10:23 2018 +0100 [AMBARI-24870] Allow blueprint install without HISTORYMANAGER, APP_TIMELINE_SERVER (benyoka) (#2590) * AMBARI-24870 Allow blueprint install without HISTORYMANAGER, APP_TIMELINE_SERVER (benyoka) * AMBARI-24870 fix unit test (benyoka) --- .../internal/BlueprintConfigurationProcessor.java | 16 +++++++-------- .../BlueprintConfigurationProcessorTest.java | 23 +++++++--------------- 2 files changed, 15 insertions(+), 24 deletions(-) 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 1b62c29..7803e90 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 @@ -2961,10 +2961,10 @@ public class BlueprintConfigurationProcessor { mapredSiteMap.put("mapreduce.job.hdfs-servers", new SingleHostTopologyUpdater("NAMENODE")); - // HISTORY_SERVER - yarnSiteMap.put("yarn.log.server.url", new SingleHostTopologyUpdater("HISTORYSERVER")); - mapredSiteMap.put("mapreduce.jobhistory.webapp.address", new SingleHostTopologyUpdater("HISTORYSERVER")); - mapredSiteMap.put("mapreduce.jobhistory.address", new SingleHostTopologyUpdater("HISTORYSERVER")); + // HISTORYSERVER + yarnSiteMap.put("yarn.log.server.url", new OptionalSingleHostTopologyUpdater("HISTORYSERVER")); + mapredSiteMap.put("mapreduce.jobhistory.webapp.address", new OptionalSingleHostTopologyUpdater("HISTORYSERVER")); + mapredSiteMap.put("mapreduce.jobhistory.address", new OptionalSingleHostTopologyUpdater("HISTORYSERVER")); // RESOURCEMANAGER yarnSiteMap.put("yarn.resourcemanager.hostname", new OptionalSingleHostTopologyUpdater("RESOURCEMANAGER")); @@ -2976,10 +2976,10 @@ public class BlueprintConfigurationProcessor { yarnSiteMap.put("yarn.resourcemanager.webapp.https.address", new OptionalSingleHostTopologyUpdater("RESOURCEMANAGER")); // APP_TIMELINE_SERVER - yarnSiteMap.put("yarn.timeline-service.address", new SingleHostTopologyUpdater("APP_TIMELINE_SERVER")); - yarnSiteMap.put("yarn.timeline-service.webapp.address", new SingleHostTopologyUpdater("APP_TIMELINE_SERVER")); - yarnSiteMap.put("yarn.timeline-service.webapp.https.address", new SingleHostTopologyUpdater("APP_TIMELINE_SERVER")); - yarnSiteMap.put("yarn.log.server.web-service.url", new SingleHostTopologyUpdater("APP_TIMELINE_SERVER")); + yarnSiteMap.put("yarn.timeline-service.address", new OptionalSingleHostTopologyUpdater("APP_TIMELINE_SERVER")); + yarnSiteMap.put("yarn.timeline-service.webapp.address", new OptionalSingleHostTopologyUpdater("APP_TIMELINE_SERVER")); + yarnSiteMap.put("yarn.timeline-service.webapp.https.address", new OptionalSingleHostTopologyUpdater("APP_TIMELINE_SERVER")); + yarnSiteMap.put("yarn.log.server.web-service.url", new OptionalSingleHostTopologyUpdater("APP_TIMELINE_SERVER")); // TIMELINE_READER yarnSiteMap.put("yarn.timeline-service.reader.webapp.address", new MultipleHostTopologyUpdater("TIMELINE_READER")); 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 f718862..de70e36 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 @@ -2565,15 +2565,11 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__MissingComponent() throws Exception { Map<String, Map<String, String>> properties = new HashMap<>(); - Map<String, String> typeProps = new HashMap<>(); - typeProps.put("yarn.resourcemanager.hostname", "localhost"); - typeProps.put("yarn.timeline-service.address", "localhost"); - properties.put("yarn-site", typeProps); - + properties.put("mapred-site", + new HashMap<>(ImmutableMap.of("mapreduce.job.hdfs-servers", "localhost"))); Configuration clusterConfig = new Configuration(properties, emptyMap()); Collection<String> group1Components = new HashSet<>(); - group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); @@ -2587,8 +2583,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { hostGroups.add(group1); hostGroups.add(group2); - expect(stack.getCardinality("APP_TIMELINE_SERVER")).andReturn(new Cardinality("1")).anyTimes(); - expect(stack.getCardinality("TIMELINE_READER")).andReturn(new Cardinality("1")).anyTimes(); + expect(stack.getCardinality("NAMENODE")).andReturn(new Cardinality("1")).anyTimes(); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology); @@ -2607,9 +2602,8 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { Map<String, Map<String, String>> properties = new HashMap<>(); Map<String, String> typeProps = new HashMap<>(); - typeProps.put("yarn.resourcemanager.hostname", "localhost"); - typeProps.put("yarn.timeline-service.address", "localhost"); - properties.put("yarn-site", typeProps); + properties.put("mapred-site", + new HashMap<>(ImmutableMap.of("mapreduce.job.hdfs-servers", "localhost"))); Configuration clusterConfig = new Configuration(properties, emptyMap()); @@ -2622,19 +2616,16 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport { TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); Collection<String> group2Components = new HashSet<>(); + group2Components.add("NAMENODE"); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); - group2Components.add("APP_TIMELINE_SERVER"); - group2Components.add("TIMELINE_READER"); TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2")); Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); - expect(stack.getCardinality("APP_TIMELINE_SERVER")).andReturn(new Cardinality("0-1")).anyTimes(); - expect(stack.getCardinality("TIMELINE_READER")).andReturn(new Cardinality("0-1")).anyTimes(); - + expect(stack.getCardinality("NAMENODE")).andReturn(new Cardinality("0-1")).anyTimes(); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology);