Repository: oozie Updated Branches: refs/heads/master 758973f66 -> 24f2b7cc6
OOZIE-2065 Oozie returns incorrect total action for coord dryrun Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/24f2b7cc Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/24f2b7cc Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/24f2b7cc Branch: refs/heads/master Commit: 24f2b7cc6b45a9559590b7a5f445ab7c63d12fe5 Parents: 758973f Author: Purshotam Shah <[email protected]> Authored: Wed Nov 26 12:00:43 2014 -0800 Committer: Purshotam Shah <[email protected]> Committed: Wed Nov 26 12:00:43 2014 -0800 ---------------------------------------------------------------------- .../command/coord/CoordSubmitXCommand.java | 8 ++--- .../command/coord/TestCoordSubmitXCommand.java | 34 ++++++++++++++++++++ release-log.txt | 1 + 3 files changed, 39 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/24f2b7cc/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java index 0843f28..8c3db6d 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java @@ -292,8 +292,8 @@ public class CoordSubmitXCommand extends SubmitTransitionXCommand { * @throws Exception the exception */ protected String getDryRun(CoordinatorJobBean coordJob) throws Exception{ - int materializationWindow = ConfigurationService.getInt(conf, CoordMaterializeTriggerService - .CONF_MATERIALIZATION_WINDOW); + int materializationWindow = ConfigurationService + .getInt(CoordMaterializeTriggerService.CONF_MATERIALIZATION_WINDOW); Date startTime = coordJob.getStartTime(); long startTimeMilli = startTime.getTime(); long endTimeMilli = startTimeMilli + (materializationWindow * 1000); @@ -324,8 +324,8 @@ public class CoordSubmitXCommand extends SubmitTransitionXCommand { * Queue MaterializeTransitionXCommand */ protected void queueMaterializeTransitionXCommand(String jobId) { - int materializationWindow = ConfigurationService.getInt(conf, CoordMaterializeTriggerService - .CONF_MATERIALIZATION_WINDOW); + int materializationWindow = ConfigurationService + .getInt(CoordMaterializeTriggerService.CONF_MATERIALIZATION_WINDOW); queue(new CoordMaterializeTransitionXCommand(jobId, materializationWindow), 100); } http://git-wip-us.apache.org/repos/asf/oozie/blob/24f2b7cc/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java b/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java index de32aa5..5ce9a7f 100644 --- a/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java @@ -101,6 +101,40 @@ public class TestCoordSubmitXCommand extends XDataTestCase { } + public void testBasicSubmitWithDryRun() throws Exception { + Configuration conf = new XConfiguration(); + File appPathFile = new File(getTestCaseDir(), "coordinator.xml"); + String appXml = "<coordinator-app name=\"${appName}-foo\" frequency=\"${coord:days(1)}\" start=\"2009-02-01T01:00Z\" " + + "end=\"2009-02-03T23:59Z\" timezone=\"UTC\" " + + "xmlns=\"uri:oozie:coordinator:0.2\"> <controls> " + + "<execution>LIFO</execution> </controls> <datasets> " + + "<dataset name=\"a\" frequency=\"${coord:days(7)}\" initial-instance=\"2009-02-01T01:00Z\" " + + "timezone=\"UTC\"> <uri-template>" + + getTestCaseFileUri("coord/workflows/${YEAR}/${DAY}") + + "</uri-template> </dataset> " + + "<dataset name=\"local_a\" frequency=\"${coord:days(7)}\" initial-instance=\"2009-02-01T01:00Z\" " + + "timezone=\"UTC\"> <uri-template>" + + getTestCaseFileUri("coord/workflows/${YEAR}/${DAY}") + + "</uri-template> </dataset> " + + "</datasets> <input-events> " + + "<data-in name=\"A\" dataset=\"a\"> <instance>${coord:latest(0)}</instance> </data-in> " + + "</input-events> " + + "<output-events> <data-out name=\"LOCAL_A\" dataset=\"local_a\"> " + + "<instance>${coord:current(-1)}</instance> </data-out> </output-events> <action> <workflow> <app-path>" + + "hdfs:///tmp/workflows/</app-path> " + + "<configuration> <property> <name>inputA</name> <value>${coord:dataIn('A')}</value> </property> " + + "<property> <name>inputB</name> <value>${coord:dataOut('LOCAL_A')}</value> " + + "</property></configuration> </workflow> </action> </coordinator-app>"; + writeToFile(appXml, appPathFile); + conf.set(OozieClient.COORDINATOR_APP_PATH, appPathFile.toURI().toString()); + conf.set(OozieClient.USER_NAME, getTestUser()); + conf.set("appName", "var-app-name"); + CoordSubmitXCommand sc = new CoordSubmitXCommand(true, conf); + String dryrunStr = sc.call(); + String[] actions = dryrunStr.split("action for new instance"); + assertEquals(actions.length, 2); + } + public void testBasicSubmitWithStartTimeAfterEndTime() throws Exception { Configuration conf = new XConfiguration(); File appPathFile = new File(getTestCaseDir(), "coordinator.xml"); http://git-wip-us.apache.org/repos/asf/oozie/blob/24f2b7cc/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 7b1dad5..4b5b050 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.2.0 release (trunk - unreleased) +OOZIE-2065 Oozie returns incorrect total action for coord dryrun (puru) OOZIE-2069 RecoveryService reads incorrect configuration (puru) OOZIE-2074 Compatibility issue with Yarn and Hadoop 0.23/2.x (jaydeepvishwakarma via shwethags) OOZIE-1983 Add spark action executor (pavan kumar via rkanter)
