Skip to content

Commit 721819f

Browse files
author
Andrew Or
committed
Provide more REST-like interface for submit/kill/status
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.
1 parent 581f7bf commit 721819f

12 files changed

+570
-649
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ object SparkSubmit {
9696
*/
9797
private def kill(args: SparkSubmitArguments): Unit = {
9898
val client = new StandaloneRestClient
99-
val response = client.killDriver(args.master, args.driverToKill)
99+
val response = client.killSubmission(args.master, args.driverToKill)
100100
response match {
101-
case k: KillDriverResponse => handleRestResponse(k)
101+
case k: KillSubmissionResponse => handleRestResponse(k)
102102
case r => handleUnexpectedRestResponse(r)
103103
}
104104
}
@@ -109,9 +109,9 @@ object SparkSubmit {
109109
*/
110110
private def requestStatus(args: SparkSubmitArguments): Unit = {
111111
val client = new StandaloneRestClient
112-
val response = client.requestDriverStatus(args.master, args.driverToRequestStatusFor)
112+
val response = client.requestSubmissionStatus(args.master, args.driverToRequestStatusFor)
113113
response match {
114-
case s: DriverStatusResponse => handleRestResponse(s)
114+
case s: SubmissionStatusResponse => handleRestResponse(s)
115115
case r => handleUnexpectedRestResponse(r)
116116
}
117117
}
@@ -135,9 +135,9 @@ object SparkSubmit {
135135
if (args.isStandaloneCluster && args.isRestEnabled) {
136136
printStream.println("Running Spark using the REST application submission protocol.")
137137
val client = new StandaloneRestClient
138-
val response = client.submitDriver(args)
138+
val response = client.createSubmission(args)
139139
response match {
140-
case s: SubmitDriverResponse => handleRestResponse(s)
140+
case s: CreateSubmissionResponse => handleRestResponse(s)
141141
case r => handleUnexpectedRestResponse(r)
142142
}
143143
} else {

core/src/main/scala/org/apache/spark/deploy/rest/DriverStatusRequest.scala

Lines changed: 0 additions & 46 deletions
This file was deleted.

core/src/main/scala/org/apache/spark/deploy/rest/KillDriverRequest.scala

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)