hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1586795 - in /hadoop/common/branches/branch-2/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/
Date Fri, 11 Apr 2014 23:23:33 GMT
Author: sandy
Date: Fri Apr 11 23:23:33 2014
New Revision: 1586795

URL: http://svn.apache.org/r1586795
Log:
YARN-1923. Make Fair Scheduler resource ratio calculations terminate faster (Anubhav Dhoot
via Sandy Ryza)

Modified:
    hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/ComputeFairShares.java

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt?rev=1586795&r1=1586794&r2=1586795&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt Fri Apr 11 23:23:33 2014
@@ -35,6 +35,9 @@ Release 2.5.0 - UNRELEASED
     YARN-1889. In Fair Scheduler, avoid creating objects on each call to
     AppSchedulable comparator (Hong Zhiguo via Sandy Ryza)
 
+    YARN-1923. Make Fair Scheduler resource ratio calculations terminate faster
+    (Anubhav Dhoot via Sandy Ryza)
+
   OPTIMIZATIONS
 
   BUG FIXES 

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/ComputeFairShares.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/ComputeFairShares.java?rev=1586795&r1=1586794&r2=1586795&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/ComputeFairShares.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/ComputeFairShares.java
Fri Apr 11 23:23:33 2014
@@ -107,8 +107,12 @@ public class ComputeFairShares {
     double right = rMax;
     for (int i = 0; i < COMPUTE_FAIR_SHARES_ITERATIONS; i++) {
       double mid = (left + right) / 2.0;
-      if (resourceUsedWithWeightToResourceRatio(mid, schedulables, type) <
-          totalResource) {
+      int plannedResourceUsed = resourceUsedWithWeightToResourceRatio(
+          mid, schedulables, type);
+      if (plannedResourceUsed == totalResource) {
+        right = mid;
+        break;
+      } else if (plannedResourceUsed < totalResource) {
         left = mid;
       } else {
         right = mid;



Mime
View raw message