Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-9154 Few improvements/bug fixes in offline image viewer and offline edit viewer
  3. HDFS-9157

[OEV and OIV] : Unnecessary parsing for mandatory arguements if "-h" option is specified as the only option

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In both tools, if "-h" is specified as the only option, it throws error as input and output not specified.

      master:/home/nijel/hadoop-3.0.0-SNAPSHOT/bin # ./hdfs oev -h
      Error parsing command-line options: Missing required options: o, i
      Usage: bin/hdfs oev [OPTIONS] -i INPUT_FILE -o OUTPUT_FILE
      

      In code the parsing is happening before the "-h" option is verified
      Can add code to return after initial check.

          if (argv.length == 1 && argv[1] == "-h") {
            printHelp();
            return 0;
          }
      

        Attachments

        1. HDFS-9157_6.patch
          8 kB
          nijel
        2. HDFS-9157_5.patch
          8 kB
          nijel
        3. HDFS-9157_4.patch
          8 kB
          nijel
        4. HDFS-9157_3.patch
          9 kB
          nijel
        5. HDFS-9157_2.patch
          9 kB
          nijel
        6. HDFS-9157_1.patch
          9 kB
          nijel

          Activity

            People

            • Assignee:
              nijel nijel
              Reporter:
              nijel nijel
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: