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

org.apache.hadoop.metrics2.lib.MetricsRegistry needs numerical parameter checking

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Passing a negative value to the interval field of MetricsRegistry#newQuantiles should throw a MetricsException with a clear error message. The current stack trace looks something like:

      java.lang.IllegalArgumentException: null
      at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:420)
      at org.apache.hadoop.metrics2.lib.MutableQuantiles.<init>(MutableQuantiles.java:107)
      at org.apache.hadoop.metrics2.lib.MetricsRegistry.newQuantiles(MetricsRegistry.java:200)

      Along similar lines, should the other methods like MetricsRegistry#newCounter() also have parameter checking for negative int/long values?

      Attachments

        1. HADOOP-11104.005.patch
          3 kB
          Ray Chiang
        2. HADOOP-11104.004.patch
          3 kB
          Ray Chiang
        3. HADOOP-11104.003.patch
          3 kB
          Ray Chiang
        4. HADOOP-11104.002.patch
          5 kB
          Ray Chiang
        5. HADOOP-11104.001.patch
          5 kB
          Ray Chiang

        Activity

          People

            rchiang Ray Chiang
            rchiang Ray Chiang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: