Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 f013e77d2 -> 9633574da


AMBARI-16820. Blueprint Export does not replace 
hive.llap.zk.sm.connectionString. (Daniel Gergely via stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9633574d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9633574d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9633574d

Branch: refs/heads/branch-2.4
Commit: 9633574dac50b58ada66c3b081dd366a64accbbd
Parents: f013e77
Author: Daniel Gergely <dgerg...@hortonworks.com>
Authored: Tue May 24 14:17:47 2016 +0200
Committer: Toader, Sebastian <stoa...@hortonworks.com>
Committed: Tue May 24 14:18:48 2016 +0200

----------------------------------------------------------------------
 .../BlueprintConfigurationProcessor.java        |  3 ++
 .../BlueprintConfigurationProcessorTest.java    | 37 +++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9633574d/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 9cabdbb..3c3d8e5 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
@@ -2239,6 +2239,7 @@ public class BlueprintConfigurationProcessor {
     Map<String, PropertyUpdater> hbaseEnvMap = new HashMap<String, 
PropertyUpdater>();
     Map<String, PropertyUpdater> hiveEnvMap = new HashMap<String, 
PropertyUpdater>();
     Map<String, PropertyUpdater> hiveInteractiveEnvMap = new HashMap<String, 
PropertyUpdater>();
+    Map<String, PropertyUpdater> hiveInteractiveSiteMap = new HashMap<String, 
PropertyUpdater>();
     Map<String, PropertyUpdater> oozieEnvMap = new HashMap<String, 
PropertyUpdater>();
     Map<String, PropertyUpdater> oozieEnvHeapSizeMap = new HashMap<String, 
PropertyUpdater>();
     Map<String, PropertyUpdater> oozieEnvOriginalValueMap = new 
HashMap<String, PropertyUpdater>();
@@ -2310,6 +2311,7 @@ public class BlueprintConfigurationProcessor {
     multiHostTopologyUpdaters.put("core-site", multiCoreSiteMap);
     multiHostTopologyUpdaters.put("hdfs-site", multiHdfsSiteMap);
     multiHostTopologyUpdaters.put("hive-site", multiHiveSiteMap);
+    multiHostTopologyUpdaters.put("hive-interactive-site", 
hiveInteractiveSiteMap);
     multiHostTopologyUpdaters.put("kafka-broker", multiKafkaBrokerMap);
     multiHostTopologyUpdaters.put("slider-client", multiSliderClientMap);
     multiHostTopologyUpdaters.put("yarn-site", multiYarnSiteMap);
@@ -2390,6 +2392,7 @@ public class BlueprintConfigurationProcessor {
 
     // HIVE Interactive Server
     hiveInteractiveEnvMap.put("hive_server_interactive_host", new 
SingleHostTopologyUpdater("HIVE_SERVER_INTERACTIVE"));
+    hiveInteractiveSiteMap.put("hive.llap.zk.sm.connectionString", new 
MultipleHostTopologyUpdater("ZOOKEEPER_SERVER"));
 
     // HIVE Atlas integration
     hiveSiteNonTopologyMap.put("hive.exec.post.hooks", new 
NonTopologyUpdater() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9633574d/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 073e827..b154e23 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
@@ -2874,6 +2874,42 @@ public class BlueprintConfigurationProcessorTest {
   }
 
   @Test
+  public void testHiveInteractiveLlapZookeeperConfigExported() throws 
Exception {
+    final String expectedHostName = "c6401.apache.ambari.org";
+    final String expectedHostNameTwo = "c6402.ambari.apache.org";
+    final String expectedHostGroupName = "host_group_1";
+    final String expectedHostGroupNameTwo = "host_group_2";
+    final String llapZkProperty = "hive.llap.zk.sm.connectionString";
+
+    Map<String, Map<String, String>> configProperties = new HashMap<String, 
Map<String, String>>();
+    Map<String, String> hiveInteractiveSiteProperties = new HashMap<String, 
String>();
+
+    configProperties.put("hive-interactive-site", 
hiveInteractiveSiteProperties);
+
+    hiveInteractiveSiteProperties.put(llapZkProperty, 
createHostAddress(expectedHostName, "2181") + "," + 
createHostAddress(expectedHostNameTwo, "2181"));
+
+    Configuration clusterConfig = new Configuration(configProperties, 
Collections.<String, Map<String, Map<String, String>>>emptyMap());
+    Collection<String> hgComponents = new HashSet<String>();
+    hgComponents.add("ZOOKEEPER_SERVER");
+    TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, 
hgComponents, Collections.singleton(expectedHostName));
+
+    Collection<String> hgComponents2 = new HashSet<String>();
+    hgComponents2.add("ZOOKEEPER_SERVER");
+    TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, 
hgComponents2, Collections.singleton(expectedHostNameTwo));
+
+    Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
+    hostGroups.add(group1);
+    hostGroups.add(group2);
+
+    ClusterTopology topology = createClusterTopology(bp, clusterConfig, 
hostGroups);
+    BlueprintConfigurationProcessor updater = new 
BlueprintConfigurationProcessor(topology);
+    updater.doUpdateForBlueprintExport();
+
+    final String expectedPropertyValue = createExportedAddress("2181", 
expectedHostGroupName) + "," + createExportedAddress("2181", 
expectedHostGroupNameTwo);
+    assertEquals("hive.llap.zk.sm.connectionString property not updated 
correctly", expectedPropertyValue, 
hiveInteractiveSiteProperties.get(llapZkProperty));
+  }
+
+  @Test
   public void 
testOozieConfigClusterUpdateHAEnabledSpecifyingHostNamesDirectly() throws 
Exception {
     final String expectedHostName = "c6401.apache.ambari.org";
     final String expectedHostNameTwo = "c6402.ambari.apache.org";
@@ -7543,5 +7579,4 @@ public class BlueprintConfigurationProcessorTest {
       this.configuration = configuration;
     }
   }
-
 }

Reply via email to