You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2017/09/08 15:28:07 UTC
ambari git commit: AMBARI-21173. Not able to start Yarn services
after restoring the configs to initial value.(vbrodetskyi)
Repository: ambari
Updated Branches:
refs/heads/branch-2.6 b238b367e -> d2bc398ca
AMBARI-21173. Not able to start Yarn services after restoring the configs to initial value.(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d2bc398c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d2bc398c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d2bc398c
Branch: refs/heads/branch-2.6
Commit: d2bc398caf9ce9e8637397681685bc90dd1fe1b3
Parents: b238b36
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Fri Aug 11 03:03:55 2017 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Fri Sep 8 17:40:03 2017 +0300
----------------------------------------------------------------------
.../org/apache/ambari/server/state/cluster/ClusterImpl.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d2bc398c/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 68e557a..b152928 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
@@ -1819,12 +1819,18 @@ public class ClusterImpl implements Cluster {
if (serviceConfigEntity.getGroupId() == null) {
Collection<String> configTypes = serviceConfigTypes.get(serviceName);
List<ClusterConfigEntity> enabledConfigs = clusterDAO.getEnabledConfigsByTypes(clusterId, configTypes);
+ List<ClusterConfigEntity> serviceConfigEntities = serviceConfigEntity.getClusterConfigEntities();
+ ArrayList<ClusterConfigEntity> duplicatevalues = new ArrayList<ClusterConfigEntity>(serviceConfigEntities);
+ duplicatevalues.retainAll(enabledConfigs);
+ enabledConfigs.removeAll(duplicatevalues);
+ serviceConfigEntities.removeAll(duplicatevalues);
+
for (ClusterConfigEntity enabledConfig : enabledConfigs) {
enabledConfig.setSelected(false);
clusterDAO.merge(enabledConfig);
}
- for (ClusterConfigEntity configEntity : serviceConfigEntity.getClusterConfigEntities()) {
+ for (ClusterConfigEntity configEntity : serviceConfigEntities) {
configEntity.setSelected(true);
clusterDAO.merge(configEntity);
}