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

MetricsConfig incorrectly loads the configuration whose value is String list in the properties file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.3
    • 3.2.2, 3.3.1
    • metrics
    • None

    Description

      HADOOP-15549 modified loadFirst function in MetricsConfig, and forget to set the DelimiterHandler, which caused that when loading the properties file, if the configured value is a String List, the value will not be loaded as a String Array, but just a String. For example, if we set

      *.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
      

      in hadoop-metrics2.properties. If we use conf.getStringArray("*.sink.ganglia.dmax") to get the value list, we will get an array with single element, the content of which is "jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40", which wil cause an error during loadGangliaConf. loadGangliaConf will assume that the value of jvm.metrics.threadsBlocked is "70, jvm.metrics.memHeapUsedM", which will cause an error "java.lang.NumberFormatException: For input string: "70,jvm.metrics.memHeapUsedM".

      Attachments

        1. HADOOP-16925.001.patch
          2 kB
          Jiayi Liu
        2. HADOOP-16925.002.patch
          3 kB
          Jiayi Liu

        Issue Links

          Activity

            People

              liujiayi771 Jiayi Liu
              liujiayi771 Jiayi Liu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: