hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Kimball <aa...@cloudera.com>
Subject Re: GenericOptionsParser warning
Date Wed, 18 Feb 2009 20:24:51 GMT
You should put this stub code in your program as the means to start your
MapReduce job:

public class Foo extends Configured implements Tool {

  public int run(String [] args) throws IOException {
    JobConf conf = new JobConf(getConf(), Foo.class);
    // run the job here.
    return 0;
  }

  public static void main(String [] args) throws Exception {
    int ret = ToolRunner.run(new Foo(), args); // calls your run() method.
    System.exit(ret);
  }
}


On Wed, Feb 18, 2009 at 7:09 AM, Rasit OZDAS <rasitozdas@gmail.com> wrote:

> Hi,
> There is a JIRA issue about this problem, if I understand it correctly:
> https://issues.apache.org/jira/browse/HADOOP-3743
>
> Strange, that I searched all source code, but there exists only this
> control
> in 2 places:
>
> if (!(job.getBoolean("mapred.used.genericoptionsparser", false))) {
>      LOG.warn("Use GenericOptionsParser for parsing the arguments. " +
>               "Applications should implement Tool for the same.");
>    }
>
> Just an if block for logging, no extra controls.
> Am I missing something?
>
> If your class implements Tool, than there shouldn't be a warning.
>
> Cheers,
> Rasit
>
> 2009/2/18 Steve Loughran <stevel@apache.org>
>
> > Sandhya E wrote:
> >
> >> Hi All
> >>
> >> I prepare my JobConf object in a java class, by calling various set
> >> apis in JobConf object. When I submit the jobconf object using
> >> JobClient.runJob(conf), I'm seeing the warning:
> >> "Use GenericOptionsParser for parsing the arguments. Applications
> >> should implement Tool for the same". From hadoop sources it looks like
> >> setting "mapred.used.genericoptionsparser" will prevent this warning.
> >> But if I set this flag to true, will it have some other side effects.
> >>
> >> Thanks
> >> Sandhya
> >>
> >
> > Seen this message too -and it annoys me; not tracked it down
> >
>
>
>
> --
> M. Raşit ÖZDAŞ
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message