Repository: ambari Updated Branches: refs/heads/branch-2.2 78eafc7b4 -> 979b02c68
AMBARI-15620 - Orphaned Host Alerts Cause Stale Alert Notifications After Removing Hosts (part2) (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/979b02c6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/979b02c6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/979b02c6 Branch: refs/heads/branch-2.2 Commit: 979b02c685f9707509cf2fcbd8c3588d4e39749e Parents: 78eafc7 Author: Jonathan Hurley <[email protected]> Authored: Thu Mar 31 10:44:04 2016 -0400 Committer: Jonathan Hurley <[email protected]> Committed: Thu Mar 31 10:48:21 2016 -0400 ---------------------------------------------------------------------- .../ambari/server/state/cluster/ClustersImpl.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/979b02c6/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java index 68b125f..c5554f7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java @@ -386,16 +386,11 @@ public class ClustersImpl implements Clusters { public boolean isHostMappedToCluster(String clusterName, String hostName) { checkLoaded(); - r.lock(); - try { - Set<Cluster> clusters = hostClusterMap.get(hostName); - for (Cluster cluster : clusters) { - if (clusterName.equals(cluster.getClusterName())) { - return true; - } + Set<Cluster> clusters = hostClusterMap.get(hostName); + for (Cluster cluster : clusters) { + if (clusterName.equals(cluster.getClusterName())) { + return true; } - } finally { - r.unlock(); } return false;
