FAQ
Hi,

I am submitting a Hadoop M/R job using OOZIE java client API. But, the job
seems running continuously without stopping. It ran for quite some time,
and ended prematurely throwing an exception of “Optimistic Lock”. Can you
please help?

Below is the code:


package com.example.oozie.client;
import org.apache.oozie.client.OozieClient;import
org.apache.oozie.client.OozieClientException;import
org.apache.oozie.client.WorkflowJob;
import java.util.Properties;
public class OozieClientDemo {
public static void main(String[] args) throws
OozieClientException,
InterruptedException { OozieClient wc = new
OozieClient("http://localhost:11000/oozie/");
Properties conf = wc.createConfiguration();

conf.setProperty(OozieClient.APP_PATH,
"hdfs://localhost:8020/user/root/examples/apps/map-reduce/workflow.xml");
conf.setProperty("jobTracker", "localhost:8021");
conf.setProperty("nameNode",
"hdfs://localhost:8020");
conf.setProperty("inputDir", "/oozie/inputdir");
conf.setProperty("outputDir", "/oozie/outputdir");
String jobId = wc.run(conf);
System.out.println("Work flow submitted");
while (wc.getJobInfo(jobId).getStatus() ==
WorkflowJob.Status.RUNNING) {
System.out.println("Workflow job
running..."); Thread.sleep(10 *
1000); }
System.out.println("Workflow job
completed");
System.out.println(wc.getJobInfo(jobId));
}
}




Regards,
Shouvanik

Search Discussions

  • Serega Sheypak at Apr 15, 2013 at 1:12 pm
    Provide your xml workflow please
    15.04.2013 11:04 пользователь "Shouvanik Haldar" <shouvanik.haldar@gmail.com>
    написал:
    Hi,

    I am submitting a Hadoop M/R job using OOZIE java client API. But, the job
    seems running continuously without stopping. It ran for quite some time,
    and ended prematurely throwing an exception of "Optimistic Lock". Can you
    please help?

    Below is the code:


    package com.example.oozie.client;
    import org.apache.oozie.client.OozieClient;import
    org.apache.oozie.client.OozieClientException;import
    org.apache.oozie.client.WorkflowJob;
    import java.util.Properties;
    public class OozieClientDemo {
    public static void main(String[] args) throws
    OozieClientException,
    InterruptedException { OozieClient wc = new
    OozieClient("http://localhost:11000/oozie/");
    Properties conf = wc.createConfiguration();

    conf.setProperty(OozieClient.APP_PATH,
    "hdfs://localhost:8020/user/root/examples/apps/map-reduce/workflow.xml");
    conf.setProperty("jobTracker", "localhost:8021");
    conf.setProperty("nameNode",
    "hdfs://localhost:8020");
    conf.setProperty("inputDir", "/oozie/inputdir");
    conf.setProperty("outputDir", "/oozie/outputdir");
    String jobId =
    wc.run(conf); System.out.println("Work flow
    submitted");
    while (wc.getJobInfo(jobId).getStatus() ==
    WorkflowJob.Status.RUNNING) {
    System.out.println("Workflow job
    running..."); Thread.sleep(10 *
    1000); }
    System.out.println("Workflow job
    completed");
    System.out.println(wc.getJobInfo(jobId));
    }
    }




    Regards,
    Shouvanik
  • Darren Lo at Apr 15, 2013 at 5:32 pm
    This sounds like a question about Oozie, not Cloudera Manager. Moving to
    cdh-user (bcc scm-users).

    On Mon, Apr 15, 2013 at 6:12 AM, Serega Sheypak wrote:

    Provide your xml workflow please
    15.04.2013 11:04 пользователь "Shouvanik Haldar" <
    shouvanik.haldar@gmail.com> написал:

    Hi,
    I am submitting a Hadoop M/R job using OOZIE java client API. But, the
    job seems running continuously without stopping. It ran for quite some
    time, and ended prematurely throwing an exception of "Optimistic Lock". Can
    you please help?

    Below is the code:


    package com.example.oozie.client;
    import org.apache.oozie.client.OozieClient;import
    org.apache.oozie.client.OozieClientException;import
    org.apache.oozie.client.WorkflowJob;
    import java.util.Properties;
    public class OozieClientDemo {
    public static void main(String[] args) throws
    OozieClientException,
    InterruptedException { OozieClient wc = new
    OozieClient("http://localhost:11000/oozie/");
    Properties conf = wc.createConfiguration();

    conf.setProperty(OozieClient.APP_PATH,
    "hdfs://localhost:8020/user/root/examples/apps/map-reduce/workflow.xml");
    conf.setProperty("jobTracker", "localhost:8021");
    conf.setProperty("nameNode",
    "hdfs://localhost:8020");
    conf.setProperty("inputDir", "/oozie/inputdir");
    conf.setProperty("outputDir", "/oozie/outputdir");
    String jobId =
    wc.run(conf); System.out.println("Work flow
    submitted");
    while (wc.getJobInfo(jobId).getStatus() ==
    WorkflowJob.Status.RUNNING) {
    System.out.println("Workflow job
    running..."); Thread.sleep(10 *
    1000); }
    System.out.println("Workflow job
    completed");
    System.out.println(wc.getJobInfo(jobId));
    }
    }




    Regards,
    Shouvanik

    --
    Thanks,
    Darren

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscm-users @
categorieshadoop
postedApr 15, '13 at 9:04a
activeApr 15, '13 at 5:32p
posts3
users3
websitecloudera.com
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase