Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-5404

GenericOptionsParser should parse generic options even if they appear after Tool-specific options

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 0.19.1
    • None
    • util
    • All

    Description

      Currently, when GenericOptionsParser encounters an unrecognized option, it stops processing command-line arguments, and returns the rest to the specific Tool. This forces users to remember the order of arguments, and leads to errors such as following:

      org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option:
      -Dmapred.reduce.tasks=4
      at org.apache.commons.cli.Parser.processOption(Parser.java:368)
      at org.apache.commons.cli.Parser.parse(Parser.java:185)
      at org.apache.commons.cli.Parser.parse(Parser.java:70)
      at
      MyTool.run(MyTool.java.java:290)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
      at
      MyTool.main(MyTool.java:19)

      In Hadoop-streaming as well, -D parameters should appear before streaming-specific arguments, such as -mapper, -reducer etc.

      If GenericOptionsParser were to scan the entire command-line, ignoring unrecognized (tool-specific) options, and returning all unrecognized options back to the tool, this problem would be solved.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              milindb Milind Barve
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: