ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stoa...@apache.org
Subject ambari git commit: AMBARI-16820. Blueprint Export does not replace hive.llap.zk.sm.connectionString. (Daniel Gergely via stoader)
Date Tue, 24 May 2016 12:21:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8bc59516b -> 0965ddec8


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/0965ddec
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0965ddec
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0965ddec

Branch: refs/heads/trunk
Commit: 0965ddec865740b2ab8165981dbdc363e45177c3
Parents: 8bc5951
Author: Daniel Gergely <dgergely@hortonworks.com>
Authored: Tue May 24 14:17:47 2016 +0200
Committer: Toader, Sebastian <stoader@hortonworks.com>
Committed: Tue May 24 14:20:47 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/0965ddec/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/0965ddec/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;
     }
   }
-
 }


Mime
View raw message