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);
}
}
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;
}
Aggregations