Package org.apache.hive.ptest.api.response

Examples of org.apache.hive.ptest.api.response.TestStartResponse


  @RequestMapping(value="/testStart", method = RequestMethod.POST)
  public @ResponseBody TestStartResponse testStart(@RequestBody TestStartRequest startRequest,
      BindingResult result) {
    LOG.info("startRequest " + startRequest.toString());
    TestStartResponse startResponse = doStartTest(startRequest, result);
    LOG.info("startResponse " + startResponse.toString());
    return startResponse;
  }
View Full Code Here


  private TestStartResponse doStartTest(TestStartRequest startRequest, BindingResult result) {
    if(result.hasErrors() ||
        Strings.nullToEmpty(startRequest.getProfile()).trim().isEmpty() ||
        Strings.nullToEmpty(startRequest.getTestHandle()).trim().isEmpty() ||
        startRequest.getProfile().contains("/")) {
      return new TestStartResponse(Status.illegalArgument());
    }
    if(!assertTestHandleIsAvailable(startRequest.getTestHandle())) {
      return new TestStartResponse(Status.illegalArgument("Test handle " + startRequest.getTestHandle() + " already used"));
    }
    Test test = new Test(startRequest,
        Status.pending(), System.currentTimeMillis());
    if(mTestQueue.offer(test)) {
      mTests.put(startRequest.getTestHandle(), test);
      return new TestStartResponse(Status.ok());
    } else {
      return new TestStartResponse(Status.queueFull());
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hive.ptest.api.response.TestStartResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.