Release Notes and Announcements

Hadoop GenericOptionsParser

  • 1.  Hadoop GenericOptionsParser

    Posted 04-20-2018 01:11

    I'm running the classic hadoop word count program and couldn't really figure out how GenericOptionsParser works in the following scenario.

    String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();

    Command to run the word count program:

    hadoop jar /home/hduser/WordCount/wordcount.jar WordCount input output

    From the above command, GenericOptionsParser picks up input as otherArgs[0] and output as otherArgs[1]. Why doesn't it pick up WordCount as an argument? How does it exactly work??

    I've looked at the GenericOptionsParser source code from hadoop utils but couldn't make much sense of it. Any guidance would be really helpful...

    elena kretova
    Charlotte NC