ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [35/50] [abbrv] ambari git commit: AMBARI-14397. Cluster deployment with exported blueprint with stack advisor enabled doesn't work (Oliver Szabo via smohanty)
Date Fri, 08 Jan 2016 18:15:52 GMT
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/134e5343
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/134e5343
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/134e5343

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 134e5343ea09962ef64aa6e682b0608715050243
Parents: a3a0c15
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:09 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/134e5343/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 6bd0a80..f8221b5 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
@@ -467,8 +467,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/134e5343/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 3bfebc2..0384b45 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
@@ -5496,6 +5496,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>();
@@ -5527,7 +5531,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"));
@@ -5535,6 +5539,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
@@ -5551,6 +5556,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>();
@@ -5579,7 +5588,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"));
@@ -5587,7 +5596,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
@@ -6324,6 +6334,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;
   }
 
@@ -6353,6 +6366,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