Skip to content

Commit ffa00fe

Browse files
committed
Review feedback
1 parent fda0301 commit ffa00fe

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

core/src/main/scala/org/apache/spark/SparkConf.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging {
225225
// Validate spark.executor.extraJavaOptions
226226
settings.get(executorOptsKey).map { javaOpts =>
227227
if (javaOpts.contains("-Dspark")) {
228-
val msg = s"$executorOptsKey is not allowed to set Spark options. Was '$javaOpts'"
228+
val msg = s"$executorOptsKey is not allowed to set Spark options (was '$javaOpts)'. " +
229+
"Set them directly on a SparkConf or in a properties file when using ./bin/spark-submit."
229230
throw new Exception(msg)
230231
}
231232
if (javaOpts.contains("-Xmx") || javaOpts.contains("-Xms")) {
@@ -245,7 +246,7 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging {
245246
|Please instead use:
246247
| - ./spark-submit with conf/spark-defaults.conf to set properties for an application
247248
| - ./spark-submit with --driver-java-options to set -X options for a driver
248-
| - spark.executor.executor.extraJavaOptions to set -X options for executors
249+
| - spark.executor.extraJavaOptions to set -X options for executors
249250
| - SPARK_DAEMON_OPTS to set java options for standalone daemons (i.e. master, worker)
250251
""".stripMargin
251252
logError(error)
@@ -268,7 +269,7 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging {
268269
|
269270
|Please instead use:
270271
| - ./spark-submit with --driver-class-path to augment the driver classpath
271-
| - spark.executor.executor.extraClassPath to augment the executor classpath
272+
| - spark.executor.extraClassPath to augment the executor classpath
272273
""".stripMargin
273274
logError(error)
274275

core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@
1717

1818
package org.apache.spark.deploy
1919

20-
import java.io.{IOException, FileInputStream, PrintStream, File}
20+
import java.io.{File, FileInputStream, IOException, PrintStream}
2121
import java.net.URL
2222
import java.util.Properties
2323

24-
import org.apache.spark.executor.ExecutorURLClassLoader
25-
2624
import scala.collection.JavaConversions._
27-
import scala.collection.mutable.ArrayBuffer
28-
import scala.collection.mutable.HashMap
29-
import scala.collection.mutable.Map
25+
import scala.collection.mutable.{ArrayBuffer, HashMap, Map}
26+
3027
import org.apache.spark.SparkException
28+
import org.apache.spark.executor.ExecutorURLClassLoader
3129

3230
/**
3331
* Scala code behind the spark-submit script. The script handles setting up the classpath with
@@ -114,7 +112,7 @@ object SparkSubmit {
114112

115113
// Load system properties by default from the file, if present
116114
if (appArgs.verbose) printStream.println(s"Using properties file: ${appArgs.propertiesFile}")
117-
Option(appArgs.propertiesFile).map { filename =>
115+
Option(appArgs.propertiesFile).foreach { filename =>
118116
val file = new File(filename)
119117
getDefaultProperties(file).foreach { case (k, v) =>
120118
if (k.startsWith("spark")) {
@@ -142,14 +140,12 @@ object SparkSubmit {
142140

143141
val options = List[OptionAssigner](
144142
new OptionAssigner(appArgs.master, ALL_CLUSTER_MGRS, false, sysProp = "spark.master"),
145-
146143
new OptionAssigner(appArgs.driverExtraClassPath, STANDALONE | YARN, true,
147144
sysProp = "spark.driver.extraClassPath"),
148145
new OptionAssigner(appArgs.driverExtraJavaOptions, STANDALONE | YARN, true,
149-
sysProp = "spark.driver.extraJavaOpts"),
146+
sysProp = "spark.driver.extraJavaOptions"),
150147
new OptionAssigner(appArgs.driverExtraLibraryPath, STANDALONE | YARN, true,
151148
sysProp = "spark.driver.extraLibraryPath"),
152-
153149
new OptionAssigner(appArgs.driverMemory, YARN, true, clOption = "--driver-memory"),
154150
new OptionAssigner(appArgs.name, YARN, true, clOption = "--name"),
155151
new OptionAssigner(appArgs.queue, YARN, true, clOption = "--queue"),

core/src/main/scala/org/apache/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ private[spark] class SparkDeploySchedulerBackend(
4444
val driverUrl = "akka.tcp://spark@%s:%s/user/%s".format(
4545
conf.get("spark.driver.host"), conf.get("spark.driver.port"),
4646
CoarseGrainedSchedulerBackend.ACTOR_NAME)
47-
val args = Seq(driverUrl, "{{EXECUTOR_ID}}", "{{HOSTNAME}}",
48-
"{{CORES}}", "{{WORKER_URL}}")
47+
val args = Seq(driverUrl, "{{EXECUTOR_ID}}", "{{HOSTNAME}}", "{{CORES}}", "{{WORKER_URL}}")
4948
val extraJavaOpts = sc.conf.getOption("spark.executor.extraJavaOptions")
5049
val classPathEntries = sys.props.get("spark.executor.extraClassPath").toSeq.flatMap { cp =>
5150
cp.split(java.io.File.pathSeparator)

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ Apart from these, the following properties are also available, and may be useful
662662
<td>(none)</td>
663663
<td>
664664
Extra classpath entries to append to the classpath of executors. This exists primarily
665-
for backwards-compatiblity with older versions of Spark. Users typically should not need
665+
for backwards-compatibility with older versions of Spark. Users typically should not need
666666
to set this option.
667667
</td>
668668
</tr>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ trait ClientBase extends Logging {
305305

306306
val amMemory = calculateAMMemory(newApp)
307307

308-
var JAVA_OPTS = ListBuffer[String]()
308+
val JAVA_OPTS = ListBuffer[String]()
309309

310310
// Add Xmx for AM memory
311311
JAVA_OPTS += "-Xmx" + amMemory + "m"

yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import org.apache.spark.util.Utils
4343

4444

4545
/**
46-
* An application master that runs the users driver program and allocates executors.
46+
* An application master that runs the user's driver program and allocates executors.
4747
*/
4848
class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration,
4949
sparkConf: SparkConf) extends Logging {

0 commit comments

Comments
 (0)