Repository: spark
Updated Branches:
  refs/heads/branch-1.0 5d696996d -> 2eea663f5


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 <pwend...@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.

(cherry picked from commit 05c9aa9eb1b7f13cd40bbca23e6bc7e1d20e91cd)
Signed-off-by: Aaron Davidson <aa...@databricks.com>


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

Branch: refs/heads/branch-1.0
Commit: 2eea663f5d56e30a8a620591fc50c8891a0d81fe
Parents: 5d69699
Author: Patrick Wendell <pwend...@gmail.com>
Authored: Sun May 11 18:17:34 2014 -0700
Committer: Aaron Davidson <aa...@databricks.com>
Committed: Sun May 11 18:17:46 2014 -0700

----------------------------------------------------------------------
 bin/spark-submit | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/2eea663f/bin/spark-submit
----------------------------------------------------------------------
diff --git a/bin/spark-submit b/bin/spark-submit
index 49bc262..63903b1 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[@]}"

Reply via email to