use of com.alibaba.otter.node.etl.extract.ExtractTask 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());
}
}
Aggregations