aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Lewandowski <lewandowski.jacek@gmail.com>2015-01-25 15:15:09 -0800
committerAndrew Or <andrew@databricks.com>2015-01-25 15:18:20 -0800
commit7652809be1ae02b4d66dcdf77b448f6d08b7d902 (patch)
treec4c8de5c7c8eda08ab23526b7d94636ddd8293dd
parenta7e99ede42aa7e6c832fe214f3ee3c9b7ec281b0 (diff)
downloadspark-7652809be1ae02b4d66dcdf77b448f6d08b7d902.tar.gz
spark-7652809be1ae02b4d66dcdf77b448f6d08b7d902.tar.bz2
spark-7652809be1ae02b4d66dcdf77b448f6d08b7d902.zip
SPARK-5382: Use SPARK_CONF_DIR in spark-class if it is defined
Author: Jacek Lewandowski <lewandowski.jacek@gmail.com> Closes #4179 from jacek-lewandowski/SPARK-5382-1.3 and squashes the following commits: 55d7791 [Jacek Lewandowski] SPARK-5382: Use SPARK_CONF_DIR in spark-class if it is defined
-rwxr-xr-xbin/spark-class5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/spark-class b/bin/spark-class
index 0d58d95c1a..3e6c367f17 100755
--- a/bin/spark-class
+++ b/bin/spark-class
@@ -29,6 +29,7 @@ FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
# Export this as SPARK_HOME
export SPARK_HOME="$FWDIR"
+export SPARK_CONF_DIR="${SPARK_CONF_DIR:-"$SPARK_HOME/conf"}"
. "$FWDIR"/bin/load-spark-env.sh
@@ -118,8 +119,8 @@ fi
JAVA_OPTS="$JAVA_OPTS -Xms$OUR_JAVA_MEM -Xmx$OUR_JAVA_MEM"
# Load extra JAVA_OPTS from conf/java-opts, if it exists
-if [ -e "$FWDIR/conf/java-opts" ] ; then
- JAVA_OPTS="$JAVA_OPTS `cat "$FWDIR"/conf/java-opts`"
+if [ -e "$SPARK_CONF_DIR/java-opts" ] ; then
+ JAVA_OPTS="$JAVA_OPTS `cat "$SPARK_CONF_DIR"/java-opts`"
fi
# Attention: when changing the way the JAVA_OPTS are assembled, the change must be reflected in CommandUtils.scala!