Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10677 Über-jira: Enhancements to NNThroughputBenchmark tool
  3. HDFS-9387

Fix namenodeUri parameter parsing in NNThroughputBenchmark

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • test
    • None
    • Reviewed

    Description

      In NNThroughputBenchmark$OperationStatsBase#verifyOpArgument(), the namenodeUri is always parsed from -namenode argument. This works just fine if the -op parameter is not all, as the single benchmark will need to parse the namenodeUri from args anyway.

      When the -op is all, namely all sub-benchmark will run, multiple sub-benchmark will call the verifyOpArgument() method. In this case, the first sub-benchmark reads the namenode argument and removes it from args. The other sub-benchmarks will thereafter read null value since the argument is removed. This contradicts the intension of providing namenode for all sub-benchmarks.

      current code
            try {
              namenodeUri = StringUtils.popOptionWithArgument("-namenode", args);
            } catch (IllegalArgumentException iae) {
              printUsage();
            }
      

      The fix is to parse the namenodeUri, which is shared by all sub-benchmarks, from -namenode argument only once. This follows the convention of parsing other global arguments in OperationStatsBase#verifyOpArgument().

      simple fix
            if (args.indexOf("-namenode") >= 0) {
              try {
                namenodeUri = StringUtils.popOptionWithArgument("-namenode", args);
              } catch (IllegalArgumentException iae) {
                printUsage();
              }
            }
      

      Attachments

        1. HDFS-9387.000.patch
          1 kB
          Mingliang Liu

        Issue Links

          Activity

            People

              liuml07 Mingliang Liu
              liuml07 Mingliang Liu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: