falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: FALCON-1754 JobCompletionService throws FalconException (By Pallavi Rao)
Date Fri, 22 Jan 2016 12:44:13 GMT
Repository: falcon
Updated Branches:
  refs/heads/master a86ddb0bd -> 46ecceba8


FALCON-1754 JobCompletionService throws FalconException (By Pallavi Rao)


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

Branch: refs/heads/master
Commit: 46ecceba8df7fc480177c426c39ff0bb110aa010
Parents: a86ddb0
Author: Pallavi Rao <pallavi.rao@inmobi.com>
Authored: Fri Jan 22 18:13:48 2016 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Fri Jan 22 18:13:48 2016 +0530

----------------------------------------------------------------------
 CHANGES.txt                                                 | 2 ++
 .../org/apache/falcon/execution/FalconExecutionService.java | 6 ++++--
 .../notification/service/impl/JobCompletionService.java     | 9 ++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/46ecceba/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 54ab9b7..a86633f 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -120,6 +120,8 @@ Proposed Release Version: 0.9
   OPTIMIZATIONS
 
   BUG FIXES
+    FALCON-1754 JobCompletionService throws FalconException (Pallavi Rao)
+
     FALCON-1716 API fails with CommunicationsException when mysql interaction time is longer
than 53,434,939 milliseconds (Pavan Kolamuri via Pallavi Rao)
 
     FALCON-1757 EntityNotRegisteredException when entity is deleted from falcon (Pavan Kolamuri
via Pallavi Rao)

http://git-wip-us.apache.org/repos/asf/falcon/blob/46ecceba/scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java
----------------------------------------------------------------------
diff --git a/scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java
b/scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java
index 7bdcd6f..da1d7cc 100644
--- a/scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java
+++ b/scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java
@@ -19,6 +19,7 @@
 package org.apache.falcon.execution;
 
 import org.apache.falcon.FalconException;
+import org.apache.falcon.entity.EntityNotRegisteredException;
 import org.apache.falcon.entity.EntityUtil;
 import org.apache.falcon.entity.v0.Entity;
 import org.apache.falcon.entity.v0.process.Process;
@@ -125,8 +126,9 @@ public final class FalconExecutionService implements FalconService, EntityStateC
         if (id != null) {
             EntityExecutor executor = executors.get(id);
             if (executor == null) {
-                // The executor has gone away, throw an exception so the notification service
knows
-                throw new FalconException("Target executor for " + event.getTarget() + "
does not exist.");
+                // The executor has gone away or entity was not scheduled on native scheduler,
+                // throw an exception so the notification service knows.
+                throw new EntityNotRegisteredException("Target executor for " + event.getTarget()
+ " does not exist.");
             }
             executor.onEvent(event);
         }

http://git-wip-us.apache.org/repos/asf/falcon/blob/46ecceba/scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java
----------------------------------------------------------------------
diff --git a/scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java
b/scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java
index 4278d3f..cfebf1c 100644
--- a/scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java
+++ b/scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java
@@ -21,6 +21,7 @@ import java.util.Comparator;
 import java.util.TreeSet;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.falcon.FalconException;
+import org.apache.falcon.entity.EntityNotRegisteredException;
 import org.apache.falcon.entity.EntityUtil;
 import org.apache.falcon.entity.v0.EntityType;
 import org.apache.falcon.exception.NotificationServiceException;
@@ -153,7 +154,13 @@ public class JobCompletionService implements FalconNotificationService,
Workflow
             while(iterator.hasNext()) {
                 NotificationHandler handler = iterator.next();
                 LOG.debug("Notifying {} with event {}", handler, event.getTarget());
-                handler.onEvent(event);
+                try {
+                    handler.onEvent(event);
+                } catch (EntityNotRegisteredException ee) {
+                    // Do nothing if entity no longer exists.
+                } catch (FalconException e) {
+                    LOG.error("Handler threw an exception for target " + event.getTarget(),
e);
+                }
             }
         }
     }


Mime
View raw message