Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-1312 Re-balance disks within a Datanode
  3. HDFS-10551

o.a.h.h.s.diskbalancer.command.Command does not actually verify options as expected.

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In diskbalancer.command.Command#verifyCommandOptions. The following code does not do what it expected to do:

      if (!validArgs.containsKey(opt.getArgName())) {
      

      opt.getArgName() always returns "arg" instead of i.e., report or uri, which is the expected parameter to check.

      It should use opt.getLongOpt() to get the option names. It can pass on the branch because opt.getArgName() always returns "arg", which is accidently in validArgs. However I don't think it is the intention for this function.

      Additionally, in the following code

      validArguments.append("Valid arguments are : %n");
      

      This %n is not used.

        Attachments

        1. HDFS-10551-HDFS-1312.001.patch
          12 kB
          Anu Engineer
        2. HDFS-10551-HDFS-1312.002.patch
          12 kB
          Anu Engineer
        3. HDFS-10551-HDFS-1312.003.patch
          13 kB
          Anu Engineer
        4. HDFS-10551-HDFS-1312.004.patch
          14 kB
          Anu Engineer

          Activity

            People

            • Assignee:
              aengineer Anu Engineer
              Reporter:
              eddyxu Lei (Eddy) Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: