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

support generic command-line options

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.2.0
    • 0.4.0
    • conf
    • None

    Description

      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.

      Attachments

        1. Tool.java
          0.2 kB
          Michel Tourn
        2. ToolBase.java
          2 kB
          Michel Tourn
        3. toolbase.patch
          13 kB
          Michel Tourn
        4. bashfile.patch
          0.3 kB
          Michel Tourn
        5. genericCommand.patch
          27 kB
          Hairong Kuang
        6. commons-cli-2.0-SNAPSHOT.jar
          123 kB
          Hairong Kuang

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hairong Hairong Kuang
            cutting Doug Cutting
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment