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 6D372200AE4 for ; Fri, 10 Jun 2016 05:35:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6BDC8160A59; Fri, 10 Jun 2016 03:35:22 +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 B630F160A5C for ; Fri, 10 Jun 2016 05:35:21 +0200 (CEST) Received: (qmail 9871 invoked by uid 500); 10 Jun 2016 03:35:17 -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 3443 invoked by uid 99); 10 Jun 2016 03:35:12 -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; Fri, 10 Jun 2016 03:35:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6BB91EB1FC; Fri, 10 Jun 2016 03:35:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aengineer@apache.org To: common-commits@hadoop.apache.org Date: Fri, 10 Jun 2016 03:35:33 -0000 Message-Id: <3697ca2dbe43436fa872b85ba6e53c73@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [22/50] [abbrv] hadoop git commit: YARN-5185. StageAllocaterGreedyRLE: Fix NPE in corner case. (Carlo Curino via asuresh) archived-at: Fri, 10 Jun 2016 03:35:22 -0000 YARN-5185. StageAllocaterGreedyRLE: Fix NPE in corner case. (Carlo Curino via asuresh) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7a9b7372 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7a9b7372 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7a9b7372 Branch: refs/heads/HDFS-7240 Commit: 7a9b7372a1a917c7b5e1beca7e13c0419e3dbfef Parents: 6de9213 Author: Arun Suresh Authored: Mon Jun 6 21:06:52 2016 -0700 Committer: Arun Suresh Committed: Mon Jun 6 21:06:52 2016 -0700 ---------------------------------------------------------------------- .../planning/StageAllocatorGreedyRLE.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/7a9b7372/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