Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 529D0200B17 for ; Tue, 7 Jun 2016 06:08:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 51529160A55; Tue, 7 Jun 2016 04:08:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 989C5160A24 for ; Tue, 7 Jun 2016 06:08:58 +0200 (CEST) Received: (qmail 86543 invoked by uid 500); 7 Jun 2016 04:08:57 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 86534 invoked by uid 99); 7 Jun 2016 04:08:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2016 04:08:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9A80BDFD4C; Tue, 7 Jun 2016 04:08:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: asuresh@apache.org To: common-commits@hadoop.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: YARN-5185. StageAllocaterGreedyRLE: Fix NPE in corner case. (Carlo Curino via asuresh) Date: Tue, 7 Jun 2016 04:08:57 +0000 (UTC) archived-at: Tue, 07 Jun 2016 04:08:59 -0000 Repository: hadoop Updated Branches: refs/heads/branch-2.8 027463652 -> 934bd8989 YARN-5185. StageAllocaterGreedyRLE: Fix NPE in corner case. (Carlo Curino via asuresh) (cherry picked from commit 7a9b7372a1a917c7b5e1beca7e13c0419e3dbfef) (cherry picked from commit f0a869b52a4e4ad7e02143a7e703700a4f4b1f88) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/934bd898 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/934bd898 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/934bd898 Branch: refs/heads/branch-2.8 Commit: 934bd8989bf4f23d7715d8a8a4b03ac453b675dc Parents: 0274636 Author: Arun Suresh Authored: Mon Jun 6 21:06:52 2016 -0700 Committer: Arun Suresh Committed: Mon Jun 6 21:08:52 2016 -0700 ---------------------------------------------------------------------- .../planning/StageAllocatorGreedyRLE.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/934bd898/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