You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2017/03/31 12:53:18 UTC
ambari git commit: AMBARI-20628. Ambari doesn't set properties
correctly (magyari_sandor)
Repository: ambari
Updated Branches:
refs/heads/trunk f37a342a0 -> 9741236f3
AMBARI-20628. Ambari doesn't set properties correctly (magyari_sandor)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9741236f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9741236f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9741236f
Branch: refs/heads/trunk
Commit: 9741236f3c8b4a8a293fa0b7db5c64c0e7aa704d
Parents: f37a342
Author: Sandor Magyari <sm...@hortonworks.com>
Authored: Thu Mar 30 12:04:19 2017 +0200
Committer: Sandor Magyari <sm...@hortonworks.com>
Committed: Fri Mar 31 14:52:03 2017 +0200
----------------------------------------------------------------------
.../stackadvisor/StackAdvisorBlueprintProcessor.java | 8 ++++++--
.../stackadvisor/StackAdvisorBlueprintProcessorTest.java | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9741236f/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java
index 0abcc14..b7eca71 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java
@@ -175,7 +175,11 @@ public class StackAdvisorBlueprintProcessor {
Preconditions.checkArgument(response.getRecommendations().getBlueprint().getConfigurations() != null,
"Configurations are missing from the recommendation blueprint response.");
- Map<String, Map<String, String>> userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations);
+ Map<String, Map<String, String>> userProvidedProperties = existingConfigurations;
+ if (topology.getConfigRecommendationStrategy() == ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY) {
+ userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations);
+ }
+
Map<String, BlueprintConfigurations> recommendedConfigurations =
response.getRecommendations().getBlueprint().getConfigurations();
for (Map.Entry<String, BlueprintConfigurations> configEntry : recommendedConfigurations.entrySet()) {
@@ -183,7 +187,7 @@ public class StackAdvisorBlueprintProcessor {
BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(),
userProvidedProperties, topology);
topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration(
- blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes()));
+ blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes()));
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/9741236f/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java
index 49f070a..3febd48 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java
@@ -114,7 +114,7 @@ public class StackAdvisorBlueprintProcessorTest {
expect(clusterTopology.getAdvisedConfigurations()).andReturn(advisedConfigurations).anyTimes();
expect(clusterTopology.getConfiguration()).andReturn(configuration).anyTimes();
expect(clusterTopology.isClusterKerberosEnabled()).andReturn(false).anyTimes();
- expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY);
+ expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY).anyTimes();
expect(blueprint.getStack()).andReturn(stack).anyTimes();
expect(stack.getVersion()).andReturn("2.3").anyTimes();
expect(stack.getName()).andReturn("HDP").anyTimes();
@@ -149,7 +149,7 @@ public class StackAdvisorBlueprintProcessorTest {
expect(clusterTopology.getAdvisedConfigurations()).andReturn(advisedConfigurations).anyTimes();
expect(clusterTopology.getConfiguration()).andReturn(configuration).anyTimes();
expect(clusterTopology.isClusterKerberosEnabled()).andReturn(false).anyTimes();
- expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY);
+ expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY).anyTimes();
expect(blueprint.getStack()).andReturn(stack).anyTimes();
expect(stack.getVersion()).andReturn("2.3").anyTimes();
expect(stack.getName()).andReturn("HDP").anyTimes();