You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by ro...@apache.org on 2014/05/27 19:45:06 UTC

git commit: OOZIE-1819 Avoid early queueing of CoordActionInputCheckXCommand (shwethags via rohini)

Repository: oozie
Updated Branches:
  refs/heads/master b9c3e0b0c -> 252300c62


OOZIE-1819 Avoid early queueing of CoordActionInputCheckXCommand (shwethags via rohini)


Project: http://git-wip-us.apache.org/repos/asf/oozie/repo
Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/252300c6
Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/252300c6
Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/252300c6

Branch: refs/heads/master
Commit: 252300c62c0a0f5d4efb483fbc0fdb135dd27469
Parents: b9c3e0b
Author: Rohini Palaniswamy <ro...@yahoo-inc.com>
Authored: Tue May 27 10:45:00 2014 -0700
Committer: Rohini Palaniswamy <ro...@yahoo-inc.com>
Committed: Tue May 27 10:45:00 2014 -0700

----------------------------------------------------------------------
 .../CoordMaterializeTransitionXCommand.java     | 31 ++++++++++++--------
 release-log.txt                                 |  1 +
 2 files changed, 19 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/252300c6/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java
index 57cbb34..7b46ad6 100644
--- a/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java
+++ b/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java
@@ -17,13 +17,6 @@
  */
 package org.apache.oozie.command.coord;
 
-import java.io.IOException;
-import java.io.StringReader;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.oozie.AppType;
 import org.apache.oozie.CoordinatorActionBean;
@@ -39,8 +32,8 @@ import org.apache.oozie.command.MaterializeTransitionXCommand;
 import org.apache.oozie.command.PreconditionException;
 import org.apache.oozie.command.bundle.BundleStatusUpdateXCommand;
 import org.apache.oozie.coord.TimeUnit;
-import org.apache.oozie.executor.jpa.BatchQueryExecutor.UpdateEntry;
 import org.apache.oozie.executor.jpa.BatchQueryExecutor;
+import org.apache.oozie.executor.jpa.BatchQueryExecutor.UpdateEntry;
 import org.apache.oozie.executor.jpa.CoordActionsActiveCountJPAExecutor;
 import org.apache.oozie.executor.jpa.CoordJobQueryExecutor;
 import org.apache.oozie.executor.jpa.CoordJobQueryExecutor.CoordJobQuery;
@@ -50,11 +43,11 @@ import org.apache.oozie.service.EventHandlerService;
 import org.apache.oozie.service.JPAService;
 import org.apache.oozie.service.Service;
 import org.apache.oozie.service.Services;
+import org.apache.oozie.sla.SLAOperations;
 import org.apache.oozie.util.DateUtils;
 import org.apache.oozie.util.Instrumentation;
 import org.apache.oozie.util.LogUtils;
 import org.apache.oozie.util.ParamChecker;
-import org.apache.oozie.sla.SLAOperations;
 import org.apache.oozie.util.StatusUtils;
 import org.apache.oozie.util.XConfiguration;
 import org.apache.oozie.util.XmlUtils;
@@ -62,6 +55,13 @@ import org.apache.oozie.util.db.SLADbOperations;
 import org.jdom.Element;
 import org.jdom.JDOMException;
 
+import java.io.IOException;
+import java.io.StringReader;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
 /**
  * Materialize actions for specified start and end time for coordinator job.
  */
@@ -130,6 +130,15 @@ public class CoordMaterializeTransitionXCommand extends MaterializeTransitionXCo
                     if (EventHandlerService.isEnabled()) {
                         CoordinatorXCommand.generateEvent(coordAction, coordJob.getUser(), coordJob.getAppName(), null);
                     }
+
+                    // TODO: time 100s should be configurable
+                    queue(new CoordActionNotificationXCommand(coordAction), 100);
+
+                    //Delay for input check = (nominal time - now)
+                    long checkDelay = coordAction.getNominalTime().getTime() - new Date().getTime();
+                    queue(new CoordActionInputCheckXCommand(coordAction.getId(), coordAction.getJobId()),
+                        Math.max(checkDelay, 0));
+
                     if (coordAction.getPushMissingDependencies() != null) {
                         // TODO: Delay in catchup mode?
                         queue(new CoordPushDependencyCheckXCommand(coordAction.getId(), true), 100);
@@ -482,10 +491,6 @@ public class CoordMaterializeTransitionXCommand extends MaterializeTransitionXCo
 
         insertList.add(actionBean);
         writeActionSlaRegistration(actionXml, actionBean);
-
-        // TODO: time 100s should be configurable
-        queue(new CoordActionNotificationXCommand(actionBean), 100);
-        queue(new CoordActionInputCheckXCommand(actionBean.getId(), actionBean.getJobId()), 100);
     }
 
     private void writeActionSlaRegistration(String actionXml, CoordinatorActionBean actionBean) throws Exception {

http://git-wip-us.apache.org/repos/asf/oozie/blob/252300c6/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 81e26ef..8769744 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 4.1.0 release (trunk - unreleased)
 
+OOZIE-1819 Avoid early queueing of CoordActionInputCheckXCommand (shwethags via rohini)
 OOZIE-1783 Sharelib purging only occurs at Oozie startup (rkanter)
 OOZIE-1689 HA support for OOZIE-7(Ability to view the log information corresponding to particular coordinator action) (puru via mona)
 OOZIE-1849 If the underlying job finishes while a Workflow is suspended, Oozie can take a while to realize it (rkanter)