Author: rohini
Date: Thu Jul 25 13:00:34 2013
New Revision: 1506948
URL: http://svn.apache.org/r1506948
Log:
OOZIE-1466 current EL should not check for less than or equal to zero (rohini)
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
oozie/trunk/release-log.txt
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java?rev=1506948&r1=1506947&r2=1506948&view=diff
==============================================================================
--- oozie/trunk/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
(original)
+++ oozie/trunk/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
Thu Jul 25 13:00:34 2013
@@ -524,8 +524,6 @@ public class CoordELFunctions {
* @throws Exception
*/
public static String ph2_coord_currentRange(int start, int end) throws
Exception {
- ParamChecker.checkLEZero(start, "current:n");
- ParamChecker.checkLEZero(end, "current:n");
if (isSyncDataSet()) { // For Sync Dataset
return coord_currentRange_sync(start, end);
}
Modified:
oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java?rev=1506948&r1=1506947&r2=1506948&view=diff
==============================================================================
---
oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
(original)
+++
oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
Thu Jul 25 13:00:34 2013
@@ -154,10 +154,18 @@ public class TestCoordActionInputCheckXC
Date endTime = DateUtils.parseDateOozieTZ("2009-02-02T23:59" + TZ);
CoordinatorJobBean job = addRecordToCoordJobTable(jobId, startTime,
endTime);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
- createDir(getTestCaseDir() + "/2009/01/29/");
+ createDir(getTestCaseDir() + "/2009/02/05/");
createDir(getTestCaseDir() + "/2009/01/15/");
new CoordActionInputCheckXCommand(job.getId() + "@1",
job.getId()).call();
- checkCoordAction(job.getId() + "@1");
+ JPAService jpaService = Services.get().get(JPAService.class);
+ CoordinatorActionBean action = jpaService.execute(new
CoordActionGetJPAExecutor(job.getId() + "@1"));
+ System.out.println("missingDeps " + action.getMissingDependencies() +
" Xml " + action.getActionXml());
+ if (action.getMissingDependencies().indexOf("/2009/02/05/") >= 0) {
+ fail("directory should be resolved :" +
action.getMissingDependencies());
+ }
+ if (action.getMissingDependencies().indexOf("/2009/01/15/") < 0) {
+ fail("directory should NOT be resolved :" +
action.getMissingDependencies());
+ }
}
/**
@@ -172,8 +180,8 @@ public class TestCoordActionInputCheckXC
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
// providing some of the dataset dirs required as per coordinator
- // specification - /2009/02/12, /2009/02/05, /2009/01/29, /2009/01/22
- createDir(getTestCaseDir() + "/2009/02/12/");
+ // specification - /2009/02/19, /2009/02/12, /2009/02/05, /2009/01/29,
/2009/01/22
+ createDir(getTestCaseDir() + "/2009/02/19/");
createDir(getTestCaseDir() + "/2009/01/29/");
new CoordActionInputCheckXCommand(job.getId() + "@1",
job.getId()).call();
@@ -188,9 +196,9 @@ public class TestCoordActionInputCheckXC
// Missing dependencies recorded by the coordinator action after input
check
String missDepsOrder = action.getMissingDependencies();
- // Expected missing dependencies are /2009/02/05, /2009/01/29, and
/2009/01/22.
+ // Expected missing dependencies are /2009/02/12, /2009/02/05,
/2009/01/29, and /2009/01/22.
- int index = missDepsOrder.indexOf("/2009/02/12");
+ int index = missDepsOrder.indexOf("/2009/02/19");
if( index >= 0) {
fail("Dependency should be available! current list: " +
missDepsOrder);
}
@@ -836,10 +844,14 @@ public class TestCoordActionInputCheckXC
appXml += "<start-instance>${coord:" + dataInType +
"(0,5)}</start-instance>";
appXml += "<end-instance>${coord:" + dataInType +
"(3,5)}</end-instance>";
}
- else {
+ else if (dataInType.equals("latest")) {
appXml += "<start-instance>${coord:" + dataInType +
"(-3)}</start-instance>";
appXml += "<end-instance>${coord:" + dataInType +
"(0)}</end-instance>";
}
+ else if (dataInType.equals("current")) {
+ appXml += "<start-instance>${coord:" + dataInType +
"(-3)}</start-instance>";
+ appXml += "<end-instance>${coord:" + dataInType +
"(1)}</end-instance>";
+ }
appXml += "</data-in>";
appXml += "</input-events>";
appXml += "<output-events>";
@@ -888,23 +900,6 @@ public class TestCoordActionInputCheckXC
return coordJob;
}
- private void checkCoordAction(String actionId) {
- try {
- JPAService jpaService = Services.get().get(JPAService.class);
- CoordinatorActionBean action = jpaService.execute(new
CoordActionGetJPAExecutor(actionId));
- System.out.println("missingDeps " +
action.getMissingDependencies() + " Xml " + action.getActionXml());
- if (action.getMissingDependencies().indexOf("/2009/01/29/") >= 0) {
- fail("directory should be resolved :" +
action.getMissingDependencies());
- }
- if (action.getMissingDependencies().indexOf("/2009/01/15/") < 0) {
- fail("directory should NOT be resolved :" +
action.getMissingDependencies());
- }
- }
- catch (JPAExecutorException se) {
- fail("Action ID " + actionId + " was not stored properly in db");
- }
- }
-
private CoordinatorActionBean checkCoordAction(String actionId, String
expDeps, CoordinatorAction.Status stat)
throws Exception {
try {
Modified: oozie/trunk/release-log.txt
URL:
http://svn.apache.org/viewvc/oozie/trunk/release-log.txt?rev=1506948&r1=1506947&r2=1506948&view=diff
==============================================================================
--- oozie/trunk/release-log.txt (original)
+++ oozie/trunk/release-log.txt Thu Jul 25 13:00:34 2013
@@ -7,6 +7,7 @@ OOZIE-1440 Build fails in certain enviro
-- Oozie 4.0.0 release
+OOZIE-1466 current EL should not check for less than or equal to zero (rohini)
OOZIE-1465 Making constants in CoordELFunctions public for el extensions
(shwethags via rohini)
OOZIE-1450 Duplicate Coord_Action events on Waiting -> Timeout, and Coord
Materialize not removing actions on Failure (mona)
OOZIE-1451 CoordActionInputCheckX does a redundant eagerLoadState (rohini)