This is an automated email from the ASF dual-hosted git repository.
zhouquan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git
The following commit(s) were added to refs/heads/master by this push:
new edc9801 SUBMARINE-394. Change submit job response status in
JobManagerRestApi
edc9801 is described below
commit edc9801bed705a55258af151a0b9ccbbe899c912
Author: pingsutw <[email protected]>
AuthorDate: Wed Feb 26 10:12:31 2020 +0800
SUBMARINE-394. Change submit job response status in JobManagerRestApi
### What is this PR for?
If job submit successfully we should return `OK`(200) instead of
`ACCEPTED`(202)
If job submit fail, success should be false
### What type of PR is it?
[Bug Fix]
### Todos
* [ ] - Task
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-394
### How should this be tested?
https://travis-ci.org/pingsutw/hadoop-submarine/builds/655167779
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: pingsutw <[email protected]>
Closes #190 from pingsutw/SUBMARINE-394 and squashes the following commits:
50ca4b6 [pingsutw] SUBMARINE-394. Change submit job response status in
JobManagerRestApi
---
.../java/org/apache/submarine/server/rest/JobManagerRestApi.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/JobManagerRestApi.java
b/submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/JobManagerRestApi.java
index fae7be8..551cfc8 100644
---
a/submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/JobManagerRestApi.java
+++
b/submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/JobManagerRestApi.java
@@ -67,16 +67,16 @@ public class JobManagerRestApi {
public Response submitJob(JobSpec jobSpec) {
if (!jobSpec.validate()) {
return new JsonResponse.Builder<String>(Response.Status.ACCEPTED)
- .success(true).result("Invalid params.").build();
+ .success(false).result("Invalid params.").build();
}
try {
Job job = JobManager.getInstance().submitJob(jobSpec);
- return new JsonResponse.Builder<Job>(Response.Status.ACCEPTED)
+ return new JsonResponse.Builder<Job>(Response.Status.OK)
.success(true).result(job).build();
} catch (UnsupportedJobTypeException e) {
return new JsonResponse.Builder<String>(Response.Status.ACCEPTED)
- .success(true).result(e.getMessage()).build();
+ .success(false).result(e.getMessage()).build();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]