ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jspei...@apache.org
Subject ambari git commit: AMBARI-8867. Ensure that bluepint deployment sets each config type on cluster no more than once
Date Mon, 22 Dec 2014 23:22:33 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c40a9dec2 -> 03463912a


AMBARI-8867.  Ensure that bluepint deployment sets each config type on cluster
              no more than once


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

Branch: refs/heads/trunk
Commit: 03463912a95bdddab9c78a120b1de75b34c03395
Parents: c40a9de
Author: John Speidel <jspeidel@hortonworks.com>
Authored: Mon Dec 22 16:34:22 2014 -0500
Committer: John Speidel <jspeidel@hortonworks.com>
Committed: Mon Dec 22 18:19:53 2014 -0500

----------------------------------------------------------------------
 .../internal/ClusterResourceProvider.java         | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/03463912/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
index f9aca1d..2d6ad8f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
@@ -815,17 +815,23 @@ public class ClusterResourceProvider extends BaseBlueprintProcessor
{
     // create a list of config requests on a per-service basis, in order
     // to properly support the new service configuration versioning mechanism
     // in Ambari
+    Collection<String> encounteredConfigTypes = new HashSet<String>();
     for (String service : getServicesToDeploy(stack, blueprintHostGroups)) {
       BlueprintServiceConfigRequest blueprintConfigRequest =
         new BlueprintServiceConfigRequest(service);
 
       for (String serviceConfigType : stack.getConfigurationTypes(service)) {
-        // skip handling of cluster-env here
-        if (!serviceConfigType.equals("cluster-env")) {
-          if (mapClusterConfigurations.containsKey(serviceConfigType)) {
-            blueprintConfigRequest.addConfigElement(serviceConfigType,
-              mapClusterConfigurations.get(serviceConfigType),
-              mapClusterAttributes.get(serviceConfigType));
+        //todo: This is a temporary fix to ensure that we don't try to add the same
+        //todo: config type multiple times.
+        //todo: This is to unblock BUG-28939 and will be correctly fixed as part of BUG-29145.
+        if (encounteredConfigTypes.add(serviceConfigType)) {
+          // skip handling of cluster-env here
+          if (!serviceConfigType.equals("cluster-env")) {
+            if (mapClusterConfigurations.containsKey(serviceConfigType)) {
+              blueprintConfigRequest.addConfigElement(serviceConfigType,
+                mapClusterConfigurations.get(serviceConfigType),
+                mapClusterAttributes.get(serviceConfigType));
+            }
           }
         }
       }


Mime
View raw message