hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject hadoop git commit: YARN-6764. Simplify the logic in FairScheduler#attemptScheduling. Contributed by Yufei Gu.
Date Sun, 09 Jul 2017 23:14:33 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 5f603306d -> 20a2770d7


YARN-6764. Simplify the logic in FairScheduler#attemptScheduling. Contributed by Yufei Gu.

(cherry picked from commit 3de47ab5ea5cb75805a03010dc72e11b0cf6c173)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/20a2770d
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/20a2770d
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/20a2770d

Branch: refs/heads/branch-2
Commit: 20a2770d72c1835d2adfa3079925566524245751
Parents: 5f60330
Author: Yufei Gu <yufei@apache.org>
Authored: Sun Jul 9 16:08:37 2017 -0700
Committer: Yufei Gu <yufei@apache.org>
Committed: Sun Jul 9 16:11:26 2017 -0700

----------------------------------------------------------------------
 .../resourcemanager/scheduler/fair/FairScheduler.java    | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/20a2770d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java
index 8ec715f..cadbf76 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java
@@ -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;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message