diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-02-15 22:09:24 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-02-15 22:09:24 -0800 |
commit | beb7ab870858541d736033cc3c6fad4dad657aa3 (patch) | |
tree | d8e2ca6c1c3b4b228f5b584ef2f4526699349121 | |
parent | 3bcc6e5c0395b7478bc19572cbef3958f13daf6e (diff) | |
parent | 893bad90899c5c7edddc5e824f41a975c33571bf (diff) | |
download | spark-beb7ab870858541d736033cc3c6fad4dad657aa3.tar.gz spark-beb7ab870858541d736033cc3c6fad4dad657aa3.tar.bz2 spark-beb7ab870858541d736033cc3c6fad4dad657aa3.zip |
Merge pull request #467 from squito/executor_job_id
include jobid in Executor commandline args
-rw-r--r-- | core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala | 2 | ||||
-rw-r--r-- | core/src/main/scala/spark/executor/StandaloneExecutorBackend.scala | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala b/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala index 4ef637090c..69f34e604a 100644 --- a/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala +++ b/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala @@ -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 */ diff --git a/core/src/main/scala/spark/executor/StandaloneExecutorBackend.scala b/core/src/main/scala/spark/executor/StandaloneExecutorBackend.scala index 224c126fdd..9a82c3054c 100644 --- a/core/src/main/scala/spark/executor/StandaloneExecutorBackend.scala +++ b/core/src/main/scala/spark/executor/StandaloneExecutorBackend.scala @@ -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> [<appid>]") System.exit(1) } run(args(0), args(1), args(2), args(3).toInt) |