Search in sources :

Example 1 with SelectTask

use of com.alibaba.otter.node.etl.select.SelectTask in project otter by alibaba.

the class OtterController method startTask.

private void startTask(Pipeline pipeline, Map<StageType, GlobalTask> tasks, StageType taskType) {
    if (tasks.get(taskType) != null && tasks.get(taskType).isAlive()) {
        logger.warn("WARN ## this task = {} has started", taskType);
    }
    GlobalTask task = null;
    if (taskType.isSelect()) {
        task = new SelectTask(pipeline.getId());
    } else if (taskType.isExtract()) {
        task = new ExtractTask(pipeline.getId());
    } else if (taskType.isTransform()) {
        task = new TransformTask(pipeline.getId());
    } else if (taskType.isLoad()) {
        task = new LoadTask(pipeline.getId());
    }
    if (task != null) {
        // 注入一下spring资源
        OtterContextLocator.autowire(task);
        task.start();
        tasks.put(taskType, task);
        logger.info("INFO ## start this task = {} success", taskType.toString());
    }
}
Also used : LoadTask(com.alibaba.otter.node.etl.load.LoadTask) ExtractTask(com.alibaba.otter.node.etl.extract.ExtractTask) TransformTask(com.alibaba.otter.node.etl.transform.TransformTask) GlobalTask(com.alibaba.otter.node.etl.common.task.GlobalTask) SelectTask(com.alibaba.otter.node.etl.select.SelectTask)

Aggregations

GlobalTask (com.alibaba.otter.node.etl.common.task.GlobalTask)1 ExtractTask (com.alibaba.otter.node.etl.extract.ExtractTask)1 LoadTask (com.alibaba.otter.node.etl.load.LoadTask)1 SelectTask (com.alibaba.otter.node.etl.select.SelectTask)1 TransformTask (com.alibaba.otter.node.etl.transform.TransformTask)1