Repository: ambari Updated Branches: refs/heads/trunk ac40623a4 -> 625768266
AMBARI-18005. Clean cached resources on host removal (part2). (Laszlo Puskas via stoader Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/62576826 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/62576826 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/62576826 Branch: refs/heads/trunk Commit: 6257682660ff1f3979b388c83d49d327b24989b2 Parents: ac40623 Author: Laszlo Puskas <lpus...@hortonworks.com> Authored: Mon Aug 8 13:56:15 2016 +0200 Committer: Toader, Sebastian <stoa...@hortonworks.com> Committed: Mon Aug 8 13:56:19 2016 +0200 ---------------------------------------------------------------------- .../org/apache/ambari/server/topology/TopologyManager.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/62576826/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java index 9a6ee94..b3e3941 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java @@ -977,8 +977,13 @@ public class TopologyManager { */ @Subscribe public void processHostRemovedEvent(HostRemovedEvent hostRemovedEvent) { - LOG.info("Cleaning up caches on host removed event: {}", hostRemovedEvent.getHostName()); + if (null == hostRemovedEvent.getHostName()) { + LOG.warn("Missing host name from host removed event [{}] !", hostRemovedEvent); + return; + } + + LOG.info("Removing host [{}] from available hosts on host removed event.", hostRemovedEvent.getHostName()); HostImpl toBeRemoved = null; // synchronization is required here as the list may be modified concurrently. See comments in this whole class. @@ -994,7 +999,7 @@ public class TopologyManager { availableHosts.remove(toBeRemoved); LOG.info("Removed host: [{}] from available hosts", toBeRemoved.getHostName()); } else { - LOG.info("Host [{}] not found in available hosts", toBeRemoved.getHostName()); + LOG.debug("Host [{}] not found in available hosts", hostRemovedEvent.getHostName()); } } }