use of com.dtstack.taier.develop.vo.console.ConsoleJobInfoVO in project Taier by DTStack.
the class ConsoleService method searchJob.
public ConsoleJobVO searchJob(String jobName) {
String jobId = null;
ScheduleJob scheduleJob = scheduleJobMapper.getByName(jobName);
if (scheduleJob != null) {
jobId = scheduleJob.getJobId();
}
if (jobId == null) {
return null;
}
ScheduleEngineJobCache engineJobCache = scheduleEngineJobCacheMapper.getOne(jobId);
if (engineJobCache == null) {
return null;
}
try {
ParamAction paramAction = PublicUtil.jsonStrToObject(engineJobCache.getJobInfo(), ParamAction.class);
Tenant tenant = tenantMapper.selectById(scheduleJob.getTenantId());
ConsoleJobInfoVO consoleJobInfoVO = this.fillJobInfo(paramAction, scheduleJob, engineJobCache, tenant);
ConsoleJobVO vo = new ConsoleJobVO();
vo.setTheJob(consoleJobInfoVO);
vo.setNodeAddress(engineJobCache.getNodeAddress());
vo.setTheJobIdx(1);
return vo;
} catch (Exception e) {
LOGGER.error("searchJob error:", e);
}
return null;
}
use of com.dtstack.taier.develop.vo.console.ConsoleJobInfoVO in project Taier by DTStack.
the class ConsoleService method fillJobInfo.
private ConsoleJobInfoVO fillJobInfo(ParamAction paramAction, ScheduleJob scheduleJob, ScheduleEngineJobCache engineJobCache, Tenant tenant) {
ConsoleJobInfoVO infoVO = new ConsoleJobInfoVO();
infoVO.setStatus(scheduleJob.getStatus());
infoVO.setExecStartTime(scheduleJob.getExecStartTime());
infoVO.setGenerateTime(engineJobCache.getGmtCreate());
long currentTime = System.currentTimeMillis();
String waitTime = DateUtil.getTimeDifference(currentTime - engineJobCache.getGmtCreate().getTime());
infoVO.setWaitTime(waitTime);
infoVO.setTenantName(null == tenant ? "" : tenant.getTenantName());
infoVO.setParamAction(paramAction);
return infoVO;
}
Aggregations