[
https://issues.apache.org/jira/browse/HDFS-5174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13763302#comment-13763302
]
Steve Loughran commented on HDFS-5174:
--------------------------------------
I'd advocate recommend moving away from commons cli to JCommander, which is
much better: annotation & introspection driven; lets you defined automatic
converters of arguments to complex types (like paths). You can even subclass
one
* class containing both the parameters and methods to do more complex
post-processing (converting lists of triples into maps)
[https://github.com/hortonworks/hoya/blob/master/src/main/java/org/apache/hadoop/hoya/yarn/CommonArgs.java]
* subclass with some more supported parameters:
[https://github.com/hortonworks/hoya/blob/master/src/main/java/org/apache/hadoop/hoya/yarn/client/ClientArgs.java]
* package containing converters for Hadoop paths, URLs and URIs:
https://github.com/hortonworks/hoya/tree/master/src/main/java/org/apache/hadoop/hoya/tools
In that plan, for Hadoop 2.2+:
# add jcommander as a dependency
# write a tool-runner alongside the existing one, that switched to JCommander
(and ideally allowed the tools to help define the argument set, so that
validation and help message generation is combined.
Try playing with JCommander to see what you think -it's what other bits of the
Hadoop stack (e.g. Accumulo) use
> Convert DFSAdmin to use Commons CLI for parsing arguments
> ---------------------------------------------------------
>
> Key: HDFS-5174
> URL: https://issues.apache.org/jira/browse/HDFS-5174
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: scripts
> Affects Versions: 2.1.0-beta
> Reporter: Andrew Wang
> Labels: newbie
>
> Right now, DFSAdmin uses an array of different techniques to do parsing of
> command line arguments and displaying help text. It'd be better to unify
> everything to use a standard library like Commons CLI, which should clean up
> the file and reduce the amount of custom code we're carrying.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira