ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-14397. Cluster deployment with exported blueprint with stack advisor enabled doesn't work (Oliver Szabo via smohanty)
Date Thu, 07 Jan 2016 17:44:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 dcfce78d8 -> 77488a756


AMBARI-14397. Cluster deployment with exported blueprint with stack advisor enabled doesn't
work (Oliver Szabo via smohanty)


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

Branch: refs/heads/branch-2.2
Commit: 77488a756d45203a3a3bce9e8f886f7993c173e5
Parents: dcfce78
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Thu Jan 7 09:44:09 2016 -0800
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Thu Jan 7 09:44:38 2016 -0800

----------------------------------------------------------------------
 .../BlueprintConfigurationProcessor.java        |  5 +++-
 .../BlueprintConfigurationProcessorTest.java    | 24 +++++++++++++++++---
 2 files changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/77488a75/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 6d59c8e..261798c 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
@@ -466,8 +466,11 @@ public class BlueprintConfigurationProcessor {
   private void doReplaceProperties(Configuration configuration, String configType,
                                    AdvisedConfiguration advisedConfig, Set<String>
configTypesUpdated) {
     for (Map.Entry<String, String> propEntry : advisedConfig.getProperties().entrySet())
{
+      String originalValue = configuration.getPropertyValue(configType, propEntry.getKey());
       configuration.setProperty(configType, propEntry.getKey(), propEntry.getValue());
-      configTypesUpdated.add(configType);
+      if (!propEntry.getValue().equals(originalValue)) {
+        configTypesUpdated.add(configType);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/77488a75/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 2af60e2..cd40a91 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
@@ -5408,6 +5408,10 @@ public class BlueprintConfigurationProcessorTest {
     coreSiteMap.put("fs.defaultFS", "hdfs://" + expectedHostName + ":" + expectedPortNum);
     coreSiteMap.put("fs.stackDefault.key2", "dummyValue");
 
+    Map<String, String> dummySiteMap = new HashMap<String, String>();
+    properties.put("dummy-site", dummySiteMap);
+    dummySiteMap.put("dummy.prop", "dummyValue2");
+
     Map<String, Map<String, String>> parentProperties = new HashMap<String,
Map<String, String>>();
 
     Collection<String> hgComponents = new HashSet<String>();
@@ -5439,7 +5443,7 @@ public class BlueprintConfigurationProcessorTest {
     expect(stack.getConfiguration(bp.getServices())).andReturn(createStackDefaults()).anyTimes();
     replay(stack);
     // WHEN
-    configProcessor.doUpdateForClusterCreate();
+    Set<String> configTypeUpdated = configProcessor.doUpdateForClusterCreate();
     // THEN
     assertEquals(expectedHostName + ":" + expectedPortNum, clusterConfig.getPropertyValue("core-site",
"fs.default.name"));
     assertEquals("stackDefaultUpgraded", clusterConfig.getPropertyValue("core-site", "fs.stackDefault.key1"));
@@ -5447,6 +5451,7 @@ public class BlueprintConfigurationProcessorTest {
     assertNull(clusterConfig.getPropertyValue("core-site", "fs.stackDefault.key2"));
     // verify that fs.notStackDefault is filtered out
     assertNull(clusterConfig.getPropertyValue("core-site", "fs.notStackDefault"));
+    assertTrue(configTypeUpdated.contains("dummy-site"));
   }
 
   @Test
@@ -5463,6 +5468,10 @@ public class BlueprintConfigurationProcessorTest {
     coreSiteMap.put("fs.defaultFS", "hdfs://" + expectedHostName + ":" + expectedPortNum);
     coreSiteMap.put("fs.stackDefault.key2", "dummyValue");
 
+    Map<String, String> dummySiteMap = new HashMap<String, String>();
+    properties.put("dummy-site", dummySiteMap);
+    dummySiteMap.put("dummy.prop", "dummyValue");
+
     Map<String, Map<String, String>> parentProperties = new HashMap<String,
Map<String, String>>();
 
     Collection<String> hgComponents = new HashSet<String>();
@@ -5491,7 +5500,7 @@ public class BlueprintConfigurationProcessorTest {
     topology.setConfigRecommendationStrategy(ConfigRecommendationStrategy.ALWAYS_APPLY);
     BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology);
     // WHEN
-    configProcessor.doUpdateForClusterCreate();
+    Set<String> configTypes = configProcessor.doUpdateForClusterCreate();
     // THEN
     assertEquals(expectedHostName + ":" + expectedPortNum, clusterConfig.getPropertyValue("core-site","fs.default.name"));
     assertEquals("stackDefaultUpgraded", clusterConfig.getPropertyValue("core-site", "fs.stackDefault.key1"));
@@ -5499,7 +5508,8 @@ public class BlueprintConfigurationProcessorTest {
     assertNull(clusterConfig.getPropertyValue("core-site", "fs.stackDefault.key2"));
     // verify that fs.notStackDefault is not filtered out
     assertNotNull(clusterConfig.getPropertyValue("core-site", "fs.notStackDefault"));
-    assertEquals(1, topology.getAdvisedConfigurations().size());
+    assertEquals(2, topology.getAdvisedConfigurations().size());
+    assertFalse(configTypes.contains("dummy-site"));
   }
 
   @Test
@@ -6236,6 +6246,9 @@ public class BlueprintConfigurationProcessorTest {
     vaInfo.setDelete("true");
     valueAttributesInfoMap.put("fs.stackDefault.key2", vaInfo);
     advMap.put("core-site", new AdvisedConfiguration(confProp, valueAttributesInfoMap));
+    Map<String, String> dummyConfProp = new HashMap<String, String>();
+    dummyConfProp.put("dummy.prop", "dummyValue");
+    advMap.put("dummy-site", new AdvisedConfiguration(dummyConfProp, new HashMap<String,
ValueAttributesInfo>()));
     return advMap;
   }
 
@@ -6265,6 +6278,11 @@ public class BlueprintConfigurationProcessorTest {
     coreSiteDefault.put("fs.stackDefault.key2", "stackDefaultValue2");
     stackDefaultProps.put("core-site", coreSiteDefault);
 
+    Map<String, String> dummySiteDefaults =
+      new HashMap<String, String>();
+    dummySiteDefaults.put("dummy.prop", "dummyValue");
+    stackDefaultProps.put("dummy-site", dummySiteDefaults);
+
     Map<String, Map<String, Map<String, String>>> stackDefaultAttributes
=
       new HashMap<String, Map<String, Map<String, String>>>();
     return new Configuration(stackDefaultProps, stackDefaultAttributes);


Mime
View raw message