Search in sources :

Example 1 with JobServer

use of com.vip.saturn.job.console.domain.JobServer in project Saturn by vipshop.

the class RestApiServiceImpl method stopAtOnce.

private void stopAtOnce(String jobName, CuratorRepository.CuratorFrameworkOp curatorFrameworkOp) throws SaturnJobConsoleHttpException {
    Collection<JobServer> servers = jobDimensionService.getServers(jobName, curatorFrameworkOp);
    if (CollectionUtils.isEmpty(servers)) {
        throw new SaturnJobConsoleHttpException(HttpStatus.BAD_REQUEST.value(), NO_EXECUTOR_FOUND);
    }
    for (JobServer server : servers) {
        log.info("stop at once: job:{} executor:{}", jobName, server.getExecutorName());
        jobOperationService.stopAtOnceByJobnameAndExecutorName(jobName, server.getExecutorName(), curatorFrameworkOp);
    }
}
Also used : JobServer(com.vip.saturn.job.console.domain.JobServer) SaturnJobConsoleHttpException(com.vip.saturn.job.console.exception.SaturnJobConsoleHttpException)

Example 2 with JobServer

use of com.vip.saturn.job.console.domain.JobServer in project Saturn by vipshop.

the class RestApiServiceImplTest method createJobServer.

private JobServer createJobServer(String name) {
    JobServer jobServer = new JobServer();
    jobServer.setJobName(name);
    jobServer.setExecutorName("exec-" + name);
    jobServer.setStatus(ServerStatus.ONLINE);
    return jobServer;
}
Also used : JobServer(com.vip.saturn.job.console.domain.JobServer)

Aggregations

JobServer (com.vip.saturn.job.console.domain.JobServer)2 SaturnJobConsoleHttpException (com.vip.saturn.job.console.exception.SaturnJobConsoleHttpException)1