You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Daryn Sharp (Commented) (JIRA)" <ji...@apache.org> on 2012/02/13 18:31:02 UTC

[jira] [Commented] (HADOOP-5404) GenericOptionsParser should parse generic options even if they appear after Tool-specific options

    [ https://issues.apache.org/jira/browse/HADOOP-5404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206999#comment-13206999 ] 

Daryn Sharp commented on HADOOP-5404:
-------------------------------------

As commented in the linked duplicate jira, I don't think this is a good idea.  It can lead to option clashes between general options and command specific options.  This is mostly likely to occur with {{FsShell}}.
                
> GenericOptionsParser should parse generic options even if they appear after Tool-specific options
> -------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-5404
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5404
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.19.1
>         Environment: All
>            Reporter: Milind Bhandarkar
>              Labels: newbie
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira