Search in sources :

Example 1 with TestStopResponse

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());
}
Also used : TestStopResponse(org.apache.hive.ptest.api.response.TestStopResponse) PTest(org.apache.hive.ptest.execution.PTest) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

TestStopResponse (org.apache.hive.ptest.api.response.TestStopResponse)1 PTest (org.apache.hive.ptest.execution.PTest)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1