aboutsummaryrefslogtreecommitdiff
path: root/bin/spark-submit
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2014-05-11 18:17:34 -0700
committerAaron Davidson <aaron@databricks.com>2014-05-11 18:17:34 -0700
commit05c9aa9eb1b7f13cd40bbca23e6bc7e1d20e91cd (patch)
tree7d00d9600f618f2d65cd8e8dbbf97de6cfe2d2ba /bin/spark-submit
parent7d9cc9214bd06495f6838e355331dd2b5f1f7407 (diff)
downloadspark-05c9aa9eb1b7f13cd40bbca23e6bc7e1d20e91cd.tar.gz
spark-05c9aa9eb1b7f13cd40bbca23e6bc7e1d20e91cd.tar.bz2
spark-05c9aa9eb1b7f13cd40bbca23e6bc7e1d20e91cd.zip
SPARK-1652: Set driver memory correctly in spark-submit.
The previous check didn't account for the fact that the default deploy mode is "client" unless otherwise specified. Also, this sets the more narrowly defined SPARK_DRIVER_MEMORY instead of setting SPARK_MEM. Author: Patrick Wendell <pwendell@gmail.com> Closes #730 from pwendell/spark-submit and squashes the following commits: 430b98f [Patrick Wendell] Feedback from Aaron e788edf [Patrick Wendell] Changes based on Aaron's feedback f508146 [Patrick Wendell] SPARK-1652: Set driver memory correctly in spark-submit.
Diffstat (limited to 'bin/spark-submit')
-rwxr-xr-xbin/spark-submit6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/spark-submit b/bin/spark-submit
index 49bc26252c..63903b17a2 100755
--- a/bin/spark-submit
+++ b/bin/spark-submit
@@ -35,8 +35,10 @@ while (($#)); do
shift
done
-if [ ! -z $DRIVER_MEMORY ] && [ ! -z $DEPLOY_MODE ] && [ $DEPLOY_MODE = "client" ]; then
- export SPARK_MEM=$DRIVER_MEMORY
+DEPLOY_MODE=${DEPLOY_MODE:-"client"}
+
+if [ -n "$DRIVER_MEMORY" ] && [ $DEPLOY_MODE == "client" ]; then
+ export SPARK_DRIVER_MEMORY=$DRIVER_MEMORY
fi
$SPARK_HOME/bin/spark-class org.apache.spark.deploy.SparkSubmit "${ORIG_ARGS[@]}"