Repository: ambari
Updated Branches:
  refs/heads/trunk 42ac63163 -> 2ef578f3c


AMBARI-11665. AMS : IllegalArgumentException populating metrics for host with 
no cluster association. (swagle)


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

Branch: refs/heads/trunk
Commit: 2ef578f3c67041ca51b89a71461a830427efead8
Parents: 42ac631
Author: Siddharth Wagle <swa...@hortonworks.com>
Authored: Wed Jun 3 12:25:12 2015 -0700
Committer: Siddharth Wagle <swa...@hortonworks.com>
Committed: Wed Jun 3 12:43:07 2015 -0700

----------------------------------------------------------------------
 .../controller/metrics/timeline/AMSPropertyProvider.java       | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ef578f3/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
index d7d4c0a..43cf858 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
@@ -503,6 +503,12 @@ public abstract class AMSPropertyProvider extends 
MetricsPropertyProvider {
 
     for (Resource resource : resources) {
       String clusterName = (String) 
resource.getPropertyValue(clusterNamePropertyId);
+      // If a resource is not part of a cluster, do not return metrics since
+      // we cannot decide which collector to reach
+      if (StringUtils.isEmpty(clusterName)) {
+        continue;
+      }
+
       Map<TemporalInfo, MetricsRequest> requests = requestMap.get(clusterName);
       if (requests == null) {
         requests = new HashMap<TemporalInfo, MetricsRequest>();

Reply via email to