ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbeerbo...@apache.org
Subject git commit: AMBARI-6245 - Ambari-server log is full of ServiceComponentHostNotFoundException
Date Tue, 24 Jun 2014 09:19:48 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 f759dfe06 -> 9643d12e9


AMBARI-6245 - Ambari-server log is full of ServiceComponentHostNotFoundException


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

Branch: refs/heads/branch-1.6.1
Commit: 9643d12e995a93e7ef7bced9bf5950e6c2f97c88
Parents: f759dfe
Author: tbeerbower <tbeerbower@hortonworks.com>
Authored: Tue Jun 24 05:19:22 2014 -0400
Committer: tbeerbower <tbeerbower@hortonworks.com>
Committed: Tue Jun 24 05:19:22 2014 -0400

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java           | 18 +++++++++++-------
 .../internal/ClusterControllerImpl.java           |  4 ++--
 2 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9643d12e/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 63714e3..28aaecb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -857,15 +857,19 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
             r.setMaintenanceState(maintenanceStateHelper.getEffectiveState(sch, host).name());
             response.add(r);
           } catch (ServiceComponentHostNotFoundException e) {
-            if (request.getServiceName() != null && request.getComponentName() !=
null) {
-              LOG.error("ServiceComponentHost not found ", e);
+            if (request.getServiceName() == null || request.getComponentName() == null) {
+              // Ignore the exception if either the service name or component name are not
specified.
+              // This is an artifact of how we get host_components and can happen in the
case where
+              // we get all host_components for a host, for example.
+              LOG.debug("Ignoring not specified host_component ", e);
+
+            } else {
+              // Otherwise rethrow the exception and let the caller decide if it's an error
condition.
+              // Logging the exception as debug since this does not necessarily indicate
an error
+              // condition.
+              LOG.debug("ServiceComponentHost not found ", e);
               throw new ServiceComponentHostNotFoundException(cluster.getClusterName(),
                   request.getServiceName(), request.getComponentName(), request.getHostname());
-            } else {
-              LOG.debug("Ignoring not specified host_component ", e);
-              // ignore this since host_component was not specified
-              // this is an artifact of how we get host_components and can happen
-              // in case where we get all host_components for a host
             }
           }
         } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9643d12e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
index e511bd1..bf5229a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
@@ -142,8 +142,8 @@ public class ClusterControllerImpl implements ClusterController {
                                          Request request,
                                          Predicate predicate) throws SystemException {
     Set<Resource> keepers = resources;
-
-    for (PropertyProvider propertyProvider : propertyProviders.get(type)) {
+    List<PropertyProvider> propertyProviders = ensurePropertyProviders(type);
+    for (PropertyProvider propertyProvider : propertyProviders) {
       if (providesRequestProperties(propertyProvider, request, predicate)) {
         keepers = propertyProvider.populateResources(keepers, request, predicate);
       }


Mime
View raw message