Updated Branches:
  refs/heads/master cf64f63f8 -> fc26e5b83

SPARK-627 - reading --config argument


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/d2c86e71
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/d2c86e71
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/d2c86e71

Branch: refs/heads/master
Commit: d2c86e718891b40e1cea8b0719462673b6b64e4e
Parents: d585613
Author: KarthikTunga <karthik.tu...@gmail.com>
Authored: Tue Oct 15 00:35:44 2013 -0700
Committer: KarthikTunga <karthik.tu...@gmail.com>
Committed: Tue Oct 15 00:35:44 2013 -0700

----------------------------------------------------------------------
 bin/slaves.sh       | 16 ++++++++++++++++
 bin/spark-daemon.sh | 17 +++++++++++++++++
 2 files changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/d2c86e71/bin/slaves.sh
----------------------------------------------------------------------
diff --git a/bin/slaves.sh b/bin/slaves.sh
index 752565b..bcb7760 100755
--- a/bin/slaves.sh
+++ b/bin/slaves.sh
@@ -46,6 +46,22 @@ bin=`cd "$bin"; pwd`
 # spark-env.sh. Save it here.
 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
   . "${SPARK_CONF_DIR}/spark-env.sh"
 fi

http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/d2c86e71/bin/spark-daemon.sh
----------------------------------------------------------------------
diff --git a/bin/spark-daemon.sh b/bin/spark-daemon.sh
index 5bfe967..48d552f 100755
--- a/bin/spark-daemon.sh
+++ b/bin/spark-daemon.sh
@@ -43,6 +43,23 @@ bin=`cd "$bin"; pwd`
 . "$bin/spark-config.sh"
 
 # 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
 shift
 command=$1

Reply via email to