Return-Path: X-Original-To: apmail-hive-commits-archive@www.apache.org Delivered-To: apmail-hive-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0001F10F42 for ; Mon, 9 Feb 2015 17:17:20 +0000 (UTC) Received: (qmail 55635 invoked by uid 500); 9 Feb 2015 17:17:21 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 55590 invoked by uid 500); 9 Feb 2015 17:17:20 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 55579 invoked by uid 99); 9 Feb 2015 17:17:20 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2015 17:17:20 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id B318CAC003E for ; Mon, 9 Feb 2015 17:17:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1658473 - in /hive/branches/branch-1.1: ./ spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java Date: Mon, 09 Feb 2015 17:17:20 -0000 To: commits@hive.apache.org From: brock@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150209171720.B318CAC003E@hades.apache.org> Author: brock Date: Mon Feb 9 17:17:20 2015 New Revision: 1658473 URL: http://svn.apache.org/r1658473 Log: HIVE-9611 - Allow SPARK_HOME as well as spark.home to define sparks location (Brock via Xuefu) Modified: hive/branches/branch-1.1/ (props changed) hive/branches/branch-1.1/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java Propchange: hive/branches/branch-1.1/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 9 17:17:20 2015 @@ -3,4 +3,4 @@ /hive/branches/spark:1608589-1654414,1654553,1654869,1654873,1655427,1655468,1655926 /hive/branches/tez:1494760-1622766 /hive/branches/vectorization:1466908-1527856 -/hive/trunk:1655202,1655210,1655213,1655436,1655460,1655894-1655895,1656061,1656114,1656234,1656780,1657990,1658221 +/hive/trunk:1655202,1655210,1655213,1655436,1655460,1655894-1655895,1656061,1656114,1656234,1656780,1657990,1658221,1658471 Modified: hive/branches/branch-1.1/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java URL: http://svn.apache.org/viewvc/hive/branches/branch-1.1/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java?rev=1658473&r1=1658472&r2=1658473&view=diff ============================================================================== --- hive/branches/branch-1.1/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java (original) +++ hive/branches/branch-1.1/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java Mon Feb 9 17:17:20 2015 @@ -64,6 +64,8 @@ class SparkClientImpl implements SparkCl private static final long DEFAULT_SHUTDOWN_TIMEOUT = 10000; // In milliseconds + private static final String SPARK_HOME_ENV = "SPARK_HOME"; + private static final String SPARK_HOME_KEY = "spark.home"; private static final String DRIVER_OPTS_KEY = "spark.driver.extraJavaOptions"; private static final String EXECUTOR_OPTS_KEY = "spark.executor.extraJavaOptions"; private static final String DRIVER_EXTRA_CLASSPATH = "spark.driver.extraClassPath"; @@ -211,9 +213,12 @@ class SparkClientImpl implements SparkCl // If a Spark installation is provided, use the spark-submit script. Otherwise, call the // SparkSubmit class directly, which has some caveats (like having to provide a proper // version of Guava on the classpath depending on the deploy mode). - String sparkHome = conf.get("spark.home"); + String sparkHome = conf.get(SPARK_HOME_KEY); if (sparkHome == null) { - sparkHome = System.getProperty("spark.home"); + sparkHome = System.getenv(SPARK_HOME_ENV); + } + if (sparkHome == null) { + sparkHome = System.getProperty(SPARK_HOME_KEY); } String sparkLogDir = conf.get("hive.spark.log.dir"); if (sparkLogDir == null) {