hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077647 - /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/ResourceEstimator.java
Date Fri, 04 Mar 2011 04:40:03 GMT
Author: omalley
Date: Fri Mar  4 04:40:02 2011
New Revision: 1077647

URL: http://svn.apache.org/viewvc?rev=1077647&view=rev
Log:
commit e5996a66b84b2d8b719100002d190c4b4898d4ca
Author: Mahadev Konar <mahadev@yahoo-inc.com>
Date:   Fri Aug 6 13:54:48 2010 -0700

    MAPREDUCE-1521. Fix overflow problem in the resource estimator. Mahadev Konar

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/ResourceEstimator.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/ResourceEstimator.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/ResourceEstimator.java?rev=1077647&r1=1077646&r2=1077647&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/ResourceEstimator.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/ResourceEstimator.java
Fri Mar  4 04:40:02 2011
@@ -73,7 +73,9 @@ class ResourceEstimator {
     } else {
       long inputSize = job.getInputLength() + job.desiredMaps(); 
       //add desiredMaps() so that randomwriter case doesn't blow up
-      long estimate = Math.round((inputSize * 
+      //the multiplication might lead to overflow, casting it with
+      //double prevents it
+      long estimate = Math.round(((double)inputSize * 
           completedMapsOutputSize * 2.0)/completedMapsInputSize);
       if (LOG.isDebugEnabled()) {
         LOG.debug("estimate total map output will be " + estimate);



Mime
View raw message