aboutsummaryrefslogtreecommitdiff
path: root/run
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2013-02-06 14:34:46 -0800
committerMatei Zaharia <matei@eecs.berkeley.edu>2013-02-10 21:59:41 -0800
commit05d2e94838d5b728df203d87708beaf3f4aa4c81 (patch)
treee20e3be665e13fab837d973ba20e1700676582e6 /run
parent8c66c4996220e7ea77aa9e307a744635b9576e5e (diff)
downloadspark-05d2e94838d5b728df203d87708beaf3f4aa4c81.tar.gz
spark-05d2e94838d5b728df203d87708beaf3f4aa4c81.tar.bz2
spark-05d2e94838d5b728df203d87708beaf3f4aa4c81.zip
Use a separate memory setting for standalone cluster daemons
Conflicts: docs/_config.yml
Diffstat (limited to 'run')
-rwxr-xr-xrun12
1 files changed, 12 insertions, 0 deletions
diff --git a/run b/run
index a094629449..82b1da005a 100755
--- a/run
+++ b/run
@@ -13,6 +13,18 @@ if [ -e $FWDIR/conf/spark-env.sh ] ; then
. $FWDIR/conf/spark-env.sh
fi
+if [ -z "$1" ]; then
+ echo "Usage: run <spark-class> [<args>]" >&2
+ exit 1
+fi
+
+# If this is a standalone cluster daemon, reset SPARK_JAVA_OPTS and SPARK_MEM to reasonable
+# values for that; it doesn't need a lot
+if [ "$1" = "spark.deploy.master.Master" -o "$1" = "spark.deploy.worker.Worker" ]; then
+ SPARK_MEM=${SPARK_DAEMON_MEMORY:-512m}
+ SPARK_JAVA_OPTS=$SPARK_DAEMON_JAVA_OPTS # Empty by default
+fi
+
if [ "$SPARK_LAUNCH_WITH_SCALA" == "1" ]; then
if [ `command -v scala` ]; then
RUNNER="scala"