Hadoop Common
  1. Hadoop Common
  2. HADOOP-8052

Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0, 0.23.0
    • Fix Version/s: 1.0.1, 0.23.1
    • Component/s: metrics
    • Labels:
      None

      Description

      Ganglia's gmetad converts the doubles emitted by Hadoop's Metrics2 system to strings, and the buffer it uses is 256 bytes wide.

      When the SampleStat.MinMax class (in org.apache.hadoop.metrics2.util) emits its default min value (currently initialized to Double.MAX_VALUE), it ends up causing a buffer overflow in gmetad, which causes it to core, effectively rendering Ganglia useless (for some, the core is continuous; for others who are more fortunate, it's only a one-time Hadoop-startup-time thing).

      The fix needed to Ganglia is simple - the buffer needs to be bumped up to be 512 bytes wide, and all will be well - but instead of requiring a minimum version of Ganglia to work with Hadoop's Metrics2 system, it might be more prudent to just use Float.MAX_VALUE.

      An additional problem caused in librrd (which Ganglia uses beneath-the-covers) by the use of Double.MIN_VALUE (which functions as the default max value) is an underflow when librrd runs the received strings through libc's strtod(), but the librrd code is good enough to check for this, and only emits a warning - moving to Float.MIN_VALUE fixes that as well.

      1. HADOOP-8052-branch-1.patch
        1 kB
        Varun Kapoor
      2. HADOOP-8052.patch
        1 kB
        Varun Kapoor
      3. HADOOP-8052-branch-1.patch
        3 kB
        Varun Kapoor
      4. HADOOP-8052.patch
        3 kB
        Varun Kapoor

        Activity

        Hide
        Mahadev konar added a comment -

        Merged this into 0.23.1.

        Show
        Mahadev konar added a comment - Merged this into 0.23.1.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-0.23-Build #167 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/167/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206)

        Result = FAILURE
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-0.23-Build #167 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/167/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206) Result = FAILURE mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206 Files : /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #954 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/954/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207)

        Result = FAILURE
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #954 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/954/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207) Result = FAILURE mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-0.23-Build #190 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Build/190/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206)

        Result = FAILURE
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-0.23-Build #190 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Build/190/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206) Result = FAILURE mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206 Files : /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #987 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/987/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207)

        Result = FAILURE
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #987 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/987/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207) Result = FAILURE mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #1729 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1729/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207)

        Result = SUCCESS
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #1729 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1729/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207) Result = SUCCESS mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-0.23-Commit #546 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Commit/546/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206)

        Result = SUCCESS
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-0.23-Commit #546 (See https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Commit/546/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206) Result = SUCCESS mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206 Files : /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #1792 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1792/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207)

        Result = SUCCESS
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #1792 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1792/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207) Result = SUCCESS mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #1718 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1718/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207)

        Result = SUCCESS
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #1718 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1718/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243207) Result = SUCCESS mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243207 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-0.23-Commit #542 (See https://builds.apache.org/job/Hadoop-Common-0.23-Commit/542/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206)

        Result = SUCCESS
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-0.23-Commit #542 (See https://builds.apache.org/job/Hadoop-Common-0.23-Commit/542/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206) Result = SUCCESS mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206 Files : /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-0.23-Commit #530 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Commit/530/)
        HADOOP-8052. Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206)

        Result = SUCCESS
        mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-0.23-Commit #530 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Commit/530/ ) HADOOP-8052 . Hadoop Metrics2 should emit Float.MAX_VALUE (instead of Double.MAX_VALUE) to avoid making Ganglia's gmetad core. Contributed by Varun Kapoor. (Revision 1243206) Result = SUCCESS mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1243206 Files : /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/SampleStat.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/util/TestSampleStat.java
        Hide
        Matt Foley added a comment -

        +1. Okay, I see now how this is a sufficient fix. I'm going to comment them so future developers won't think the type/size mismatch is a mistake, then commit to 1.0 and trunk/0.23. Thanks, Varun!

        Show
        Matt Foley added a comment - +1. Okay, I see now how this is a sufficient fix. I'm going to comment them so future developers won't think the type/size mismatch is a mistake, then commit to 1.0 and trunk/0.23. Thanks, Varun!
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12514037/HADOOP-8052.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in .

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/584//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/584//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12514037/HADOOP-8052.patch against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in . +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/584//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/584//console This message is automatically generated.
        Hide
        Varun Kapoor added a comment -

        I chose to not change the data type housed in the MinMax class because that would, as is alluded to by your helpful hint about clipping, be a much bigger change with a wider-reaching impact.

        Instead, my justification for just changing the default values of 'max' and 'min' to Float.MIN_VALUE and Float.MAX_VALUE, respectively, is:

        a) It is the smallest required change that fixes both problems with gmetad I mentioned in my original description.
        b) It will likely be rare that we emit metrics outside of the range of [E-38:E+38], so the regions on the number line outside of that range (that Double.MAX_VALUE and Double.MIN_VALUE provide access to) are not really needed.

        Also, I've left the types of the 2 new constants as 'double' in case we ever want to move back to using Double's extremes in the future - my current fix signifies (or at least I hope it does) that the only change we're making is in the default values of the 'min' and 'max' fields.

        Show
        Varun Kapoor added a comment - I chose to not change the data type housed in the MinMax class because that would, as is alluded to by your helpful hint about clipping, be a much bigger change with a wider-reaching impact. Instead, my justification for just changing the default values of 'max' and 'min' to Float.MIN_VALUE and Float.MAX_VALUE, respectively, is: a) It is the smallest required change that fixes both problems with gmetad I mentioned in my original description. b) It will likely be rare that we emit metrics outside of the range of [E-38:E+38] , so the regions on the number line outside of that range (that Double.MAX_VALUE and Double.MIN_VALUE provide access to) are not really needed. Also, I've left the types of the 2 new constants as 'double' in case we ever want to move back to using Double's extremes in the future - my current fix signifies (or at least I hope it does) that the only change we're making is in the default values of the 'min' and 'max' fields.
        Hide
        Varun Kapoor added a comment -

        Patch against trunk

        Show
        Varun Kapoor added a comment - Patch against trunk
        Hide
        Varun Kapoor added a comment -

        Patch against branch-1

        Show
        Varun Kapoor added a comment - Patch against branch-1
        Hide
        Matt Foley added a comment -

        If the size of the constants is being reduced from double to float, the private variables min and max and the public method max() should also become float, shouldn't they?

        Since the inputs can be double, I would also recommend doing clipping functions in appropriate places to prevent NaN ("Infinity") results from over/underflow, eg "if (value > Float.MAX_VALUE) value = Float.MAX_VALUE;" etc., where "value" is a double.

        Show
        Matt Foley added a comment - If the size of the constants is being reduced from double to float, the private variables min and max and the public method max() should also become float, shouldn't they? Since the inputs can be double, I would also recommend doing clipping functions in appropriate places to prevent NaN ("Infinity") results from over/underflow, eg "if (value > Float.MAX_VALUE) value = Float.MAX_VALUE;" etc., where "value" is a double.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12514006/HADOOP-8052.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these unit tests:
        org.apache.hadoop.metrics2.util.TestSampleStat

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/582//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/582//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12514006/HADOOP-8052.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests: org.apache.hadoop.metrics2.util.TestSampleStat +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/582//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/582//console This message is automatically generated.
        Hide
        Varun Kapoor added a comment -

        Patch against trunk

        Show
        Varun Kapoor added a comment - Patch against trunk
        Hide
        Varun Kapoor added a comment -

        Patch against branch-1

        Show
        Varun Kapoor added a comment - Patch against branch-1

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development