Search in sources :

Example 6 with GlobalTask

use of com.alibaba.otter.node.etl.common.task.GlobalTask in project otter by alibaba.

the class OtterController method process.

public boolean process(List<NodeTask> nodeTasks) {
    if (nodeTasks == null || nodeTasks.isEmpty()) {
        return true;
    }
    for (NodeTask nodeTask : nodeTasks) {
        boolean shutdown = nodeTask.isShutdown();
        Long pipelineId = nodeTask.getPipeline().getId();
        if (shutdown) {
            Map<StageType, GlobalTask> tasks = controllers.remove(pipelineId);
            if (tasks != null) {
                logger.info("INFO ## shutdown this pipeline sync ,the pipelineId = {} and tasks = {}", pipelineId, tasks.keySet());
                stopPipeline(pipelineId, tasks);
            } else {
                logger.info("INFO ## this pipeline id = {} is not start sync", pipelineId);
            }
        } else {
            startPipeline(nodeTask);
        }
    }
    return true;
}
Also used : StageType(com.alibaba.otter.shared.common.model.config.enums.StageType) GlobalTask(com.alibaba.otter.node.etl.common.task.GlobalTask) NodeTask(com.alibaba.otter.node.common.config.model.NodeTask)

Aggregations

GlobalTask (com.alibaba.otter.node.etl.common.task.GlobalTask)6 StageType (com.alibaba.otter.shared.common.model.config.enums.StageType)3 ConfigException (com.alibaba.otter.shared.common.model.config.ConfigException)2 NodeTask (com.alibaba.otter.node.common.config.model.NodeTask)1 TaskEvent (com.alibaba.otter.node.common.config.model.NodeTask.TaskEvent)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