FAQ
hello all ..

i writte mapreduce in java . It works very well.
How i know a Job finished and sucess in java ?


JobConf conf = new JobConf(AverageJob.class);
conf.setJobName("AverageProductTime");

FileInputFormat.addInputPath(conf, new Path(inputDir));
FileOutputFormat.setOutputPath(conf, new Path(outputDir));

conf.setMapperClass(MapAverage.class);
conf.setReducerClass(RedAverage.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(IntWritable.class);

JobClient.runJob(conf);


if (JobClient.SUCCESS == 0)
{
... do someting ...
}

????

Thanks

Search Discussions

  • Harsh J at Mar 4, 2011 at 1:52 pm

    On Fri, Mar 4, 2011 at 6:29 PM, Alessandro Binhara wrote:
    ????

    Thanks
    JobClient.runJob returns a RunningJob object at. Use that to determine
    the result.
    Please see: http://hadoop.apache.org/common/docs/r0.20.0/api/org/apache/hadoop/mapred/RunningJob.html#isSuccessful()

    --
    Harsh J
    www.harshj.com
  • Marcos Ortiz at Mar 4, 2011 at 3:42 pm

    El 3/4/2011 7:59 AM, Alessandro Binhara escribió:
    hello all ..

    i writte mapreduce in java . It works very well.
    How i know a Job finished and sucess in java ?


    JobConf conf = new JobConf(AverageJob.class);
    conf.setJobName("AverageProductTime");

    FileInputFormat.addInputPath(conf, new Path(inputDir));
    FileOutputFormat.setOutputPath(conf, new Path(outputDir));

    conf.setMapperClass(MapAverage.class);
    conf.setReducerClass(RedAverage.class);
    conf.setOutputKeyClass(Text.class);
    conf.setOutputValueClass(IntWritable.class);

    JobClient.runJob(conf);


    if (JobClient.SUCCESS == 0)
    {
    ... do someting ...
    }

    ????

    Thanks
    Regards, Alessandro.
    I 'm going to use a example of the Pro Hadoop's book. On Chapter 2,
    Jason Venner explains the different ways to see the success of a certain
    job. The RunningJobs class has the right methods to do this. For example:
    logger.info("Launching the job...");
    /** Send the job configuration to the framework
    * and request that the job be run.
    */
    final RunningJob job = JobClient.runJob(conf);
    logger.info("The job has completed.");

    Jason says that one of the more useful methods is job.isSuccessful(). I
    recommend to you that you look on the Hadoop MapReduce API for this
    class.(RunningJob)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgeneral @
categorieshadoop
postedMar 4, '11 at 1:00p
activeMar 4, '11 at 3:42p
posts3
users3
websitehadoop.apache.org
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase