YARN-6764. Simplify the logic in FairScheduler#attemptScheduling. Contributed by Yufei Gu.
(cherry picked from commit 3de47ab5ea
)
This commit is contained in:
parent
5f603306d8
commit
20a2770d72
|
@ -1050,16 +1050,13 @@ public class FairScheduler extends
|
|||
Resource maxResourcesToAssign = Resources.multiply(
|
||||
node.getUnallocatedResource(), 0.5f);
|
||||
while (node.getReservedContainer() == null) {
|
||||
boolean assignedContainer = false;
|
||||
Resource assignment = queueMgr.getRootQueue().assignContainer(node);
|
||||
if (!assignment.equals(Resources.none())) {
|
||||
assignedContainers++;
|
||||
assignedContainer = true;
|
||||
Resources.addTo(assignedResource, assignment);
|
||||
}
|
||||
if (!assignedContainer) {
|
||||
if (assignment.equals(Resources.none())) {
|
||||
break;
|
||||
}
|
||||
|
||||
assignedContainers++;
|
||||
Resources.addTo(assignedResource, assignment);
|
||||
if (!shouldContinueAssigning(assignedContainers, maxResourcesToAssign,
|
||||
assignedResource)) {
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue