学习作业启动
This commit is contained in:
parent
9a5a33e0b2
commit
e9090ffc74
@ -288,6 +288,22 @@ protected void handleJobSetup(CommitterJobSetupEvent event) {
|
||||
}
|
||||
```
|
||||
|
||||
SetupCompletedTransition的处理逻辑如下,可以看到会定时启动MapTask和ReduceTask。
|
||||
|
||||
```java
|
||||
public void transition(JobImpl job, JobEvent event) {
|
||||
job.setupProgress = 1.0f;
|
||||
job.scheduleTasks(job.mapTasks, job.numReduceTasks == 0);
|
||||
job.scheduleTasks(job.reduceTasks, true);
|
||||
|
||||
// If we have no tasks, just transition to job completed
|
||||
if (job.numReduceTasks == 0 && job.numMapTasks == 0) {
|
||||
job.eventHandler.handle(new JobEvent(job.jobId,
|
||||
JobEventType.JOB_COMPLETED));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
checkReadyForCommit函数的实现如下,可以看到在触发了CommitterJobCommitEvent事件,在CommitterJobCommitEvent里面会触发JOB_COMMIT事件。主要处理逻辑在handleJobCommit里面。
|
||||
|
||||
```java
|
||||
@ -344,3 +360,14 @@ protected void handleJobCommit(CommitterJobCommitEvent event) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
##### CommitSucceededTransition
|
||||
|
||||
提交成功的事件处理handler为CommitSucceededTransition,核心处理逻辑如下:
|
||||
|
||||
```java
|
||||
job.logJobHistoryFinishedEvent();
|
||||
job.finished(JobStateInternal.SUCCEEDED);
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user