Repository: oozie Updated Branches: refs/heads/master a0aa6fbdf -> f82c12408
http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionsIgnoreXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionsIgnoreXCommand.java b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionsIgnoreXCommand.java new file mode 100644 index 0000000..9daa6d7 --- /dev/null +++ b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionsIgnoreXCommand.java @@ -0,0 +1,169 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.oozie.command.coord; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.List; + +import org.apache.oozie.CoordinatorActionBean; +import org.apache.oozie.CoordinatorActionInfo; +import org.apache.oozie.CoordinatorJobBean; +import org.apache.oozie.ErrorCode; +import org.apache.oozie.WorkflowJobBean; +import org.apache.oozie.client.CoordinatorAction; +import org.apache.oozie.client.CoordinatorJob; +import org.apache.oozie.client.CoordinatorJob.Execution; +import org.apache.oozie.client.rest.RestConstants; +import org.apache.oozie.command.CommandException; +import org.apache.oozie.coord.CoordELFunctions; +import org.apache.oozie.executor.jpa.CoordActionGetJPAExecutor; +import org.apache.oozie.executor.jpa.CoordActionQueryExecutor; +import org.apache.oozie.executor.jpa.CoordJobGetJPAExecutor; +import org.apache.oozie.executor.jpa.CoordJobInsertJPAExecutor; +import org.apache.oozie.executor.jpa.CoordJobQueryExecutor; +import org.apache.oozie.executor.jpa.JPAExecutorException; +import org.apache.oozie.executor.jpa.WorkflowJobInsertJPAExecutor; +import org.apache.oozie.executor.jpa.CoordActionQueryExecutor.CoordActionQuery; +import org.apache.oozie.executor.jpa.CoordJobQueryExecutor.CoordJobQuery; +import org.apache.oozie.local.LocalOozie; +import org.apache.oozie.service.JPAService; +import org.apache.oozie.service.LiteWorkflowStoreService; +import org.apache.oozie.service.SchemaService; +import org.apache.oozie.service.Services; +import org.apache.oozie.service.StatusTransitService; +import org.apache.oozie.service.StoreService; +import org.apache.oozie.service.WorkflowStoreService; +import org.apache.oozie.store.CoordinatorStore; +import org.apache.oozie.store.StoreException; +import org.apache.oozie.test.XDataTestCase; +import org.apache.oozie.util.DateUtils; +import org.apache.oozie.util.IOUtils; +import org.apache.oozie.util.XConfiguration; +import org.apache.oozie.util.XLog; +import org.apache.oozie.util.XmlUtils; +import org.apache.oozie.workflow.WorkflowApp; +import org.apache.oozie.workflow.WorkflowInstance; +import org.apache.oozie.workflow.WorkflowLib; +import org.apache.oozie.workflow.lite.EndNodeDef; +import org.apache.oozie.workflow.lite.LiteWorkflowApp; +import org.apache.oozie.workflow.lite.LiteWorkflowInstance; +import org.apache.oozie.workflow.lite.StartNodeDef; +import org.jdom.Element; +import org.jdom.JDOMException; + +public class TestCoordActionsIgnoreXCommand extends XDataTestCase { + private Services services; + List<CoordinatorJobBean> coordJobs; + List<CoordinatorActionBean> coordActions; + + @Override + protected void setUp() throws Exception { + super.setUp(); + services = new Services(); + services.init(); + } + + @Override + protected void tearDown() throws Exception { + LocalOozie.stop(); + services.destroy(); + super.tearDown(); + } + + public void testCoordActionsIgnore() throws Exception { + createDBRecords(); + + // positive test of single action - oozie job -ingore job1 -action 1 + CoordinatorActionInfo retInfo = new CoordActionsIgnoreXCommand(coordJobs.get(0).getId(), "action", "1").call(); + CoordinatorActionBean actionBean1 = CoordActionQueryExecutor.getInstance().get( + CoordActionQuery.GET_COORD_ACTION, coordActions.get(0).getId()); + assertEquals(CoordinatorAction.Status.IGNORED, actionBean1.getStatus()); + assertEquals(1, retInfo.getCoordActions().size()); + assertEquals(actionBean1.getId(), retInfo.getCoordActions().get(0).getId()); + + // positive test of action range - oozie job -ignore job1 -action 2-3 + retInfo = new CoordActionsIgnoreXCommand(coordJobs.get(0).getId(), "action", "2-3").call(); + CoordinatorActionBean actionBean2 = CoordActionQueryExecutor.getInstance().get( + CoordActionQuery.GET_COORD_ACTION, coordActions.get(1).getId()); + CoordinatorActionBean actionBean3 = CoordActionQueryExecutor.getInstance().get( + CoordActionQuery.GET_COORD_ACTION, coordActions.get(2).getId()); + assertEquals(CoordinatorAction.Status.IGNORED, actionBean2.getStatus()); + assertEquals(CoordinatorAction.Status.IGNORED, actionBean3.getStatus()); + assertEquals(2, retInfo.getCoordActions().size()); + String retId1 = retInfo.getCoordActions().get(0).getId(); + String retId2 = retInfo.getCoordActions().get(1).getId(); + assertTrue(actionBean2.getId().equals(retId1) || actionBean2.getId().equals(retId2)); + assertTrue(actionBean3.getId().equals(retId1) || actionBean3.getId().equals(retId2)); + + // negative test when ignoring a coord action in RUNNING (@5 is running) + try { + new CoordActionsIgnoreXCommand(coordJobs.get(0).getId(), "action", "4-5").call(); + } + catch (CommandException ex) { + assertEquals(ex.getErrorCode(), ErrorCode.E1024); + assertTrue(ex.getMessage().indexOf( + "part or all actions are not eligible to ignore, check state of action number(s) [5]") > -1); + } + + // negative test when ignore command on coordinator job in PREP + try { + new CoordActionsIgnoreXCommand(coordJobs.get(1).getId(), "action", "1").call(); + } + catch (CommandException ex) { + assertEquals(ex.getErrorCode(), ErrorCode.E1024); + assertTrue(ex.getMessage().indexOf("No actions are materialized to ignore") > -1); + } + } + + private void createDBRecords() throws Exception { + JPAService jpaService = services.get(JPAService.class); + coordJobs = new ArrayList<CoordinatorJobBean>(); + coordActions = new ArrayList<CoordinatorActionBean>(); + + Date startTime = DateUtils.parseDateOozieTZ("2013-08-01T23:59Z"); + Date endTime = DateUtils.parseDateOozieTZ("2013-08-02T23:59Z"); + CoordinatorJobBean job1 = addRecordToCoordJobTable(CoordinatorJob.Status.KILLED, startTime, endTime, false, + true, 0); + CoordinatorJobBean job2 = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, startTime, endTime, false, true, + 0); + coordJobs.add(job1); + coordJobs.add(job2); + + CoordinatorActionBean action1_1 = addRecordToCoordActionTable(job1.getId(), 1, CoordinatorAction.Status.FAILED, + "coord-action-get.xml", 0); + CoordinatorActionBean action1_2 = addRecordToCoordActionTable(job1.getId(), 2, + CoordinatorAction.Status.FAILED, "coord-action-get.xml", 0); + CoordinatorActionBean action1_3 = addRecordToCoordActionTable(job1.getId(), 3, CoordinatorAction.Status.KILLED, + "coord-action-get.xml", 0); + CoordinatorActionBean action1_4 = addRecordToCoordActionTable(job1.getId(), 4, CoordinatorAction.Status.KILLED, + "coord-action-get.xml", 0); + CoordinatorActionBean action1_5 = addRecordToCoordActionTable(job1.getId(), 5, + CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0); + coordActions.add(action1_1); + coordActions.add(action1_2); + coordActions.add(action1_3); + coordActions.add(action1_4); + coordActions.add(action1_5); + + action1_1.setNominalTime(DateUtils.parseDateOozieTZ("2009-12-15T02:00Z")); + action1_1.setExternalId(null); + CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION, action1_1); + } +} http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java b/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java index 327ec90..bc24235 100644 --- a/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java @@ -660,6 +660,50 @@ public class TestCoordChangeXCommand extends XDataTestCase { } } + public void testCoordStatus_Ignored() throws Exception { + Date start = new Date(); + Date end = new Date(start.getTime() + (5 * 60 * 60 * 1000)); // 5 hrs + String statusToRUNNING = "status=RUNNING"; + String statusToIGNORED = "status=IGNORED"; + final CoordinatorJobBean job1 = addRecordToCoordJobTableForPauseTimeTest(CoordinatorJob.Status.IGNORED, start, + end, end, false, false, 4); + final CoordinatorJobBean job2 = addRecordToCoordJobTableForPauseTimeTest(CoordinatorJob.Status.KILLED, start, + end, end, false, false, 4); + final CoordinatorJobBean job3 = addRecordToCoordJobTableForPauseTimeTest(CoordinatorJob.Status.RUNNING, start, + end, end, false, false, 4); + final CoordinatorJobBean job4 = addRecordToCoordJobTableForPauseTimeTest(CoordinatorJob.Status.FAILED, start, + end, end, true, false, 4); + + // Status change from IGNORED to RUNNING + new CoordChangeXCommand(job1.getId(), statusToRUNNING).call(); + CoordinatorJobBean coordJob = CoordJobQueryExecutor.getInstance() + .get(CoordJobQuery.GET_COORD_JOB, job1.getId()); + assertEquals(coordJob.getStatus(), Job.Status.RUNNING); + + // Status change from KILLED -> IGNORED + new CoordChangeXCommand(job2.getId(), statusToIGNORED).call(); + coordJob = CoordJobQueryExecutor.getInstance().get(CoordJobQuery.GET_COORD_JOB, job2.getId()); + assertEquals(coordJob.getStatus(), Job.Status.IGNORED); + + // Status change from RUNNING -> IGNORED + try { + new CoordChangeXCommand(job3.getId(), statusToIGNORED).call(); + } + catch (CommandException ex) { + assertEquals(ErrorCode.E1015, ex.getErrorCode()); + assertTrue(ex.getMessage().indexOf( + "Only FAILED or KILLED non-pending job can be changed to IGNORED") > -1); + } + // Status change from FAILED -> IGNORED when coord job is pending + try { + new CoordChangeXCommand(job4.getId(), statusToIGNORED).call(); + } + catch (CommandException ex) { + assertEquals(ErrorCode.E1015, ex.getErrorCode()); + assertTrue(ex.getMessage().indexOf( + "Only FAILED or KILLED non-pending job can be changed to IGNORED") > -1); + } + } // Status change from failed- successful public void testCoordStatus_Failed() throws Exception { Date start = new Date(); http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionQueryExecutor.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionQueryExecutor.java b/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionQueryExecutor.java index 3ae4d6c..3fd6537 100644 --- a/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionQueryExecutor.java +++ b/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionQueryExecutor.java @@ -105,7 +105,7 @@ public class TestBundleActionQueryExecutor extends XDataTestCase { assertTrue(date.before(Calendar.getInstance().getTime())); query = BundleActionQueryExecutor.getInstance().getSelectQuery( - BundleActionQuery.GET_BUNDLE_ACTION_STATUS_PENDING_FOR_BUNDLE, em, bean.getBundleId()); + BundleActionQuery.GET_BUNDLE_UNIGNORED_ACTION_STATUS_PENDING_FOR_BUNDLE, em, bean.getBundleId()); assertEquals(query.getParameterValue("bundleId"), bean.getBundleId()); } @@ -123,9 +123,9 @@ public class TestBundleActionQueryExecutor extends XDataTestCase { public void testGet() throws Exception { BundleJobBean job = this.addRecordToBundleJobTable(Job.Status.RUNNING, false); BundleActionBean bundleAction = this.addRecordToBundleActionTable(job.getId(), "action1", 1, Job.Status.PREP); - // GET_BUNDLE_ACTION_STATUS_PENDING_FOR_BUNDLE + // GET_UNIGNORED_BUNDLE_ACTION_STATUS_PENDING_FOR_BUNDLE BundleActionBean retBean = BundleActionQueryExecutor.getInstance().get( - BundleActionQuery.GET_BUNDLE_ACTION_STATUS_PENDING_FOR_BUNDLE, bundleAction.getBundleId()); + BundleActionQuery.GET_BUNDLE_UNIGNORED_ACTION_STATUS_PENDING_FOR_BUNDLE, bundleAction.getBundleId()); assertEquals(bundleAction.getCoordId(), retBean.getCoordId()); assertEquals(bundleAction.getStatusStr(), retBean.getStatusStr()); assertEquals(bundleAction.getPending(), retBean.getPending()); @@ -156,9 +156,9 @@ public class TestBundleActionQueryExecutor extends XDataTestCase { bActions = BundleActionQueryExecutor.getInstance().getList( BundleActionQuery.GET_BUNDLE_WAITING_ACTIONS_OLDER_THAN, (long) (-1000 * 60)); assertEquals(2, bActions.size()); - // GET_BUNDLE_ACTIONS_FOR_BUNDLE + // GET_BUNDLE_ACTIONS_STATUS_UNIGNORED_FOR_BUNDLE List<BundleActionBean> retList = BundleActionQueryExecutor.getInstance().getList( - BundleActionQuery.GET_BUNDLE_ACTIONS_FOR_BUNDLE, job.getId()); + BundleActionQuery.GET_BUNDLE_ACTIONS_STATUS_UNIGNORED_FOR_BUNDLE, job.getId()); assertEquals(3, retList.size()); for (BundleActionBean bean : retList) { assertTrue(bean.getCoordName().equals("coord1") || bean.getCoordName().equals("coord2") http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java b/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java index 9892d4b..80ab512 100644 --- a/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java +++ b/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java @@ -156,7 +156,7 @@ public class MockCoordinatorEngineService extends CoordinatorEngineService { public void change(String jobId, String changeValue) throws CoordinatorEngineException { did = RestConstants.JOB_ACTION_CHANGE; int idx = validateCoordinatorIdx(jobId); - started.set(idx, false); + started.set(idx, true); } @Override @@ -165,6 +165,13 @@ public class MockCoordinatorEngineService extends CoordinatorEngineService { } @Override + public CoordinatorActionInfo ignore(String jobId, String type, String scope) throws CoordinatorEngineException { + did = RestConstants.JOB_ACTION_IGNORE; + int idx = validateCoordinatorIdx(jobId); + started.set(idx, true); + return null; + } + @Override public CoordinatorActionInfo reRun(String jobId, String rerunType, String scope, boolean refresh, boolean noCleanup) throws BaseEngineException { did = RestConstants.JOB_COORD_ACTION_RERUN; http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/core/src/test/java/org/apache/oozie/servlet/TestV2JobServlet.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/servlet/TestV2JobServlet.java b/core/src/test/java/org/apache/oozie/servlet/TestV2JobServlet.java index aa5442c..7512e24 100644 --- a/core/src/test/java/org/apache/oozie/servlet/TestV2JobServlet.java +++ b/core/src/test/java/org/apache/oozie/servlet/TestV2JobServlet.java @@ -17,6 +17,7 @@ */ package org.apache.oozie.servlet; +import org.apache.oozie.client.OozieClient; import org.apache.oozie.client.rest.RestConstants; import org.apache.oozie.client.rest.JsonTags; import org.json.simple.JSONObject; @@ -147,4 +148,78 @@ public class TestV2JobServlet extends DagServletTestCase { } }); } + + public void testCoordJobIgnore() throws Exception { + runTest("/v2/job/*", V2JobServlet.class, IS_SECURITY_ENABLED, new Callable<Void>() { + @Override + public Void call() throws Exception { + + MockDagEngineService.reset(); + Map<String, String> params = new HashMap<String, String>(); + params.put(RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_IGNORE); + + // url - oozie/v2/coord_job_id?action=ignore + URL url = createURL(MockCoordinatorEngineService.JOB_ID + 1, params); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("PUT"); + conn.setRequestProperty("content-type", RestConstants.XML_CONTENT_TYPE); + conn.setDoOutput(true); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + assertEquals(RestConstants.JOB_ACTION_CHANGE, MockCoordinatorEngineService.did); + + MockCoordinatorEngineService.reset(); + params = new HashMap<String, String>(); + params.put(RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_IGNORE); + url = createURL(MockCoordinatorEngineService.JOB_ID + + (MockCoordinatorEngineService.coordJobs.size() + 1), params); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("PUT"); + conn.setRequestProperty("content-type", RestConstants.XML_CONTENT_TYPE); + conn.setDoOutput(true); + assertEquals(HttpServletResponse.SC_BAD_REQUEST, conn.getResponseCode()); + assertEquals(RestConstants.JOB_ACTION_CHANGE, MockCoordinatorEngineService.did); + + return null; + } + }); + } + public void testCoordActionIgnore() throws Exception { + runTest("/v2/job/*", V2JobServlet.class, IS_SECURITY_ENABLED, new Callable<Void>() { + @Override + public Void call() throws Exception { + + MockDagEngineService.reset(); + Map<String, String> params = new HashMap<String, String>(); + params.put(RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_IGNORE); + params.put(RestConstants.JOB_COORD_RANGE_TYPE_PARAM, RestConstants.JOB_COORD_SCOPE_ACTION); + params.put(RestConstants.JOB_COORD_SCOPE_PARAM, "1"); + + // url - oozie/v2/coord_job_id?action=ignore + URL url = createURL(MockCoordinatorEngineService.JOB_ID + 1, params); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("PUT"); + conn.setRequestProperty("content-type", RestConstants.XML_CONTENT_TYPE); + conn.setDoOutput(true); + assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode()); + assertEquals(RestConstants.JOB_ACTION_IGNORE, MockCoordinatorEngineService.did); + + // negative test for non-existent action + MockCoordinatorEngineService.reset(); + params = new HashMap<String, String>(); + params.put(RestConstants.ACTION_PARAM, RestConstants.JOB_ACTION_IGNORE); + params.put(RestConstants.JOB_COORD_RANGE_TYPE_PARAM, RestConstants.JOB_COORD_SCOPE_ACTION); + params.put(RestConstants.JOB_COORD_SCOPE_PARAM, "1"); + url = createURL(MockCoordinatorEngineService.JOB_ID + + (MockCoordinatorEngineService.coordJobs.size() + 1), params); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("PUT"); + conn.setRequestProperty("content-type", RestConstants.XML_CONTENT_TYPE); + conn.setDoOutput(true); + assertEquals(HttpServletResponse.SC_BAD_REQUEST, conn.getResponseCode()); + assertEquals(RestConstants.JOB_ACTION_IGNORE, MockCoordinatorEngineService.did); + + return null; + } + }); + } } http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/docs/src/site/twiki/DG_CommandLineTool.twiki ---------------------------------------------------------------------- diff --git a/docs/src/site/twiki/DG_CommandLineTool.twiki b/docs/src/site/twiki/DG_CommandLineTool.twiki index f3231c7..cd0391c 100644 --- a/docs/src/site/twiki/DG_CommandLineTool.twiki +++ b/docs/src/site/twiki/DG_CommandLineTool.twiki @@ -69,6 +69,8 @@ usage: -update Update coordinator definition and properties -logfilter job log search parameter. Can be specified as -logfilter opt1=val1;opt2=val1;opt3=val1. Supported options are recent, start, end, loglevel, text, limit and debug. + -ignore <arg> ignore a coordinator job or action + (requires '-action' to ignore a coordinator action, if no option given, ignore a coodinator job) . oozie jobs <OPTIONS> : jobs status -auth <arg> select authentication type [SIMPLE|KERBEROS] @@ -352,10 +354,11 @@ Conditions and usage: * Repeated value names are not allowed. * New end time should not be before job's start time and last action time. * If end time is before job start time and if the job has not materialized any actions, then job status is changed to SUCCEEDED. - * Currently status only takes RUNNING and can be used to change the status of FAILED or KILLED coordinator job to RUNNING and resuming materialization. This status change command does not affect the status of already materialized actions in the coordinator. If there are FAILED or KILLED coordinator actions they have to be rerun separately. + * Currently status only takes RUNNING and can be used to change the status of FAILED, KILLED, IGNORED coordinator job to RUNNING and resuming materialization. This status change command does not affect the status of already materialized actions in the coordinator. If there are FAILED, KILLED or IGNORED coordinator actions they have to be rerun separately. * New concurrency value has to be a valid integer. * All lookahead actions which are in WAITING/READY state will be revoked according to the new pause/end time. If any action after new pause/end time is not in WAITING/READY state, an exception will be thrown. * Also empty string "" can be used to reset pause time to none. + * Endtime/concurency/pausetime of IGNORED Job cannot be changed. After the command is executed the job's end time, concurrency or pause time should be changed. If an already-succeeded job changes its end time, its status will become running. @@ -409,7 +412,7 @@ $oozie job -rerun <coord_Job_id> [-nocleanup] [-refresh] (if neither -action nor -date is given, the exception will be thrown.) </verbatim> -The =rerun= option reruns a terminated (=TIMEDOUT=, =SUCCEEDED=, =KILLED=, =FAILED=) coordiantor action when coordiator job +The =rerun= option reruns a terminated (=TIMEDOUT=, =SUCCEEDED=, =KILLED=, =FAILED=, =IGNORED=) coordiantor action when coordiator job is not in =FAILED= or =KILLED= state. After the command is executed the rerun coordiator action will be in =WAITING= status. @@ -755,6 +758,36 @@ $ oozie job -oozie http://localhost:11000/oozie -config job.properties -update 0 ********************************** </verbatim> +---+++ Ignore a Coordinator Job + +Example: + +<verbatim> +$oozie job -ignore <coord_Job_id> +</verbatim> + +The =ignore= option changes a coordinator job in =KILLED=, =FAILED= to =IGNORED= state. +When a coordinator job in a bundle is in =IGNORED= state, the coordinator job doesn't impact the state of the bundle job. +For example, when a coordinator job in a bundle failed and afterwards ignored, the bundle job becomes =SUCCEEDED= instead of =DONEWITHERROR= as long as other coordinator jobs in the bundle succeeded. + A ignored coordinator job can be changed to =RUNNING= using -change command. + Refer to the [[DG_CommandLineTool#Changing_endtimeconcurrencypausetimestatus_of_a_Coordinator_Job][Coordinator job change command]] for details. + +---+++ Ignore a Coordinator Action or Multiple Coordinator Actions + +Example: + +<verbatim> +$oozie job -ignore <coord_Job_id> -action 1,3-4,7-40 +</verbatim> +The =ignore= option changes a coordinator action(s) in terminal state (=KILLED=, =FAILED=, =TIMEDOUT=) to =IGNORED= state, while not changing the state of the coordinator job. +When a coordinator action is in =IGNORED= state, the action doesn't impact the state of a coordinator job. +For example, when a coordinator action failed and afterwards ignored, a coordinator job becomes =SUCCEEDED= instead of =DONEWITHERROR= as long + as other coordinator actions succeeded. + +A ignored coordinator action can be rerun using -rerun command. +Refer to the [[DG_CoordinatorRerun][Rerunning Coordinator Actions]] for details. +When a workflow job of a ignored coordinator action is rerun, the coordinator action becomes =RUNNING= state. + ---++ Jobs Operations ---+++ Checking the Status of multiple Workflow Jobs http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/docs/src/site/twiki/WebServicesAPI.twiki ---------------------------------------------------------------------- diff --git a/docs/src/site/twiki/WebServicesAPI.twiki b/docs/src/site/twiki/WebServicesAPI.twiki index 6730255..5769924 100644 --- a/docs/src/site/twiki/WebServicesAPI.twiki +++ b/docs/src/site/twiki/WebServicesAPI.twiki @@ -1682,6 +1682,26 @@ Content-Type: application/json;charset=UTF-8 } </verbatim> +---++++ Managing a Job +---+++++ Ignore a Coordinator Job or Action + +A ignore request is done with an HTTP PUT request with a =ignore= + +The =type= parameter supports =action= only. +The =scope= parameter can contain coodinator action id(s) to be ignored. +Multiple action ids can be passed to the =scope= parameter + +*Request:* + +Ignore a coordinator job +<verbatim> +PUT /oozie/v2/job/job-3?action=ignore +</verbatim> + +Ignore coordinator actions +<verbatim> +PUT /oozie/v2/job/job-3?action=ignore&type=action&scope=3-4 +</verbatim> </noautolink> http://git-wip-us.apache.org/repos/asf/oozie/blob/f82c1240/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index f5d0154..da86677 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.1.0 release (trunk - unreleased) +OOZIE-1791 add IGNORED status to Coordinator Job and Action (ryota) OOZIE-1825 Optimize wf_jobs protoconf storage (puru via rohini) OOZIE-1831 Oozie upgrade fails if workflow jobs are in running or suspended state (satish.mittal via rohini) OOZIE-1690 TestShellActionExecutor#testEnvVar failed for Windows (omaliuvanchuk via rkanter)
