@@ -51,7 +51,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
51
51
val appArgs = Array (" one" , " two" , " three" )
52
52
val sparkProperties = Map (" spark.app.name" -> " pi" )
53
53
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(
55
55
" my-app-resource" , " my-main-class" , appArgs, sparkProperties, environmentVariables)
56
56
assert(request.action === Utils .getFormattedClassName(request))
57
57
assert(request.clientSparkVersion === SPARK_VERSION )
@@ -70,7 +70,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
70
70
val request = constructSubmitRequest(masterUrl, appArgs)
71
71
assert(request.appArgs === appArgs)
72
72
assert(request.sparkProperties(" spark.master" ) === masterUrl)
73
- val response = new StandaloneRestClient (masterUrl).createSubmission(request)
73
+ val response = new RestSubmissionClient (masterUrl).createSubmission(request)
74
74
val submitResponse = getSubmitResponse(response)
75
75
assert(submitResponse.action === Utils .getFormattedClassName(submitResponse))
76
76
assert(submitResponse.serverSparkVersion === SPARK_VERSION )
@@ -101,7 +101,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
101
101
val submissionId = " my-lyft-driver"
102
102
val killMessage = " your driver is killed"
103
103
val masterUrl = startDummyServer(killMessage = killMessage)
104
- val response = new StandaloneRestClient (masterUrl).killSubmission(submissionId)
104
+ val response = new RestSubmissionClient (masterUrl).killSubmission(submissionId)
105
105
val killResponse = getKillResponse(response)
106
106
assert(killResponse.action === Utils .getFormattedClassName(killResponse))
107
107
assert(killResponse.serverSparkVersion === SPARK_VERSION )
@@ -115,7 +115,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
115
115
val submissionState = KILLED
116
116
val submissionException = new Exception (" there was an irresponsible mix of alcohol and cars" )
117
117
val masterUrl = startDummyServer(state = submissionState, exception = Some (submissionException))
118
- val response = new StandaloneRestClient (masterUrl).requestSubmissionStatus(submissionId)
118
+ val response = new RestSubmissionClient (masterUrl).requestSubmissionStatus(submissionId)
119
119
val statusResponse = getStatusResponse(response)
120
120
assert(statusResponse.action === Utils .getFormattedClassName(statusResponse))
121
121
assert(statusResponse.serverSparkVersion === SPARK_VERSION )
@@ -128,7 +128,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
128
128
test(" create then kill" ) {
129
129
val masterUrl = startSmartServer()
130
130
val request = constructSubmitRequest(masterUrl)
131
- val client = new StandaloneRestClient (masterUrl)
131
+ val client = new RestSubmissionClient (masterUrl)
132
132
val response1 = client.createSubmission(request)
133
133
val submitResponse = getSubmitResponse(response1)
134
134
assert(submitResponse.success)
@@ -144,7 +144,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
144
144
test(" create then request status" ) {
145
145
val masterUrl = startSmartServer()
146
146
val request = constructSubmitRequest(masterUrl)
147
- val client = new StandaloneRestClient (masterUrl)
147
+ val client = new RestSubmissionClient (masterUrl)
148
148
val response1 = client.createSubmission(request)
149
149
val submitResponse = getSubmitResponse(response1)
150
150
assert(submitResponse.success)
@@ -161,7 +161,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
161
161
test(" create then kill then request status" ) {
162
162
val masterUrl = startSmartServer()
163
163
val request = constructSubmitRequest(masterUrl)
164
- val client = new StandaloneRestClient (masterUrl)
164
+ val client = new RestSubmissionClient (masterUrl)
165
165
val response1 = client.createSubmission(request)
166
166
val response2 = client.createSubmission(request)
167
167
val submitResponse1 = getSubmitResponse(response1)
@@ -191,7 +191,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
191
191
test(" kill or request status before create" ) {
192
192
val masterUrl = startSmartServer()
193
193
val doesNotExist = " does-not-exist"
194
- val client = new StandaloneRestClient (masterUrl)
194
+ val client = new RestSubmissionClient (masterUrl)
195
195
// kill a non-existent submission
196
196
val response1 = client.killSubmission(doesNotExist)
197
197
val killResponse = getKillResponse(response1)
@@ -342,7 +342,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
342
342
343
343
test(" client handles faulty server" ) {
344
344
val masterUrl = startFaultyServer()
345
- val client = new StandaloneRestClient (masterUrl)
345
+ val client = new RestSubmissionClient (masterUrl)
346
346
val httpUrl = masterUrl.replace(" spark://" , " http://" )
347
347
val v = RestSubmissionServer .PROTOCOL_VERSION
348
348
val submitRequestPath = s " $httpUrl/ $v/submissions/create "
@@ -429,7 +429,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
429
429
mainJar) ++ appArgs
430
430
val args = new SparkSubmitArguments (commandLineArgs)
431
431
val (_, _, sparkProperties, _) = SparkSubmit .prepareSubmitEnvironment(args)
432
- new StandaloneRestClient (" spark://host:port" ).constructSubmitRequest(
432
+ new RestSubmissionClient (" spark://host:port" ).constructSubmitRequest(
433
433
mainJar, mainClass, appArgs, sparkProperties.toMap, Map .empty)
434
434
}
435
435
@@ -496,7 +496,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
496
496
method : String ,
497
497
body : String = " " ): (SubmitRestProtocolResponse , Int ) = {
498
498
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)
500
500
}
501
501
}
502
502
0 commit comments