Skip to content

Commit

Permalink
SPARK-1652: Set driver memory correctly in spark-submit.
Browse files Browse the repository at this point in the history
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 <[email protected]>

Closes apache#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.
  • Loading branch information
pwendell authored and aarondav committed May 12, 2014
1 parent 7d9cc92 commit 05c9aa9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/spark-submit
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]}"
Expand Down

0 comments on commit 05c9aa9

Please sign in to comment.