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-1709 FIFO order is not followed when scheduled using native scheduler (Pallavi Rao)
Date Mon, 04 Jan 2016 09:10:27 GMT
Repository: falcon
Updated Branches:
  refs/heads/master c81db674d -> 20bacfa13


FALCON-1709 FIFO order is not followed when scheduled using native scheduler (Pallavi Rao)


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

Branch: refs/heads/master
Commit: 20bacfa134c7eb89b030dff22a5ba8aff0b4636b
Parents: c81db67
Author: Pallavi Rao <pallavi.rao@inmobi.com>
Authored: Mon Jan 4 14:40:08 2016 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Mon Jan 4 14:40:08 2016 +0530

----------------------------------------------------------------------
 CHANGES.txt                                               |  2 ++
 .../notification/service/impl/SchedulerService.java       | 10 ++++++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/20bacfa1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 018a6db..4adbdef 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -90,6 +90,8 @@ Trunk (Unreleased)
   OPTIMIZATIONS
 
   BUG FIXES
+    FALCON-1709 FIFO order is not followed when scheduled using native scheduler (Pallavi
Rao)
+
     FALCON-1711 DependencyInstance twiki does not contain correct documentation	(Praveen
Adlakha via Pallavi Rao)
 
     FALCON-1702 Exception thrown by workflow status listeners on success notification(Pallavi
Rao via Ajay Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/20bacfa1/scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java
----------------------------------------------------------------------
diff --git a/scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java
b/scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java
index 57a41c8..f5a7c86 100644
--- a/scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java
+++ b/scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java
@@ -101,6 +101,8 @@ public class SchedulerService implements FalconNotificationService, Notification
         if (obj != null) {
             instancesToIgnore.invalidate(request.getInstance().getId());
         }
+        LOG.debug("Received request to schedule instance {} with sequence {}.", request.getInstance().getId(),
+                request.getInstance().getInstanceSequence());
         runQueue.execute(new InstanceRunner(request));
     }
 
@@ -281,6 +283,10 @@ public class SchedulerService implements FalconNotificationService, Notification
             }
         }
 
+        public ExecutionInstance getInstance() {
+            return instance;
+        }
+
         @Override
         public void run() {
             try {
@@ -387,6 +393,10 @@ public class SchedulerService implements FalconNotificationService, Notification
     private static class PriorityComparator<T extends InstanceRunner> implements Comparator<T>,
Serializable {
         @Override
         public int compare(T o1, T o2) {
+            // If both instances have same priority, go by instance sequence.
+            if (o1.getPriority() == o2.getPriority()) {
+                return o1.getInstance().getInstanceSequence() - o2.getInstance().getInstanceSequence();
+            }
             return o1.getPriority() - o2.getPriority();
         }
     }


Mime
View raw message