Skip to content

Commit c24d569

Browse files
authored
YARN-11752: Global Scheduler: Improve the container allocation time (#7277) Contributed by Syed Shameerur Rahman.
Signed-off-by: Shilun Fan <slfan1989@apache.org>
1 parent d2095fa commit c24d569

File tree

1 file changed

+8
-2
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,10 @@ static void schedule(CapacityScheduler cs) throws InterruptedException{
604604
if (candidates == null) {
605605
continue;
606606
}
607-
cs.allocateContainersToNode(candidates, false);
607+
int nodesPerPartitionCount = candidates.getAllNodes().size();
608+
for (int i = 0; i < nodesPerPartitionCount; i++) {
609+
cs.allocateContainersToNode(candidates, false);
610+
}
608611
}
609612
}
610613

@@ -620,7 +623,10 @@ static void schedule(CapacityScheduler cs) throws InterruptedException{
620623
if (candidates == null) {
621624
continue;
622625
}
623-
cs.allocateContainersToNode(candidates, false);
626+
int nodesPerPartitionCount = candidates.getAllNodes().size();
627+
for (int i = 0; i < nodesPerPartitionCount; i++) {
628+
cs.allocateContainersToNode(candidates, false);
629+
}
624630
}
625631

626632
}

0 commit comments

Comments
 (0)