Skip to content

Commit de81da2

Browse files
author
Marcelo Vanzin
committed
Fix CommandUtils.
1 parent 86a87bf commit de81da2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/src/main/scala/org/apache/spark/deploy/worker/CommandUtils.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object CommandUtils extends Logging {
5959
private def buildCommandSeq(command: Command, memory: Int, sparkHome: String): Seq[String] = {
6060
// SPARK-698: do not call the run.cmd script, as process.destroy()
6161
// fails to kill a process tree on Windows
62-
val cmd = new CommandLauncher(sparkHome, memory, command.environment).buildCommand()
62+
val cmd = new CommandLauncher(sparkHome, memory, command).buildCommand()
6363
cmd.toSeq ++ Seq(command.mainClass) ++ command.arguments
6464
}
6565

@@ -111,15 +111,16 @@ object CommandUtils extends Logging {
111111
}
112112
}
113113

114-
private class CommandLauncher(sparkHome: String, memoryMb: Int, env: Map[String, String])
115-
extends AbstractLauncher[CommandLauncher](env) {
114+
private class CommandLauncher(sparkHome: String, memoryMb: Int, command: Command)
115+
extends AbstractLauncher[CommandLauncher](command.environment) {
116116

117117
setSparkHome(sparkHome)
118118

119119
def buildCommand(): JList[String] = {
120-
val cmd = buildJavaCommand(null)
120+
val cmd = buildJavaCommand(command.classPathEntries.mkString(File.pathSeparator))
121121
cmd.add(s"-Xms${memoryMb}M")
122122
cmd.add(s"-Xmx${memoryMb}M")
123+
command.javaOpts.foreach { cmd.add }
123124
addOptionString(cmd, getenv("SPARK_JAVA_OPTS"))
124125
cmd
125126
}

0 commit comments

Comments
 (0)