You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/05/28 23:24:42 UTC

ambari git commit: AMBARI-11505. Add logging to ClusterImpl.java processServiceComponentHostEvents() (alejandro)

Repository: ambari
Updated Branches:
  refs/heads/trunk ce429e750 -> 46e2d3e12


AMBARI-11505. Add logging to ClusterImpl.java processServiceComponentHostEvents() (alejandro)


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

Branch: refs/heads/trunk
Commit: 46e2d3e129d6876d3706fa234a3aebfc2c38c9e5
Parents: ce429e7
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu May 28 12:25:24 2015 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Thu May 28 14:24:33 2015 -0700

----------------------------------------------------------------------
 .../server/actionmanager/ActionScheduler.java    |  5 ++++-
 .../ambari/server/state/cluster/ClusterImpl.java | 19 +++++++++++++++++--
 .../svccomphost/ServiceComponentHostImpl.java    |  2 +-
 3 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46e2d3e1/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index 4f51fbc..8ccf622 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
@@ -342,7 +342,10 @@ class ActionScheduler implements Runnable {
           if (cluster != null) {
             List<ServiceComponentHostEvent> failedEvents =
               cluster.processServiceComponentHostEvents(eventMap);
-            LOG.debug("==> {} events failed.", failedEvents.size());
+
+            if (failedEvents.size() > 0) {
+              LOG.error("==> {} events failed.", failedEvents.size());
+            }
 
             for (Iterator<ExecutionCommand> iterator = commandsToUpdate.iterator(); iterator.hasNext(); ) {
               ExecutionCommand cmd = iterator.next();

http://git-wip-us.apache.org/repos/asf/ambari/blob/46e2d3e1/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 0d1bccd..2e45adc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -43,6 +43,7 @@ import org.apache.ambari.server.DuplicateResourceException;
 import org.apache.ambari.server.ObjectNotFoundException;
 import org.apache.ambari.server.ParentObjectNotFoundException;
 import org.apache.ambari.server.ServiceComponentHostNotFoundException;
+import org.apache.ambari.server.ServiceComponentNotFoundException;
 import org.apache.ambari.server.ServiceNotFoundException;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
@@ -2454,8 +2455,24 @@ public class ClusterImpl implements Cluster {
           ServiceComponent serviceComponent = service.getServiceComponent(event.getServiceComponentName());
           ServiceComponentHost serviceComponentHost = serviceComponent.getServiceComponentHost(event.getHostName());
           serviceComponentHost.handleEvent(event);
+        } catch (ServiceNotFoundException e) {
+          LOG.error(String.format("ServiceComponentHost lookup exception. Service not found for Service: %s. Error: %s",
+              serviceName, e.getMessage()));
+          e.printStackTrace();
+          failedEvents.add(event);
+        } catch (ServiceComponentNotFoundException e) {
+          LOG.error(String.format("ServiceComponentHost lookup exception. Service Component not found for Service: %s, Component: %s. Error: %s",
+              serviceName, event.getServiceComponentName(), e.getMessage()));
+          e.printStackTrace();
+          failedEvents.add(event);
+        } catch (ServiceComponentHostNotFoundException e) {
+          LOG.error(String.format("ServiceComponentHost lookup exception. Service Component Host not found for Service: %s, Component: %s, Host: %s. Error: %s",
+              serviceName, event.getServiceComponentName(), event.getHostName(), e.getMessage()));
+          e.printStackTrace();
+          failedEvents.add(event);
         } catch (AmbariException e) {
           LOG.error("ServiceComponentHost lookup exception ", e.getMessage());
+          e.printStackTrace();
           failedEvents.add(event);
         } catch (InvalidStateTransitionException e) {
           LOG.error("Invalid transition ", e);
@@ -2466,8 +2483,6 @@ public class ClusterImpl implements Cluster {
           } else {
             failedEvents.add(event);
           }
-
-
         }
       }
     } finally {

http://git-wip-us.apache.org/repos/asf/ambari/blob/46e2d3e1/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index f6aea66..c439955 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -901,7 +901,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
           saveIfPersisted();
           // TODO Audit logs
         } catch (InvalidStateTransitionException e) {
-          LOG.debug("Can't handle ServiceComponentHostEvent event at"
+          LOG.error("Can't handle ServiceComponentHostEvent event at"
               + " current state"
               + ", serviceComponentName=" + getServiceComponentName()
               + ", hostName=" + getHostName()