[ 
https://issues.apache.org/jira/browse/OOZIE-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14339996#comment-14339996
 ] 

Shwetha G S commented on OOZIE-2108:
------------------------------------

[~bowenzhangusa], I don't see how this handles the case of partial action. For 
example, the bundles matching filter are b1(SUCCEEDED), b2(RUNNING), 
b3(FAILED). But kill operation can be done only on b2 because of status 
pre-condition check. In this case, the API should return b1(SUCCEEDED), 
b2(KILLED), b3(FAILED). Doesn't this code in BulkBundleKillXCommand fail the 
API at b1 itself? What am I missing?
{code}
+    @Override
+    protected void verifyPrecondition() throws CommandException, 
PreconditionException {
+        List<BundleJobBean> jobs = this.bundleJobInfo.getBundleJobs();
+        for (BundleJobBean job : jobs) {
+            if (job.getStatus() == Job.Status.SUCCEEDED
+                    || job.getStatus() == Job.Status.FAILED
+                    || job.getStatus() == Job.Status.DONEWITHERROR
+                    || job.getStatus() == Job.Status.KILLED) {
+                LOG.info("Bundle job cannot be killed - job already SUCCEEDED, 
FAILED, KILLED or DONEWITHERROR, job id = "
+                        + job.getId() + ", status = " + job.getStatus());
+                throw new PreconditionException(ErrorCode.E1323, job.getId());
+            }
+        }
+    }
{code}

> bulk kill, suspend, resume jobs using existing filter, offset, len, and 
> jobtype params
> --------------------------------------------------------------------------------------
>
>                 Key: OOZIE-2108
>                 URL: https://issues.apache.org/jira/browse/OOZIE-2108
>             Project: Oozie
>          Issue Type: New Feature
>            Reporter: Bowen Zhang
>            Assignee: Bowen Zhang
>         Attachments: oozie-2108.patch, oozie-2108.patch, oozie-2108.patch
>
>
> Currently, there is no bulk write operations in "jobs" API. We would like to 
> first introduce a bulk kill operation that kills all jobs which satisfy the 
> filter. The desired usage will be {noformat}oozie jobs -oozie 
> http://localhost:11000/oozie -kill -filter name=something{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to