You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2016/02/11 19:35:42 UTC

[1/2] ambari git commit: AMBARI-14988: DB consistency - Add consistency check on clusterconfigmapping in ClusterImpl::getDesiredConfigs() for NPE.

Repository: ambari
Updated Branches:
  refs/heads/trunk 2871d674f -> 966f3031d


AMBARI-14988: DB consistency - Add consistency check on clusterconfigmapping in ClusterImpl::getDesiredConfigs() for NPE.


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

Branch: refs/heads/trunk
Commit: 966f3031d50b0106dfe5d19abbdd1e3b84d1f059
Parents: f247ddc
Author: Nahappan Somasundaram <ns...@hortonworks.com>
Authored: Wed Feb 10 13:10:28 2016 -0800
Committer: Nahappan Somasundaram <ns...@hortonworks.com>
Committed: Thu Feb 11 10:35:00 2016 -0800

----------------------------------------------------------------------
 .../apache/ambari/server/state/cluster/ClusterImpl.java | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/966f3031/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 50e02a5..57941d0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -2267,7 +2267,17 @@ public class ClusterImpl implements Cluster {
                 " unknown configType=" + e.getType());
             continue;
           }
-          c.setVersion(allConfigs.get(e.getType()).get(e.getTag()).getVersion());
+
+          Map<String, Config> configMap = allConfigs.get(e.getType());
+          if(!configMap.containsKey(e.getTag())) {
+            LOG.debug("Config inconsistency exists for typeName=" +
+                    e.getType() +
+                    ", unknown versionTag=" + e.getTag());
+            continue;
+          }
+
+          Config config = configMap.get(e.getTag());
+          c.setVersion(config.getVersion());
 
           Set<DesiredConfig> configs = map.get(e.getType());
           if (configs == null) {


[2/2] ambari git commit: AMBARI-14998: Server 500 error on trying to extract a blueprint for all clusters

Posted by sm...@apache.org.
AMBARI-14998: Server 500 error on trying to extract a blueprint for all clusters


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

Branch: refs/heads/trunk
Commit: f247ddcfa6c7cc48508cbcfa1e681169dce3b495
Parents: 2871d67
Author: Nahappan Somasundaram <ns...@hortonworks.com>
Authored: Wed Feb 10 14:41:12 2016 -0800
Committer: Nahappan Somasundaram <ns...@hortonworks.com>
Committed: Thu Feb 11 10:35:00 2016 -0800

----------------------------------------------------------------------
 .../server/controller/AmbariManagementControllerImpl.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f247ddcf/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 69b3348..0b26f61 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -1018,7 +1018,11 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
 //       If the user is authorized to view information about this cluster, add it to the response
 //       if (AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, c.getResourceId(),
 //        RoleAuthorization.AUTHORIZATIONS_VIEW_CLUSTER)) {
-      response.add(c.convertToResponse());
+      ClusterResponse cr = c.convertToResponse();
+      cr.setDesiredConfigs(c.getDesiredConfigs());
+      cr.setDesiredServiceConfigVersions(c.getActiveServiceConfigVersions());
+      cr.setCredentialStoreServiceProperties(getCredentialStoreServiceProperties());
+      response.add(cr);
 //       }
     }
     StringBuilder builder = new StringBuilder();