MCPcopy Create free account
hub / github.com/alibaba/DataX / start

Method start

core/src/main/java/com/alibaba/datax/core/Engine.java:40–88  ·  view source on GitHub ↗
(Configuration allConf)

Source from the content-addressed store, hash-verified

38
39 /* check job model (job/task) first */
40 public void start(Configuration allConf) {
41
42 // 绑定column转换信息
43 ColumnCast.bind(allConf);
44
45 /**
46 * 初始化PluginLoader,可以获取各种插件配置
47 */
48 LoadUtil.bind(allConf);
49
50 boolean isJob = !("taskGroup".equalsIgnoreCase(allConf
51 .getString(CoreConstant.DATAX_CORE_CONTAINER_MODEL)));
52 //JobContainer会在schedule后再行进行设置和调整值
53 int channelNumber =0;
54 AbstractContainer container;
55 long instanceId;
56 int taskGroupId = -1;
57 if (isJob) {
58 allConf.set(CoreConstant.DATAX_CORE_CONTAINER_JOB_MODE, RUNTIME_MODE);
59 container = new JobContainer(allConf);
60 instanceId = allConf.getLong(
61 CoreConstant.DATAX_CORE_CONTAINER_JOB_ID, 0);
62
63 } else {
64 container = new TaskGroupContainer(allConf);
65 instanceId = allConf.getLong(
66 CoreConstant.DATAX_CORE_CONTAINER_JOB_ID);
67 taskGroupId = allConf.getInt(
68 CoreConstant.DATAX_CORE_CONTAINER_TASKGROUP_ID);
69 channelNumber = allConf.getInt(
70 CoreConstant.DATAX_CORE_CONTAINER_TASKGROUP_CHANNEL);
71 }
72
73 //缺省打开perfTrace
74 boolean traceEnable = allConf.getBool(CoreConstant.DATAX_CORE_CONTAINER_TRACE_ENABLE, true);
75 boolean perfReportEnable = allConf.getBool(CoreConstant.DATAX_CORE_REPORT_DATAX_PERFLOG, true);
76
77 //standalone模式的 datax shell任务不进行汇报
78 if(instanceId == -1){
79 perfReportEnable = false;
80 }
81
82 Configuration jobInfoConfig = allConf.getConfiguration(CoreConstant.DATAX_JOB_JOBINFO);
83 //初始化PerfTrace
84 PerfTrace perfTrace = PerfTrace.getInstance(isJob, instanceId, taskGroupId, traceEnable);
85 perfTrace.setJobInfo(jobInfoConfig,perfReportEnable,channelNumber);
86 container.start();
87
88 }
89
90
91 // 注意屏蔽敏感信息

Callers 5

entryMethod · 0.95
startMethod · 0.95
startAsyncFlushingMethod · 0.45
startAsyncFlushingMethod · 0.45
forStrColumnMethod · 0.45

Calls 12

bindMethod · 0.95
bindMethod · 0.95
getInstanceMethod · 0.95
setJobInfoMethod · 0.95
startMethod · 0.95
getStringMethod · 0.80
setMethod · 0.80
getLongMethod · 0.80
getIntMethod · 0.80
getBoolMethod · 0.80
equalsIgnoreCaseMethod · 0.45
getConfigurationMethod · 0.45

Tested by

no test coverage detected