Skip to content

Commit 607539f

Browse files
committed
Address review comments
1 parent 74d087a commit 607539f

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

docs/running-on-yarn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The command to launch the Spark application on the cluster is as follows:
6262
--args <APP_MAIN_ARGUMENTS> \
6363
--num-executors <NUMBER_OF_EXECUTOR_PROCESSES> \
6464
--am-class <ApplicationMaster_CLASS>
65-
--am-memory <MEMORY_FOR_ApplicationMaster> \
65+
--driver-memory <MEMORY_FOR_ApplicationMaster> \
6666
--executor-memory <MEMORY_PER_EXECUTOR> \
6767
--executor-cores <CORES_PER_EXECUTOR> \
6868
--name <application_name> \
@@ -86,7 +86,7 @@ For example:
8686
--class org.apache.spark.examples.SparkPi \
8787
--args yarn-cluster \
8888
--num-executors 3 \
89-
--am-memory 4g \
89+
--driver-memory 4g \
9090
--executor-memory 2g \
9191
--executor-cores 1
9292

@@ -105,7 +105,7 @@ In order to tune executor cores/number/memory etc., you need to export environme
105105
* `SPARK_EXECUTOR_INSTANCES`, Number of executors to start (Default: 2)
106106
* `SPARK_EXECUTOR_CORES`, Number of cores per executor (Default: 1).
107107
* `SPARK_EXECUTOR_MEMORY`, Memory per executor (e.g. 1000M, 2G) (Default: 1G)
108-
* `SPARK_AM_MEMORY`, Memory for application master (e.g. 1000M, 2G) (Default: 512 Mb)
108+
* `SPARK_DRIVER_MEMORY`, Memory for driver (e.g. 1000M, 2G) (Default: 512 Mb)
109109
* `SPARK_YARN_APP_NAME`, The name of your application (Default: Spark)
110110
* `SPARK_YARN_QUEUE`, The YARN queue to use for allocation requests (Default: 'default')
111111
* `SPARK_YARN_DIST_FILES`, Comma separated list of files to be distributed with the job.

yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMasterArguments.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class ApplicationMasterArguments(val args: Array[String]) {
3636
var args = inputArgs
3737

3838
while (! args.isEmpty) {
39-
39+
// --num-workers, --worker-memory, and --worker-cores are deprecated since 1.0,
40+
// the properties with executor in their names are preferred.
4041
args match {
4142
case ("--jar") :: value :: tail =>
4243
userJar = value

yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientArguments.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ class ClientArguments(val args: Array[String], val sparkConf: SparkConf) {
7474
amClass = value
7575
args = tail
7676

77-
case ("--master-memory" | "--am-memory") :: MemoryParam(value) :: tail =>
77+
case ("--master-memory" | "--driver-memory") :: MemoryParam(value) :: tail =>
7878
if (args(0) == "--master-memory") {
79-
println("--master-memory is deprecated. Use --am-memory instead.")
79+
println("--master-memory is deprecated. Use --driver-memory instead.")
8080
}
8181
amMemory = value
8282
args = tail
@@ -151,7 +151,7 @@ class ClientArguments(val args: Array[String], val sparkConf: SparkConf) {
151151
" --num-executors NUM Number of executors to start (Default: 2)\n" +
152152
" --executor-cores NUM Number of cores for the executors (Default: 1).\n" +
153153
" --am-class CLASS_NAME Class Name for application master (Default: spark.deploy.yarn.ApplicationMaster)\n" +
154-
" --am-memory MEM Memory for application master (e.g. 1000M, 2G) (Default: 512 Mb)\n" +
154+
" --driver-memory MEM Memory for driver (e.g. 1000M, 2G) (Default: 512 Mb)\n" +
155155
" --executor-memory MEM Memory per executor (e.g. 1000M, 2G) (Default: 1G)\n" +
156156
" --name NAME The name of your application (Default: Spark)\n" +
157157
" --queue QUEUE The hadoop queue to use for allocation requests (Default: 'default')\n" +

yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ private[spark] class YarnClientSchedulerBackend(
5858

5959
// process any optional arguments, use the defaults already defined in ClientArguments
6060
// if things aren't specified
61-
Map("SPARK_MASTER_MEMORY" -> "--master-memory",
62-
"SPARK_AM_MEMORY" -> "--am-memory",
61+
Map("SPARK_MASTER_MEMORY" -> "--driver-memory",
62+
"SPARK_DRIVER_MEMORY" -> "--driver-memory",
6363
"SPARK_WORKER_INSTANCES" -> "--num-executors",
6464
"SPARK_WORKER_MEMORY" -> "--executor-memory",
6565
"SPARK_WORKER_CORES" -> "--executor-cores",

0 commit comments

Comments
 (0)