Skip to content

Commit 2a28aab

Browse files
based the newest change apache#5144
1 parent 76fd411 commit 2a28aab

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

core/src/test/scala/org/apache/spark/deploy/rest/StandaloneRestSubmitSuite.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
5151
val appArgs = Array("one", "two", "three")
5252
val sparkProperties = Map("spark.app.name" -> "pi")
5353
val environmentVariables = Map("SPARK_ONE" -> "UN", "SPARK_TWO" -> "DEUX")
54-
val request = new StandaloneRestClient("spark://host:port").constructSubmitRequest(
54+
val request = new RestSubmissionClient("spark://host:port").constructSubmitRequest(
5555
"my-app-resource", "my-main-class", appArgs, sparkProperties, environmentVariables)
5656
assert(request.action === Utils.getFormattedClassName(request))
5757
assert(request.clientSparkVersion === SPARK_VERSION)
@@ -70,7 +70,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
7070
val request = constructSubmitRequest(masterUrl, appArgs)
7171
assert(request.appArgs === appArgs)
7272
assert(request.sparkProperties("spark.master") === masterUrl)
73-
val response = new StandaloneRestClient(masterUrl).createSubmission(request)
73+
val response = new RestSubmissionClient(masterUrl).createSubmission(request)
7474
val submitResponse = getSubmitResponse(response)
7575
assert(submitResponse.action === Utils.getFormattedClassName(submitResponse))
7676
assert(submitResponse.serverSparkVersion === SPARK_VERSION)
@@ -101,7 +101,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
101101
val submissionId = "my-lyft-driver"
102102
val killMessage = "your driver is killed"
103103
val masterUrl = startDummyServer(killMessage = killMessage)
104-
val response = new StandaloneRestClient(masterUrl).killSubmission(submissionId)
104+
val response = new RestSubmissionClient(masterUrl).killSubmission(submissionId)
105105
val killResponse = getKillResponse(response)
106106
assert(killResponse.action === Utils.getFormattedClassName(killResponse))
107107
assert(killResponse.serverSparkVersion === SPARK_VERSION)
@@ -115,7 +115,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
115115
val submissionState = KILLED
116116
val submissionException = new Exception("there was an irresponsible mix of alcohol and cars")
117117
val masterUrl = startDummyServer(state = submissionState, exception = Some(submissionException))
118-
val response = new StandaloneRestClient(masterUrl).requestSubmissionStatus(submissionId)
118+
val response = new RestSubmissionClient(masterUrl).requestSubmissionStatus(submissionId)
119119
val statusResponse = getStatusResponse(response)
120120
assert(statusResponse.action === Utils.getFormattedClassName(statusResponse))
121121
assert(statusResponse.serverSparkVersion === SPARK_VERSION)
@@ -128,7 +128,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
128128
test("create then kill") {
129129
val masterUrl = startSmartServer()
130130
val request = constructSubmitRequest(masterUrl)
131-
val client = new StandaloneRestClient(masterUrl)
131+
val client = new RestSubmissionClient(masterUrl)
132132
val response1 = client.createSubmission(request)
133133
val submitResponse = getSubmitResponse(response1)
134134
assert(submitResponse.success)
@@ -144,7 +144,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
144144
test("create then request status") {
145145
val masterUrl = startSmartServer()
146146
val request = constructSubmitRequest(masterUrl)
147-
val client = new StandaloneRestClient(masterUrl)
147+
val client = new RestSubmissionClient(masterUrl)
148148
val response1 = client.createSubmission(request)
149149
val submitResponse = getSubmitResponse(response1)
150150
assert(submitResponse.success)
@@ -161,7 +161,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
161161
test("create then kill then request status") {
162162
val masterUrl = startSmartServer()
163163
val request = constructSubmitRequest(masterUrl)
164-
val client = new StandaloneRestClient(masterUrl)
164+
val client = new RestSubmissionClient(masterUrl)
165165
val response1 = client.createSubmission(request)
166166
val response2 = client.createSubmission(request)
167167
val submitResponse1 = getSubmitResponse(response1)
@@ -191,7 +191,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
191191
test("kill or request status before create") {
192192
val masterUrl = startSmartServer()
193193
val doesNotExist = "does-not-exist"
194-
val client = new StandaloneRestClient(masterUrl)
194+
val client = new RestSubmissionClient(masterUrl)
195195
// kill a non-existent submission
196196
val response1 = client.killSubmission(doesNotExist)
197197
val killResponse = getKillResponse(response1)
@@ -342,7 +342,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
342342

343343
test("client handles faulty server") {
344344
val masterUrl = startFaultyServer()
345-
val client = new StandaloneRestClient(masterUrl)
345+
val client = new RestSubmissionClient(masterUrl)
346346
val httpUrl = masterUrl.replace("spark://", "http://")
347347
val v = RestSubmissionServer.PROTOCOL_VERSION
348348
val submitRequestPath = s"$httpUrl/$v/submissions/create"
@@ -429,7 +429,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
429429
mainJar) ++ appArgs
430430
val args = new SparkSubmitArguments(commandLineArgs)
431431
val (_, _, sparkProperties, _) = SparkSubmit.prepareSubmitEnvironment(args)
432-
new StandaloneRestClient("spark://host:port").constructSubmitRequest(
432+
new RestSubmissionClient("spark://host:port").constructSubmitRequest(
433433
mainJar, mainClass, appArgs, sparkProperties.toMap, Map.empty)
434434
}
435435

@@ -496,7 +496,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
496496
method: String,
497497
body: String = ""): (SubmitRestProtocolResponse, Int) = {
498498
val conn = sendHttpRequest(url, method, body)
499-
(new StandaloneRestClient("spark://host:port").readResponse(conn), conn.getResponseCode)
499+
(new RestSubmissionClient("spark://host:port").readResponse(conn), conn.getResponseCode)
500500
}
501501
}
502502

0 commit comments

Comments
 (0)