Repository: oozie Updated Branches: refs/heads/master 1c6680541 -> 98ac2ae8b
OOZIE-2028 Coord action rerun with -failed option should rerun existing workflow with RERUN_FAIL_NODES=true (jaydeepvishwakarma via shwethags) -fixed tests Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/98ac2ae8 Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/98ac2ae8 Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/98ac2ae8 Branch: refs/heads/master Commit: 98ac2ae8b76bcaadfb828ea712eca172f96e1ef2 Parents: 1c66805 Author: shwethags <[email protected]> Authored: Fri Dec 12 11:38:51 2014 +0530 Committer: shwethags <[email protected]> Committed: Fri Dec 12 11:38:51 2014 +0530 ---------------------------------------------------------------------- .../org/apache/oozie/LocalOozieClientCoord.java | 22 ++++++++++++++++++++ .../TestCoordActionInputCheckXCommand.java | 3 ++- .../org/apache/oozie/test/XDataTestCase.java | 4 +++- 3 files changed, 27 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/98ac2ae8/core/src/main/java/org/apache/oozie/LocalOozieClientCoord.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/LocalOozieClientCoord.java b/core/src/main/java/org/apache/oozie/LocalOozieClientCoord.java index 34ab1e1..2b25561 100644 --- a/core/src/main/java/org/apache/oozie/LocalOozieClientCoord.java +++ b/core/src/main/java/org/apache/oozie/LocalOozieClientCoord.java @@ -248,12 +248,34 @@ public class LocalOozieClientCoord extends OozieClient { * @param scope rerun scope for date or actionIds * @param refresh true if -refresh is given in command option * @param noCleanup true if -nocleanup is given in command option + * @throws OozieClientException + */ + @Override + public List<CoordinatorAction> reRunCoord(String jobId, String rerunType, String scope, boolean refresh, + boolean noCleanup) throws OozieClientException { + return getCoordinatorActions(jobId, rerunType, scope, refresh, noCleanup, false); + } + + /** + * Rerun coordinator actions with failed option. + * + * @param jobId coordinator jobId + * @param rerunType rerun type 'date' if -date is used, 'action-id' if + * -action is used + * @param scope rerun scope for date or actionIds + * @param refresh true if -refresh is given in command option + * @param noCleanup true if -nocleanup is given in command option * @param failed true if -failed is given in command option * @throws OozieClientException */ @Override public List<CoordinatorAction> reRunCoord(String jobId, String rerunType, String scope, boolean refresh, boolean noCleanup, boolean failed) throws OozieClientException { + return getCoordinatorActions(jobId, rerunType, scope, refresh, noCleanup, failed); + } + + private List<CoordinatorAction> getCoordinatorActions(String jobId, String rerunType, String scope, boolean refresh, + boolean noCleanup, boolean failed) throws OozieClientException { try { if (!(rerunType.equals(RestConstants.JOB_COORD_SCOPE_DATE) || rerunType .equals(RestConstants.JOB_COORD_SCOPE_ACTION))) { http://git-wip-us.apache.org/repos/asf/oozie/blob/98ac2ae8/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java index f79c9a0..37766e7 100644 --- a/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java @@ -717,9 +717,10 @@ public class TestCoordActionInputCheckXCommand extends XDataTestCase { action.setMissingDependencies(""); action.setStatus(CoordinatorAction.Status.WAITING); + action.setExternalId(null); try { jpaService = Services.get().get(JPAService.class); - CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION_FOR_INPUTCHECK, action); + CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION, action); } catch (JPAExecutorException se) { fail("Action ID " + coordJob.getId() + "@1" + " was not stored properly in db"); http://git-wip-us.apache.org/repos/asf/oozie/blob/98ac2ae8/core/src/test/java/org/apache/oozie/test/XDataTestCase.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/test/XDataTestCase.java b/core/src/test/java/org/apache/oozie/test/XDataTestCase.java index 03e9b70..e885892 100644 --- a/core/src/test/java/org/apache/oozie/test/XDataTestCase.java +++ b/core/src/test/java/org/apache/oozie/test/XDataTestCase.java @@ -664,7 +664,9 @@ public abstract class XDataTestCase extends XHCatTestCase { CoordinatorActionBean action = new CoordinatorActionBean(); action.setId(actionId); - action.setExternalId(actionId + "_E"); + if(status != CoordinatorAction.Status.SUBMITTED && status != CoordinatorAction.Status.READY) { + action.setExternalId(actionId + "_E"); + } action.setJobId(jobId); action.setActionNumber(actionNum); action.setPending(pending);
