hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1134271 - in /hadoop/mapreduce/branches/MR-279: CHANGES.txt mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
Date Fri, 10 Jun 2011 10:36:55 GMT
Author: sharad
Date: Fri Jun 10 10:36:55 2011
New Revision: 1134271

URL: http://svn.apache.org/viewvc?rev=1134271&view=rev
Log:
Fix rounding off problem in reduce ramp up.

Modified:
    hadoop/mapreduce/branches/MR-279/CHANGES.txt
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java

Modified: hadoop/mapreduce/branches/MR-279/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/CHANGES.txt?rev=1134271&r1=1134270&r2=1134271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/MR-279/CHANGES.txt Fri Jun 10 10:36:55 2011
@@ -4,6 +4,7 @@ Trunk (unreleased changes)
 
 
     MAPREDUCE-279
+    Fix rounding off problem in reduce ramp up. (sharad)
 
     MAPREDUCE-2582. Cleanup JobHistory event generation.(Siddharth Seth via sharad)   
  

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java?rev=1134271&r1=1134270&r2=1134271&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
Fri Jun 10 10:36:55 2011
@@ -287,9 +287,9 @@ public class RMContainerAllocator extend
       }
     }
     
-    int completedMapPercent = 0;
+    float completedMapPercent = 0f;
     if (totalMaps != 0) {//support for 0 maps
-      completedMapPercent = completedMaps/totalMaps;
+      completedMapPercent = (float)completedMaps/totalMaps;
     } else {
       completedMapPercent = 1;
     }
@@ -301,7 +301,7 @@ public class RMContainerAllocator extend
     
     // ramp up the reduces based on completed map percentage
     int memLimit = getMemLimit();
-    reduceMemLimit = Math.min(completedMapPercent * memLimit,
+    reduceMemLimit = Math.min((int)(completedMapPercent * memLimit),
         (int) maxReduceRampupLimit * memLimit);
     mapMemLimit = memLimit - reduceMemLimit;
 



Mime
View raw message