use of org.apache.hive.ptest.api.response.TestStopResponse in project hive by apache.
the class ExecutionController method testStop.
@RequestMapping(value = "/testStop", method = RequestMethod.POST)
@ResponseBody
public TestStopResponse testStop(@RequestBody TestStopRequest stopRequest, BindingResult result) {
String testHandle = stopRequest.getTestHandle();
Test test = mTests.get(testHandle);
if (result.hasErrors() || Strings.nullToEmpty(stopRequest.getTestHandle()).trim().isEmpty() || test == null) {
return new TestStopResponse(Status.illegalArgument());
}
test.setStopRequested(true);
return new TestStopResponse(Status.ok());
}
Aggregations