Return-Path: X-Original-To: apmail-spark-commits-archive@minotaur.apache.org Delivered-To: apmail-spark-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C6181020F for ; Fri, 10 Jan 2014 21:35:18 +0000 (UTC) Received: (qmail 8744 invoked by uid 500); 10 Jan 2014 21:35:18 -0000 Delivered-To: apmail-spark-commits-archive@spark.apache.org Received: (qmail 8717 invoked by uid 500); 10 Jan 2014 21:35:18 -0000 Mailing-List: contact commits-help@spark.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@spark.incubator.apache.org Delivered-To: mailing list commits@spark.incubator.apache.org Received: (qmail 8710 invoked by uid 99); 10 Jan 2014 21:35:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jan 2014 21:35:18 +0000 X-ASF-Spam-Status: No, hits=-2000.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 10 Jan 2014 21:35:15 +0000 Received: (qmail 8533 invoked by uid 99); 10 Jan 2014 21:34:53 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jan 2014 21:34:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6B6F032A98D; Fri, 10 Jan 2014 21:34:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tgraves@apache.org To: commits@spark.incubator.apache.org Date: Fri, 10 Jan 2014 21:34:55 -0000 Message-Id: <1f83ae93b4a14676922d54c0b00009bf@git.apache.org> In-Reply-To: <81a56f2ddc534468996c255b805a3e3b@git.apache.org> References: <81a56f2ddc534468996c255b805a3e3b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] git commit: Update based on review comments X-Virus-Checked: Checked by ClamAV on apache.org Update based on review comments Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/9bdfbc04 Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/9bdfbc04 Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/9bdfbc04 Branch: refs/heads/master Commit: 9bdfbc0492f2d7408c250ae165763719cf290eeb Parents: 5fccd70 Author: Thomas Graves Authored: Thu Jan 9 15:45:33 2014 -0600 Committer: Thomas Graves Committed: Thu Jan 9 15:45:33 2014 -0600 ---------------------------------------------------------------------- .../apache/spark/deploy/yarn/ApplicationMaster.scala | 13 ++++++------- .../org/apache/spark/deploy/yarn/WorkerLauncher.scala | 11 +++++------ .../apache/spark/deploy/yarn/ApplicationMaster.scala | 13 ++++++------- .../org/apache/spark/deploy/yarn/WorkerLauncher.scala | 13 ++++++------- 4 files changed, 23 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/9bdfbc04/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala ---------------------------------------------------------------------- diff --git a/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala b/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala index 2bb11e5..2e46d75 100644 --- a/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala +++ b/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala @@ -127,14 +127,13 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration, // local dirs, so lets check both. We assume one of the 2 is set. // LOCAL_DIRS => 2.X, YARN_LOCAL_DIRS => 0.23.X val localDirs = Option(System.getenv("YARN_LOCAL_DIRS")) - .getOrElse(Option(System.getenv("LOCAL_DIRS")) - .getOrElse("")) - - if (localDirs.isEmpty()) { - throw new Exception("Yarn Local dirs can't be empty") + .orElse(Option(System.getenv("LOCAL_DIRS"))) + + localDirs match { + case None => throw new Exception("Yarn Local dirs can't be empty") + case Some(l) => l } - localDirs - } + } private def getApplicationAttemptId(): ApplicationAttemptId = { val envs = System.getenv() http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/9bdfbc04/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala ---------------------------------------------------------------------- diff --git a/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala b/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala index 66e38ee..62b20b8 100644 --- a/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala +++ b/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala @@ -131,13 +131,12 @@ class WorkerLauncher(args: ApplicationMasterArguments, conf: Configuration, spar // local dirs, so lets check both. We assume one of the 2 is set. // LOCAL_DIRS => 2.X, YARN_LOCAL_DIRS => 0.23.X val localDirs = Option(System.getenv("YARN_LOCAL_DIRS")) - .getOrElse(Option(System.getenv("LOCAL_DIRS")) - .getOrElse("")) - - if (localDirs.isEmpty()) { - throw new Exception("Yarn Local dirs can't be empty") + .orElse(Option(System.getenv("LOCAL_DIRS"))) + + localDirs match { + case None => throw new Exception("Yarn Local dirs can't be empty") + case Some(l) => l } - localDirs } private def getApplicationAttemptId(): ApplicationAttemptId = { http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/9bdfbc04/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala ---------------------------------------------------------------------- diff --git a/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala b/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala index 69ae14c..4b777d5 100644 --- a/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala +++ b/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala @@ -116,14 +116,13 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration, // local dirs, so lets check both. We assume one of the 2 is set. // LOCAL_DIRS => 2.X, YARN_LOCAL_DIRS => 0.23.X val localDirs = Option(System.getenv("YARN_LOCAL_DIRS")) - .getOrElse(Option(System.getenv("LOCAL_DIRS")) - .getOrElse("")) - - if (localDirs.isEmpty()) { - throw new Exception("Yarn Local dirs can't be empty") + .orElse(Option(System.getenv("LOCAL_DIRS"))) + + localDirs match { + case None => throw new Exception("Yarn Local dirs can't be empty") + case Some(l) => l } - localDirs - } + } private def getApplicationAttemptId(): ApplicationAttemptId = { val envs = System.getenv() http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/9bdfbc04/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala ---------------------------------------------------------------------- diff --git a/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala b/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala index 3e3a467..7835322 100644 --- a/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala +++ b/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/WorkerLauncher.scala @@ -117,18 +117,17 @@ class WorkerLauncher(args: ApplicationMasterArguments, conf: Configuration, spar } /** Get the Yarn approved local directories. */ - private def getLocalDirs(): String = { + private def getLocalDirs(): String = { // Hadoop 0.23 and 2.x have different Environment variable names for the // local dirs, so lets check both. We assume one of the 2 is set. // LOCAL_DIRS => 2.X, YARN_LOCAL_DIRS => 0.23.X val localDirs = Option(System.getenv("YARN_LOCAL_DIRS")) - .getOrElse(Option(System.getenv("LOCAL_DIRS")) - .getOrElse("")) + .orElse(Option(System.getenv("LOCAL_DIRS"))) - if (localDirs.isEmpty()) { - throw new Exception("Yarn Local dirs can't be empty") - } - localDirs + localDirs match { + case None => throw new Exception("Yarn Local dirs can't be empty") + case Some(l) => l + } } private def getApplicationAttemptId(): ApplicationAttemptId = {