[ http://issues.apache.org/jira/browse/HADOOP-59?page=comments#action_12417877 ]
Doug Cutting commented on HADOOP-59: ------------------------------------ The analogy is with the cvs and svn command line programs, which support both general options, determining which servers to talk to, etc., then command-specific options. The documentation then can be organized similarly, describing general options, then each command and its options. The set of commands is extensible (any class with a main() can be specified to bin/hadoop), and each command need only provide documentation for its options. > support generic command-line options > ------------------------------------ > > Key: HADOOP-59 > URL: http://issues.apache.org/jira/browse/HADOOP-59 > Project: Hadoop > Type: Improvement > Components: conf > Versions: 0.2.0 > Reporter: Doug Cutting > Assignee: Hairong Kuang > Priority: Minor > Fix For: 0.4.0 > Attachments: Tool.java, ToolBase.java, bashfile.patch, > commons-cli-2.0-SNAPSHOT.jar, genericCommand.patch, toolbase.patch > > Hadoop commands should all support some common options. For example, it > should be possible to specify the namenode, datanode, and, for that matter, > any config option, in a generic way. > This could be implemented with code like: > public interface Tool extends Configurable { > void run(String[] args) throws Exception; > } > public class ToolBase implements Tool extends Configured { > public final void main(String[] args) throws Exception { > Configuration conf = new Configuration(); > ... parse config options from args into conf ... > this.configure(conf); > this.run(); > } > } > public MyTool extends ExcecutableBase { > public static void main(String[] args) throws Exception { > new MyTool().main(args); > } > } > The general command line syntax could be: > bin/hadoop [generalOptions] command [commandOptions] > Where generalOptions are things that ToolBase handles, and only the > commandOptions are passed to Tool.run(). The most important generalOption > would be '-D', which would define name/value pairs that are set in the > configuration. This alone would permit folks to set the namenode, datanode, > etc. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
