You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Hanmay Udgiri <ha...@gmail.com> on 2016/03/16 06:21:21 UTC

Suspend and resume Job using oozie client

Hi All,
I have a scenario where I need suspend and resume a oozie job.I know this
is possible by passing the jobId to oozie client.
In my scenario, I have coordinator which call a Java class which call all
the oozie workflows and I suspend a job if a validation fails, and exit the
workflow
When the coordinator call the Java class. I need to resume all the
suspended jobs but how do we get the job which are in suspended state.do we
any API which can give all jobids which can give this (I can think of one
option where to save all jobids in DB and use this)
But I wanted to check if we have any API within oozie.

Thanks
Hanmayya

Re: Suspend and resume Job using oozie client

Posted by Robert Kanter <rk...@cloudera.com>.
Besides the REST API, the Java API should let you do the same thing.
http://oozie.apache.org/docs/4.2.0/client/apidocs/org/apache/oozie/client/OozieClient.html#getJobsInfo(java.lang.String)

Same with the CLI:
http://oozie.apache.org/docs/4.2.0/DG_CommandLineTool.html#Checking_the_Status_of_multiple_Workflow_Jobs


- Robert

On Wed, Mar 16, 2016 at 9:26 AM, Ganesh <ga...@thedatateam.in> wrote:

> Hi Hanmayya,
>
> I would actually think of using the REST API from oozie to list down all
> jobs with a filter on status .
>
> Take a look at this :
> https://oozie.apache.org/docs/4.0.0/WebServicesAPI.html#Jobs_Information
>
> This way you wouldn't need to retain job state information at your end !
>
> Am not an expert oozie user! But i guess this might be of help!
> Thanks/Ganesh
>
>
> On 16-03-2016 10:51, Hanmay Udgiri wrote:
>
>> Hi All,
>> I have a scenario where I need suspend and resume a oozie job.I know this
>> is possible by passing the jobId to oozie client.
>> In my scenario, I have coordinator which call a Java class which call all
>> the oozie workflows and I suspend a job if a validation fails, and exit
>> the
>> workflow
>> When the coordinator call the Java class. I need to resume all the
>> suspended jobs but how do we get the job which are in suspended state.do
>> we
>> any API which can give all jobids which can give this (I can think of one
>> option where to save all jobids in DB and use this)
>> But I wanted to check if we have any API within oozie.
>>
>> Thanks
>> Hanmayya
>>
>>
>

Re: Suspend and resume Job using oozie client

Posted by Ganesh <ga...@thedatateam.in>.
Hi Hanmayya,

I would actually think of using the REST API from oozie to list down all 
jobs with a filter on status .

Take a look at this : 
https://oozie.apache.org/docs/4.0.0/WebServicesAPI.html#Jobs_Information

This way you wouldn't need to retain job state information at your end !

Am not an expert oozie user! But i guess this might be of help!
Thanks/Ganesh

On 16-03-2016 10:51, Hanmay Udgiri wrote:
> Hi All,
> I have a scenario where I need suspend and resume a oozie job.I know this
> is possible by passing the jobId to oozie client.
> In my scenario, I have coordinator which call a Java class which call all
> the oozie workflows and I suspend a job if a validation fails, and exit the
> workflow
> When the coordinator call the Java class. I need to resume all the
> suspended jobs but how do we get the job which are in suspended state.do we
> any API which can give all jobids which can give this (I can think of one
> option where to save all jobids in DB and use this)
> But I wanted to check if we have any API within oozie.
>
> Thanks
> Hanmayya
>