You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2016/03/17 22:02:43 UTC
ambari git commit: AMBARI-15442. StackAdvisor needs to set config map
for ams-grafana-env to meet non-null expectations (rlevas)
Repository: ambari
Updated Branches:
refs/heads/trunk 201961a4a -> 5291228c3
AMBARI-15442. StackAdvisor needs to set config map for ams-grafana-env to meet non-null expectations (rlevas)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5291228c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5291228c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5291228c
Branch: refs/heads/trunk
Commit: 5291228c30e17eed6e7b7fdc67bf8907e9a8f632
Parents: 201961a
Author: Robert Levas <rl...@hortonworks.com>
Authored: Thu Mar 17 17:02:35 2016 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Thu Mar 17 17:02:35 2016 -0400
----------------------------------------------------------------------
.../recommendations/RecommendationResponse.java | 16 +++++++++++++---
.../stacks/HDP/2.0.6/services/stack_advisor.py | 1 +
.../python/stacks/2.2/common/test_stack_advisor.py | 1 +
3 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/5291228c/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/recommendations/RecommendationResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/recommendations/RecommendationResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/recommendations/RecommendationResponse.java
index 4a66677..a1253d8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/recommendations/RecommendationResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/recommendations/RecommendationResponse.java
@@ -128,11 +128,11 @@ public class RecommendationResponse extends StackAdvisorResponse {
public static class BlueprintConfigurations {
@JsonProperty
- private Map<String, String> properties;
+ private final Map<String, String> properties = new HashMap<String, String>();
@JsonProperty("property_attributes")
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
- private Map<String, ValueAttributesInfo> propertyAttributes;
+ private Map<String, ValueAttributesInfo> propertyAttributes = null;
public BlueprintConfigurations() {
@@ -142,8 +142,18 @@ public class RecommendationResponse extends StackAdvisorResponse {
return properties;
}
+ /**
+ * Returns a map of properties for this configuration.
+ * <p/>
+ * It is expected that a non-null value is always returned.
+ *
+ * @param properties a map of properties, always non-null
+ */
public void setProperties(Map<String, String> properties) {
- this.properties = properties;
+ this.properties.clear();
+ if(properties != null) {
+ this.properties.putAll(properties);
+ }
}
public Map<String, ValueAttributesInfo> getPropertyAttributes() {
http://git-wip-us.apache.org/repos/asf/ambari/blob/5291228c/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 425ff76..fa1a0d8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -509,6 +509,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
putAmsHbaseSiteProperty = self.putProperty(configurations, "ams-hbase-site", services)
putAmsSiteProperty = self.putProperty(configurations, "ams-site", services)
putHbaseEnvProperty = self.putProperty(configurations, "ams-hbase-env", services)
+ putGrafanaProperty = self.putProperty(configurations, "ams-grafana-env", services)
putGrafanaPropertyAttribute = self.putPropertyAttribute(configurations, "ams-grafana-env")
amsCollectorHosts = self.getComponentHostNames(services, "AMBARI_METRICS", "METRICS_COLLECTOR")
http://git-wip-us.apache.org/repos/asf/ambari/blob/5291228c/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index 59eff4d..921ee23 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -2039,6 +2039,7 @@ class TestHDP22StackAdvisor(TestCase):
}
},
"ams-grafana-env": {
+ "properties" : {},
"property_attributes": {
"metrics_grafana_password": {
"visible": "false"