Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C479C200C6B for ; Tue, 28 Mar 2017 00:57:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C3358160BAD; Mon, 27 Mar 2017 22:57:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 72DAB160BA9 for ; Tue, 28 Mar 2017 00:57:13 +0200 (CEST) Received: (qmail 25053 invoked by uid 500); 27 Mar 2017 22:57:12 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 23613 invoked by uid 99); 27 Mar 2017 22:57:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Mar 2017 22:57:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BAC38DFDCD; Mon, 27 Mar 2017 22:57:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rzang@apache.org To: commits@ambari.apache.org Date: Mon, 27 Mar 2017 22:57:45 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [35/51] [abbrv] ambari git commit: AMBARI-19679. Dangling config-group hostmapping entries result in partial loading of config groups. (swagle) archived-at: Mon, 27 Mar 2017 22:57:14 -0000 AMBARI-19679. Dangling config-group hostmapping entries result in partial loading of config groups. (swagle) Change-Id: Ie98d588d57d9bbd7226d3ba9142f364d3b3597db Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b5a47c43 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b5a47c43 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b5a47c43 Branch: refs/heads/AMBARI-2.4.2.16 Commit: b5a47c4373585d2a014f11ed65c744422f3b27ba Parents: 82d48aa Author: Siddharth Wagle Authored: Mon Jan 23 10:37:08 2017 -0800 Committer: Siddharth Wagle Committed: Wed Mar 1 12:14:37 2017 -0800 ---------------------------------------------------------------------- .../server/state/configgroup/ConfigGroupImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b5a47c43/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java index ccca9fc..19b1be1 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java @@ -125,8 +125,7 @@ public class ConfigGroupImpl implements ConfigGroup { hosts = new HashMap(); // Populate configs - for (ConfigGroupConfigMappingEntity configMappingEntity : configGroupEntity - .getConfigGroupConfigMappingEntities()) { + for (ConfigGroupConfigMappingEntity configMappingEntity : configGroupEntity.getConfigGroupConfigMappingEntities()) { Config config = cluster.getConfig(configMappingEntity.getConfigType(), configMappingEntity.getVersionTag()); @@ -142,8 +141,7 @@ public class ConfigGroupImpl implements ConfigGroup { } // Populate Hosts - for (ConfigGroupHostMappingEntity hostMappingEntity : configGroupEntity - .getConfigGroupHostMappingEntities()) { + for (ConfigGroupHostMappingEntity hostMappingEntity : configGroupEntity.getConfigGroupHostMappingEntities()) { try { Host host = clusters.getHost(hostMappingEntity.getHostname()); @@ -151,9 +149,10 @@ public class ConfigGroupImpl implements ConfigGroup { if (host != null && hostEntity != null) { hosts.put(hostEntity.getHostId(), host); } - } catch (AmbariException e) { - String msg = "Host seems to be deleted but Config group mapping still " + - "exists !"; + } catch (Exception e) { + String msg = String.format("Host %s seems to be deleted but Config " + + "group %s mapping still exists !", hostMappingEntity.getHostname(), + configGroupEntity.getGroupName()); LOG.warn(msg); LOG.debug(msg, e); }