aboutsummaryrefslogtreecommitdiff
path: root/bin/spark-config.sh
diff options
context:
space:
mode:
authorDenny <dennybritz@gmail.com>2012-08-01 13:17:31 -0700
committerDenny <dennybritz@gmail.com>2012-08-01 20:38:52 -0700
commit0ee44c225e38abbf3382be6e9555ab9a35424a54 (patch)
tree9fc106518bf55fc27083463843e9ee591c63ee59 /bin/spark-config.sh
parent545165e8153bb516d4364f9b3df1440c6b44c01b (diff)
downloadspark-0ee44c225e38abbf3382be6e9555ab9a35424a54.tar.gz
spark-0ee44c225e38abbf3382be6e9555ab9a35424a54.tar.bz2
spark-0ee44c225e38abbf3382be6e9555ab9a35424a54.zip
Spark standalone mode cluster scripts.
Heavily inspired by Hadoop cluster scripts ;-)
Diffstat (limited to 'bin/spark-config.sh')
-rwxr-xr-xbin/spark-config.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/spark-config.sh b/bin/spark-config.sh
new file mode 100755
index 0000000000..d4b6558866
--- /dev/null
+++ b/bin/spark-config.sh
@@ -0,0 +1,19 @@
+# included in all the spark scripts with source command
+# should not be executable directly
+# also should not be passed any arguments, since we need original $*
+
+# resolve links - $0 may be a softlink
+this="${BASH_SOURCE-$0}"
+common_bin=$(cd -P -- "$(dirname -- "$this")" && pwd -P)
+script="$(basename -- "$this")"
+this="$common_bin/$script"
+
+# convert relative path to absolute path
+config_bin=`dirname "$this"`
+script=`basename "$this"`
+config_bin=`cd "$config_bin"; pwd`
+this="$config_bin/$script"
+
+export SPARK_PREFIX=`dirname "$this"`/..
+export SPARK_HOME=${SPARK_PREFIX}
+export SPARK_CONF_DIR="$SPARK_HOME/conf" \ No newline at end of file