Bläddra i källkod

YARN-11752: Global Scheduler: Improve the container allocation time (#7277) Contributed by Syed Shameerur Rahman.

Signed-off-by: Shilun Fan <slfan1989@apache.org>
Syed Shameerur Rahman 3 månader sedan
förälder
incheckning
c24d569a6e

+ 8 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java

@@ -604,7 +604,10 @@ public class CapacityScheduler extends
           if (candidates == null) {
             continue;
           }
-          cs.allocateContainersToNode(candidates, false);
+          int nodesPerPartitionCount = candidates.getAllNodes().size();
+          for (int i = 0; i < nodesPerPartitionCount; i++) {
+            cs.allocateContainersToNode(candidates, false);
+          }
         }
       }
 
@@ -620,7 +623,10 @@ public class CapacityScheduler extends
         if (candidates == null) {
           continue;
         }
-        cs.allocateContainersToNode(candidates, false);
+        int nodesPerPartitionCount = candidates.getAllNodes().size();
+        for (int i = 0; i < nodesPerPartitionCount; i++) {
+          cs.allocateContainersToNode(candidates, false);
+        }
       }
 
     }