hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asur...@apache.org
Subject hadoop git commit: YARN-5185. StageAllocaterGreedyRLE: Fix NPE in corner case. (Carlo Curino via asuresh)
Date Tue, 07 Jun 2016 04:07:29 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 06e38c835 -> f0a869b52


YARN-5185. StageAllocaterGreedyRLE: Fix NPE in corner case. (Carlo Curino via asuresh)

(cherry picked from commit 7a9b7372a1a917c7b5e1beca7e13c0419e3dbfef)


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

Branch: refs/heads/branch-2
Commit: f0a869b52a4e4ad7e02143a7e703700a4f4b1f88
Parents: 06e38c8
Author: Arun Suresh <asuresh@apache.org>
Authored: Mon Jun 6 21:06:52 2016 -0700
Committer: Arun Suresh <asuresh@apache.org>
Committed: Mon Jun 6 21:07:24 2016 -0700

----------------------------------------------------------------------
 .../planning/StageAllocatorGreedyRLE.java           | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f0a869b5/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/StageAllocatorGreedyRLE.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/reservation/planning/StageAllocatorGreedyRLE.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/StageAllocatorGreedyRLE.java
index c5a3192..5e748fc 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/StageAllocatorGreedyRLE.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/StageAllocatorGreedyRLE.java
@@ -168,12 +168,20 @@ public class StageAllocatorGreedyRLE implements StageAllocator {
       if (allocateLeft) {
         // set earliest start to the min of the constraining "range" or my the
         // end of this allocation
-        stageEarliestStart =
-            Math.min(partialMap.higherKey(minPoint), stageEarliestStart + dur);
+        if(partialMap.higherKey(minPoint) == null){
+          stageEarliestStart = stageEarliestStart + dur;
+        } else {
+          stageEarliestStart =
+             Math.min(partialMap.higherKey(minPoint), stageEarliestStart + dur);
+        }
       } else {
         // same as above moving right-to-left
-        stageDeadline =
-            Math.max(partialMap.higherKey(minPoint), stageDeadline - dur);
+        if(partialMap.higherKey(minPoint) == null){
+          stageDeadline = stageDeadline - dur;
+        } else {
+          stageDeadline =
+              Math.max(partialMap.higherKey(minPoint), stageDeadline - dur);
+        }
       }
     }
 


---------------------------------------------------------------------
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