Search in sources :

Example 16 with Component

use of com.dtstack.taier.dao.domain.Component 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)

Example 17 with Component

use of com.dtstack.taier.dao.domain.Component in project Taier by DTStack.

the class ComponentVO method toVOS.

public static List<ComponentVO> toVOS(List<Component> components) {
    List<ComponentVO> vos = new ArrayList<>();
    if (CollectionUtils.isEmpty(components)) {
        return vos;
    }
    for (Component component : components) {
        ComponentVO vo = new ComponentVO();
        BeanUtils.copyProperties(component, vo);
        vos.add(vo);
    }
    return vos;
}
Also used : ArrayList(java.util.ArrayList) Component(com.dtstack.taier.dao.domain.Component)

Aggregations

Component (com.dtstack.taier.dao.domain.Component)17 EComponentType (com.dtstack.taier.common.enums.EComponentType)11 JSONObject (com.alibaba.fastjson.JSONObject)10 RdosDefineException (com.dtstack.taier.common.exception.RdosDefineException)7 Cluster (com.dtstack.taier.dao.domain.Cluster)4 EScheduleJobType (com.dtstack.taier.common.enums.EScheduleJobType)3 ArrayList (java.util.ArrayList)3 EnvironmentContext (com.dtstack.taier.common.env.EnvironmentContext)2 KerberosConfig (com.dtstack.taier.dao.domain.KerberosConfig)2 ComponentVO (com.dtstack.taier.scheduler.vo.ComponentVO)2 Map (java.util.Map)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 JSONPath (com.alibaba.fastjson.JSONPath)1 Wrappers (com.baomidou.mybatisplus.core.toolkit.Wrappers)1 CommonConstant (com.dtstack.taier.common.constant.CommonConstant)1 DataSourceType (com.dtstack.taier.common.enums.DataSourceType)1 DictType (com.dtstack.taier.common.enums.DictType)1 EComponentScheduleType (com.dtstack.taier.common.enums.EComponentScheduleType)1 EScheduleType (com.dtstack.taier.common.enums.EScheduleType)1 ErrorCode (com.dtstack.taier.common.exception.ErrorCode)1