Search in sources :

Example 1 with JudgeJobExecOperator

use of com.dtstack.taier.scheduler.server.scheduler.exec.JudgeJobExecOperator in project Taier by DTStack.

the class AbstractJobScanningScheduler method isSubmitJob.

/**
 *  判断是否通过提交校验
 * @param scheduleJobDetails 实例
 * @return 校验解雇
 */
private Boolean isSubmitJob(ScheduleJobDetails scheduleJobDetails) {
    List<JudgeJobExecOperator> judgeJobExecOperator = getJudgeJobExecOperator();
    if (CollectionUtils.isNotEmpty(judgeJobExecOperator)) {
        for (JudgeJobExecOperator jobExecOperator : judgeJobExecOperator) {
            JobCheckRunInfo exec = jobExecOperator.isExec(scheduleJobDetails);
            if (!exec.getPass() && exec.getStatus() != null) {
                ScheduleJob scheduleJob = scheduleJobDetails.getScheduleJob();
                LOGGER.info("jobId:{} no arrive exec run . exec : {}", scheduleJob.getJobId(), exec.getLogInfo());
                // 没有通过校验 处理
                List<JudgeNoPassJobHandler> judgeNoPassJobHandlerList = getJudgeNoPassJobHandler();
                for (JudgeNoPassJobHandler judgeNoPassJobHandler : judgeNoPassJobHandlerList) {
                    if (judgeNoPassJobHandler.isSupportJobCheckStatus(exec.getStatus())) {
                        return judgeNoPassJobHandler.handlerJob(scheduleJobDetails, exec);
                    }
                }
                return Boolean.FALSE;
            }
        }
    }
    return Boolean.TRUE;
}
Also used : ScheduleJob(com.dtstack.taier.dao.domain.ScheduleJob) JobCheckRunInfo(com.dtstack.taier.scheduler.server.scheduler.exec.JobCheckRunInfo) JudgeNoPassJobHandler(com.dtstack.taier.scheduler.server.scheduler.handler.JudgeNoPassJobHandler) JudgeJobExecOperator(com.dtstack.taier.scheduler.server.scheduler.exec.JudgeJobExecOperator)

Aggregations

ScheduleJob (com.dtstack.taier.dao.domain.ScheduleJob)1 JobCheckRunInfo (com.dtstack.taier.scheduler.server.scheduler.exec.JobCheckRunInfo)1 JudgeJobExecOperator (com.dtstack.taier.scheduler.server.scheduler.exec.JudgeJobExecOperator)1 JudgeNoPassJobHandler (com.dtstack.taier.scheduler.server.scheduler.handler.JudgeNoPassJobHandler)1