Skip to content

Commit

Permalink
Provide more REST-like interface for submit/kill/status
Browse files Browse the repository at this point in the history
As of this commit, the REST clients and servers communicate more
information through the URL. In particular, this commit introduces
the following mappings:

(1) submit -> POST /submissions/create
(2) kill -> POST /submissions/kill/[submissionId]
(3) status -> GET /submissions/get/[submissionId]

This commit also replaces any references to "driver" with
"submission" where possible. It also involves refactoring the
message classes to adopt the new scheme.
  • Loading branch information
Andrew Or committed Feb 4, 2015
1 parent 581f7bf commit 721819f
Show file tree
Hide file tree
Showing 12 changed files with 570 additions and 649 deletions.
12 changes: 6 additions & 6 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ object SparkSubmit {
*/
private def kill(args: SparkSubmitArguments): Unit = {
val client = new StandaloneRestClient
val response = client.killDriver(args.master, args.driverToKill)
val response = client.killSubmission(args.master, args.driverToKill)
response match {
case k: KillDriverResponse => handleRestResponse(k)
case k: KillSubmissionResponse => handleRestResponse(k)
case r => handleUnexpectedRestResponse(r)
}
}
Expand All @@ -109,9 +109,9 @@ object SparkSubmit {
*/
private def requestStatus(args: SparkSubmitArguments): Unit = {
val client = new StandaloneRestClient
val response = client.requestDriverStatus(args.master, args.driverToRequestStatusFor)
val response = client.requestSubmissionStatus(args.master, args.driverToRequestStatusFor)
response match {
case s: DriverStatusResponse => handleRestResponse(s)
case s: SubmissionStatusResponse => handleRestResponse(s)
case r => handleUnexpectedRestResponse(r)
}
}
Expand All @@ -135,9 +135,9 @@ object SparkSubmit {
if (args.isStandaloneCluster && args.isRestEnabled) {
printStream.println("Running Spark using the REST application submission protocol.")
val client = new StandaloneRestClient
val response = client.submitDriver(args)
val response = client.createSubmission(args)
response match {
case s: SubmitDriverResponse => handleRestResponse(s)
case s: CreateSubmissionResponse => handleRestResponse(s)
case r => handleUnexpectedRestResponse(r)
}
} else {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 721819f

Please sign in to comment.