Search in sources :

Example 1 with WorkerOperator

use of com.dtstack.taier.scheduler.WorkerOperator in project Taier by DTStack.

the class UploadParamPipeline method pipeline.

@Override
public void pipeline(Map<String, Object> actionParam, Map<String, Object> pipelineParam) throws RdosDefineException {
    if (pipelineParam.containsKey(pipelineKey)) {
        return;
    }
    ScheduleTaskShade taskShade = (ScheduleTaskShade) pipelineParam.get(taskShadeKey);
    if (null == taskShade) {
        throw new RdosDefineException("upload param pipeline task shade can not be null");
    }
    ScheduleJob scheduleJob = (ScheduleJob) pipelineParam.get(scheduleJobKey);
    if (null == scheduleJob) {
        throw new RdosDefineException("upload param pipeline schedule job can not be null");
    }
    String fileUploadPath = (String) pipelineParam.get(fileUploadPathKey);
    if (StringUtils.isBlank(fileUploadPath)) {
        throw new RdosDefineException("upload param pipeline fileUploadPath can not be null");
    }
    WorkerOperator workerOperator = (WorkerOperator) pipelineParam.get(workOperatorKey);
    if (null == workerOperator) {
        throw new RdosDefineException("upload param pipeline workerOperator can not be null");
    }
    JSONObject pluginInfo = (JSONObject) pipelineParam.get(pluginInfoKey);
    if (null == pluginInfo) {
        throw new RdosDefineException("upload param pipeline pluginInfo can not be null");
    }
    @SuppressWarnings("unchecked") List<ScheduleTaskParamShade> taskParamShades = (List) pipelineParam.get(taskParamsToReplaceKey);
    String uploadPath = this.uploadSqlTextToHdfs((String) actionParam.get("sqlText"), taskShade.getTaskType(), taskShade.getName(), taskShade.getTenantId(), 0L, taskParamShades, scheduleJob.getCycTime(), fileUploadPath, pluginInfo, workerOperator, scheduleJob.getJobId());
    pipelineParam.put(pipelineKey, uploadPath);
}
Also used : ScheduleJob(com.dtstack.taier.dao.domain.ScheduleJob) JSONObject(com.alibaba.fastjson.JSONObject) ScheduleTaskParamShade(com.dtstack.taier.dao.dto.ScheduleTaskParamShade) RdosDefineException(com.dtstack.taier.common.exception.RdosDefineException) List(java.util.List) WorkerOperator(com.dtstack.taier.scheduler.WorkerOperator) ScheduleTaskShade(com.dtstack.taier.dao.domain.ScheduleTaskShade)

Aggregations

JSONObject (com.alibaba.fastjson.JSONObject)1 RdosDefineException (com.dtstack.taier.common.exception.RdosDefineException)1 ScheduleJob (com.dtstack.taier.dao.domain.ScheduleJob)1 ScheduleTaskShade (com.dtstack.taier.dao.domain.ScheduleTaskShade)1 ScheduleTaskParamShade (com.dtstack.taier.dao.dto.ScheduleTaskParamShade)1 WorkerOperator (com.dtstack.taier.scheduler.WorkerOperator)1 List (java.util.List)1