Skip to content
Snippets Groups Projects
Commit 8f18e7e8 authored by Imran Rashid's avatar Imran Rashid
Browse files

include jobid in Executor commandline args

parent fd7e414b
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ private[spark] class ExecutorRunner(
val command = jobDesc.command
val script = if (System.getProperty("os.name").startsWith("Windows")) "run.cmd" else "run";
val runScript = new File(sparkHome, script).getCanonicalPath
Seq(runScript, command.mainClass) ++ command.arguments.map(substituteVariables)
Seq(runScript, command.mainClass) ++ (command.arguments ++ Seq(jobId)).map(substituteVariables)
}
/** Spawn a thread that will redirect a given stream to a file */
......
......@@ -68,8 +68,9 @@ private[spark] object StandaloneExecutorBackend {
}
def main(args: Array[String]) {
if (args.length != 4) {
System.err.println("Usage: StandaloneExecutorBackend <driverUrl> <executorId> <hostname> <cores>")
if (!(args.length >= 4)) {
//the reason we allow the last frameworkId argument is to make it easy to kill rogue executors
System.err.println("Usage: StandaloneExecutorBackend <driverUrl> <executorId> <hostname> <cores> [<frameworkid>]")
System.exit(1)
}
run(args(0), args(1), args(2), args(3).toInt)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment