diff options
author | EugenCepoi <cepoi.eugen@gmail.com> | 2014-10-03 10:03:15 -0700 |
---|---|---|
committer | Andrew Or <andrewor14@gmail.com> | 2014-10-03 10:03:15 -0700 |
commit | f0811f928e5b608e1a2cba3b6828ba0ed03b701d (patch) | |
tree | 97a17a42d3825dcadf332a4d510d24deb973d00c /bin | |
parent | 2e4eae3a52e3d04895b00447d1ac56ae3c1b98ae (diff) | |
download | spark-f0811f928e5b608e1a2cba3b6828ba0ed03b701d.tar.gz spark-f0811f928e5b608e1a2cba3b6828ba0ed03b701d.tar.bz2 spark-f0811f928e5b608e1a2cba3b6828ba0ed03b701d.zip |
SPARK-2058: Overriding SPARK_HOME/conf with SPARK_CONF_DIR
Update of PR #997.
With this PR, setting SPARK_CONF_DIR overrides SPARK_HOME/conf (not only spark-defaults.conf and spark-env).
Author: EugenCepoi <cepoi.eugen@gmail.com>
Closes #2481 from EugenCepoi/SPARK-2058 and squashes the following commits:
0bb32c2 [EugenCepoi] use orElse orNull and fixing trailing percent in compute-classpath.cmd
77f35d7 [EugenCepoi] SPARK-2058: Overriding SPARK_HOME/conf with SPARK_CONF_DIR
Diffstat (limited to 'bin')
-rw-r--r-- | bin/compute-classpath.cmd | 8 | ||||
-rwxr-xr-x | bin/compute-classpath.sh | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/bin/compute-classpath.cmd b/bin/compute-classpath.cmd index 5ad52452a5..9b9e40321e 100644 --- a/bin/compute-classpath.cmd +++ b/bin/compute-classpath.cmd @@ -36,7 +36,13 @@ rem Load environment variables from conf\spark-env.cmd, if it exists if exist "%FWDIR%conf\spark-env.cmd" call "%FWDIR%conf\spark-env.cmd"
rem Build up classpath
-set CLASSPATH=%SPARK_CLASSPATH%;%SPARK_SUBMIT_CLASSPATH%;%FWDIR%conf
+set CLASSPATH=%SPARK_CLASSPATH%;%SPARK_SUBMIT_CLASSPATH%
+
+if "x%SPARK_CONF_DIR%"!="x" (
+ set CLASSPATH=%CLASSPATH%;%SPARK_CONF_DIR%
+) else (
+ set CLASSPATH=%CLASSPATH%;%FWDIR%conf
+)
if exist "%FWDIR%RELEASE" (
for %%d in ("%FWDIR%lib\spark-assembly*.jar") do (
diff --git a/bin/compute-classpath.sh b/bin/compute-classpath.sh index 0f63e36d8a..905bbaf99b 100755 --- a/bin/compute-classpath.sh +++ b/bin/compute-classpath.sh @@ -27,8 +27,14 @@ FWDIR="$(cd "`dirname "$0"`"/..; pwd)" . "$FWDIR"/bin/load-spark-env.sh +CLASSPATH="$SPARK_CLASSPATH:$SPARK_SUBMIT_CLASSPATH" + # Build up classpath -CLASSPATH="$SPARK_CLASSPATH:$SPARK_SUBMIT_CLASSPATH:$FWDIR/conf" +if [ -n "$SPARK_CONF_DIR" ]; then + CLASSPATH="$CLASSPATH:$SPARK_CONF_DIR" +else + CLASSPATH="$CLASSPATH:$FWDIR/conf" +fi ASSEMBLY_DIR="$FWDIR/assembly/target/scala-$SCALA_VERSION" |