Github user scwf commented on a diff in the pull request:
https://github.com/apache/spark/pull/1986#discussion_r16709350
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
---
@@ -111,48 +113,43 @@ private[spark] class CoarseMesosSchedulerBackend(
def createCommand(offer: Offer, numCores: Int): CommandInfo = {
val environment = Environment.newBuilder()
- val extraClassPath = conf.getOption("spark.executor.extraClassPath")
- extraClassPath.foreach { cp =>
- environment.addVariables(
-
Environment.Variable.newBuilder().setName("SPARK_CLASSPATH").setValue(cp).build())
- }
+ val mesosCommand = CommandInfo.newBuilder()
+ .setEnvironment(environment)
+
+ val driverUrl = "akka.tcp://spark@%s:%s/user/%s".format(
+ conf.get("spark.driver.host"), conf.get("spark.driver.port"),
+ CoarseGrainedSchedulerBackend.ACTOR_NAME)
+ val args = Seq(driverUrl, offer.getSlaveId.getValue,
offer.getHostname, numCores.toString)
val extraJavaOpts = conf.getOption("spark.executor.extraJavaOptions")
+ .map(Utils.splitCommandString).getOrElse(Seq.empty)
- val libraryPathOption = "spark.executor.extraLibraryPath"
- val extraLibraryPath = conf.getOption(libraryPathOption).map(p =>
s"-Djava.library.path=$p")
- val extraOpts = Seq(extraJavaOpts,
extraLibraryPath).flatten.mkString(" ")
+ // Start executors with a few necessary configs for registering with
the scheduler
+ val sparkJavaOpts = Utils.sparkJavaOpts(conf,
SparkConf.isExecutorStartupConf)
+ val javaOpts = sparkJavaOpts ++ extraJavaOpts
- sc.executorEnvs.foreach { case (key, value) =>
- environment.addVariables(Environment.Variable.newBuilder()
- .setName(key)
- .setValue(value)
- .build())
+ val classPathEntries =
conf.getOption("spark.executor.extraClassPath").toSeq.flatMap { cp =>
+ cp.split(java.io.File.pathSeparator)
}
- val command = CommandInfo.newBuilder()
- .setEnvironment(environment)
- val driverUrl = "akka.tcp://spark@%s:%s/user/%s".format(
- conf.get("spark.driver.host"),
- conf.get("spark.driver.port"),
- CoarseGrainedSchedulerBackend.ACTOR_NAME)
+ val libraryPathEntries =
+ conf.getOption("spark.executor.extraLibraryPath").toSeq.flatMap { cp
=>
+ cp.split(java.io.File.pathSeparator)
+ }
+
+ val command = Command(
+ "org.apache.spark.executor.CoarseGrainedExecutorBackend", args,
sc.executorEnvs,
--- End diff --
yes, here i should set env to CommandInfo to propagate to the target
executor process.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]