You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 05:40:03 UTC
svn commit: r1077647 -
/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/ResourceEstimator.java
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 <ma...@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);