Search in sources :

Example 6 with EScheduleJobType

use of com.dtstack.taier.common.enums.EScheduleJobType in project Taier by DTStack.

the class TaskService method querySupportJobTypes.

/**
 * 获得所有任务类型
 *
 * @return 任务类型
 */
public List<ReturnTaskSupportTypesVO> querySupportJobTypes() {
    List<ReturnTaskSupportTypesVO> returnTaskSupportTypesVOS = Lists.newArrayList();
    EScheduleJobType[] eScheduleJobTypes = EScheduleJobType.values();
    for (EScheduleJobType eScheduleJobType : eScheduleJobTypes) {
        ReturnTaskSupportTypesVO vo = new ReturnTaskSupportTypesVO();
        vo.setTaskTypeName(eScheduleJobType.getName());
        vo.setTaskTypeCode(eScheduleJobType.getType());
        returnTaskSupportTypesVOS.add(vo);
    }
    return returnTaskSupportTypesVOS;
}
Also used : EScheduleJobType(com.dtstack.taier.common.enums.EScheduleJobType) ReturnTaskSupportTypesVO(com.dtstack.taier.develop.vo.schedule.ReturnTaskSupportTypesVO)

Example 7 with EScheduleJobType

use of com.dtstack.taier.common.enums.EScheduleJobType in project Taier by DTStack.

the class BatchTaskService method getDefaultTaskParam.

/**
 * 获取任务的默认参数
 *
 * @param tenantId 租户ID
 * @param taskType 任务类型
 * @return
 */
private String getDefaultTaskParam(Long tenantId, Integer taskType) {
    EScheduleJobType eScheduleJobType = EScheduleJobType.getByTaskType(taskType);
    List<Component> componentList = componentService.listComponentsByComponentType(tenantId, eScheduleJobType.getComponentType().getTypeCode());
    if (CollectionUtils.isEmpty(componentList)) {
        return Strings.EMPTY_STRING;
    }
    // todo 后续多版本再进行扩展
    String version = componentList.get(0).getVersionName();
    TaskParamTemplate taskParamTemplate = taskParamTemplateService.getTaskParamTemplate(version, taskType);
    return Objects.isNull(taskParamTemplate) ? Strings.EMPTY_STRING : taskParamTemplate.getParams();
}
Also used : EScheduleJobType(com.dtstack.taier.common.enums.EScheduleJobType) TaskParamTemplate(com.dtstack.taier.dao.domain.TaskParamTemplate) Component(com.dtstack.taier.dao.domain.Component)

Aggregations

EScheduleJobType (com.dtstack.taier.common.enums.EScheduleJobType)7 EComponentType (com.dtstack.taier.common.enums.EComponentType)3 RdosDefineException (com.dtstack.taier.common.exception.RdosDefineException)2 Component (com.dtstack.taier.dao.domain.Component)2 JSONObject (com.alibaba.fastjson.JSONObject)1 Dict (com.dtstack.taier.dao.domain.Dict)1 Queue (com.dtstack.taier.dao.domain.Queue)1 TaskParamTemplate (com.dtstack.taier.dao.domain.TaskParamTemplate)1 ReturnTaskSupportTypesVO (com.dtstack.taier.develop.vo.schedule.ReturnTaskSupportTypesVO)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1