I guess  these two jobs run using the java API. What about workflow.xml of
child job?
On 13-Jan-2016 6:26 pm, "Asanka Sanjaya Herath" <[email protected]> wrote:

> There are basically two jobs.
>
> 1. manager job
> 2. child job
> ​​
>
> Manager job is running on Oozie and responsible for creating new instances
> of child jobs in Oozie when needed.
>
> I can see the manager job run in Oozie without giving any error. When the
> submitDispatcherJobForTenantToOozie(String tenantId) method invoked in
> manager job, it should submit a new child job to Oozie. The method is
> invoking properly. But I cannot see any child job in Oozie console.
>
> But When I run the manager job directly in hadoop(Without using Oozie), it
> spawns new child jobs in Oozie properly.
>
>
>
> On Wed, Jan 13, 2016 at 6:20 PM, Hanmay Udgiri <[email protected]>
> wrote:
>
> > So are u able to see the job running in HUE?.U can also view job in the
> > oozie web console ? What about the workflow.xml of tenantapp?Is
> > The MainClass job able to call tenantapp workflow?
>
> On 13-Jan-2016 6:09 pm, "Asanka Sanjaya Herath" <[email protected]>
> wrote:
> >
> > > Java method to create a job in Oozie.
> > >
> > > private void submitDispatcherJobForTenantToOozie(String tenantId)
> > > throws OozieClientException {
> > >
> > >     // get a OozieClient for local Oozie
> > >     OozieClient wc = new
> > >
> >
> OozieClient(PropertyValuesProvider.getInstance().getPropValue("oozieURL"));
> > >
> > >     // create a workflow job configuration and set the workflow
> > > application path
> > >     Properties conf = wc.createConfiguration();
> > >     conf.setProperty(OozieClient.APP_PATH,
> > > PropertyValuesProvider.getInstance().
> > >             getPropValue("dispatcherTenantManagerAppPath"));
> > >
> > >     // setting workflow parameters
> > >     conf.setProperty("jobTracker", "sandbox.hortonworks.com:8050");
> > >     conf.setProperty("nameNode", "hdfs://sandbox.hortonworks.com:8020
> ");
> > >     conf.setProperty("queueName", "default");
> > >     conf.setProperty("appRoot", "email-dispatcher-tenant-manager-1.0");
> > >
> > >     //set tenantId and retention period
> > >     conf.setProperty("tenantId", tenantId);
> > >
> > >     // submit and start the workflow job
> > >     String jobId = wc.run(conf);
> > > }
> > >
> > >
> > > Workfolw.xml of child job:
> > >
> > >
> > > <workflow-app xmlns="uri:oozie:workflow:0.2" name="java-main-wf">
> > >     <start to="java-node"/>
> > >     <action name="java-node">
> > >         <java>
> > >             <job-tracker>${jobTracker}</job-tracker>
> > >             <name-node>${nameNode}</name-node>
> > >             <configuration>
> > >                 <property>
> > >                     <name>mapred.job.queue.name</name>
> > >                     <value>${queueName}</value>
> > >                 </property>
> > >             </configuration>
> > >             <main-class>com.MainClass</main-class>
> > >         </java>
> > >         <ok to="end"/>
> > >         <error to="fail"/>
> > >     </action>
> > >     <kill name="fail">
> > >         <message>Java failed, error
> > > message[${wf:errorMessage(wf:lastErrorNode())}]</message>
> > >     </kill>
> > >     <end name="end"/>
> > > </workflow-app>
> > >
> > >
> > >
> > > On Wed, Jan 13, 2016 at 6:00 PM, Hanmay Udgiri <
> > [email protected]>
> > > wrote:
> > >
> > > > Can u share the workflow.xml or the java code?
> > > > On 13-Jan-2016 17:34, "Asanka Sanjaya Herath" <[email protected]>
> > > wrote:
> > > >
> > > > > Hi Hanmayya,
> > > > >
> > > > > I followed the given link but it failed to spawn new Oozie jobs.
> But
> > > > when I
> > > > > run the same program directly using yarn jar command It spawns the
> > jobs
> > > > in
> > > > > Oozie. The yarn log is not giving any errors too.
> > > > >
> > > > > On Wed, Jan 13, 2016 at 11:42 AM, Asanka Sanjaya Herath <
> > > > > [email protected]>
> > > > > wrote:
> > > > >
> > > > > > Hi Hanmayya,
> > > > > >
> > > > > > Thank you for the response. I'll follow the given link and update
> > > > status.
> > > > > >
> > > > > > ​
> > > > > >> Do you want to execute multiple Oozie workflows from the Java
> > > class?​
> > > > > >
> > > > > >
> > > > > > No I want to execute set of instances of one Oozie workflow.
> > > > > >
> > > > > >
> > > > > > On Wed, Jan 13, 2016 at 10:43 AM, Hanmay Udgiri <
> > > > > [email protected]
> > > > > > > wrote:
> > > > > >
> > > > > >> You can use OozieClient Java class.
> > > > > >>
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://www.hadooped.blogspot.in/2013/06/apache-oozie-part-8-java-api-for.html
> > > > > >>
> > > > > >> Do you want to execute multiple Oozie workflows from the Java
> > class?
> > > > > >>
> > > > > >> Thanks
> > > > > >> Hanmayya
> > > > > >>
> > > > > >> On Wed, Jan 13, 2016 at 9:57 AM, Asanka Sanjaya Herath <
> > > > > >> [email protected]>
> > > > > >> wrote:
> > > > > >>
> > > > > >> > Hi,
> > > > > >> >
> > > > > >> > I'm writing a simple Java Oozie job. That job is supposed to
> > spawn
> > > > new
> > > > > >> > Oozie jobs or directly submit new jobs to Hadoop. Is there a
> way
> > > to
> > > > > >> achieve
> > > > > >> > this using Oozie API?
> > > > > >> >
> > > > > >> > --
> > > > > >> > Thanks,
> > > > > >> > Regards,
> > > > > >> > ASH
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> --
> > > > > >> Thanks and Regards
> > > > > >> Hanmayya Udgiri
> > > > > >>
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Thanks,
> > > > > > Regards,
> > > > > > ASH
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thanks,
> > > > > Regards,
> > > > > ASH
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks,
> > > Regards,
> > > ASH
> > >
> >
>
>
>
> --
> Thanks,
> Regards,
> ASH
>

Reply via email to