Skip to content
Snippets Groups Projects
Commit d2c86e71 authored by KarthikTunga's avatar KarthikTunga
Browse files

SPARK-627 - reading --config argument

parent d585613e
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,22 @@ bin=`cd "$bin"; pwd` ...@@ -46,6 +46,22 @@ bin=`cd "$bin"; pwd`
# spark-env.sh. Save it here. # spark-env.sh. Save it here.
HOSTLIST=$SPARK_SLAVES HOSTLIST=$SPARK_SLAVES
#check if conf dir passed as an argument
if [ "$1" == "--config" ]
then
shift
conf_dir=$1
if [ ! -d "$conf_dir" ]
then
echo "$conf_dir is not a valid directory"
echo $usage
exit 1
else
export SPARK_CONF_DIR=$conf_dir
fi
shift
fi
if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then
. "${SPARK_CONF_DIR}/spark-env.sh" . "${SPARK_CONF_DIR}/spark-env.sh"
fi fi
......
...@@ -43,6 +43,23 @@ bin=`cd "$bin"; pwd` ...@@ -43,6 +43,23 @@ bin=`cd "$bin"; pwd`
. "$bin/spark-config.sh" . "$bin/spark-config.sh"
# get arguments # get arguments
# check if conf dir passed as an argument
if [ "$1" == "--config" ]
then
shift
conf_dir=$1
if [ ! -d "$conf_dir" ]
then
echo "$conf_dir is not a valid directory"
echo "FOUL :"$usage
exit 1
else
export SPARK_CONF_DIR=$conf_dir
fi
shift
fi
startStop=$1 startStop=$1
shift shift
command=$1 command=$1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment