private void mayBeConstructFinalFullCounters() { // Calculating full-counters. This should happen only once for the job. synchronized (this.fullCountersLock) { if (this.fullCounters != null) { // Already constructed. Just return. return; } this.constructFinalFullcounters(); } }
private void rememberLastNonFinalState(JobStateInternal stateInternal) { JobState state = getExternalState(stateInternal); // if state is not the final state, set lastNonFinalState if (state != JobState.SUCCEEDED && state != JobState.FAILED && state != JobState.KILLED && state != JobState.ERROR) { lastNonFinalState = state; } }
@SuppressWarnings("unchecked") @Override public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { finalizeProgress(taskAttempt); sendContainerCompleted(taskAttempt); super.transition(taskAttempt, event); } }
public static void main(String[] args) throws Exception { TestJobImpl t = new TestJobImpl(); t.testJobNoTasks(); t.testCheckJobCompleteSuccess(); t.testCheckAccess(); t.testReportDiagnostics(); t.testUberDecision(); }
private void launchTaskAttempt(TaskAttemptId attemptId) { mockTask.handle(new TaskTAttemptEvent(attemptId, TaskEventType.T_ATTEMPT_LAUNCHED)); ((MockTaskAttemptImpl)(mockTask.getAttempt(attemptId))) .assignContainer(); assertTaskRunningState(); }
@Override public void transition(JobImpl job, JobEvent event) { //succeeded map task is restarted back job.decrementSucceededMapperCount(); } }
protected TaskStateInternal getDefaultState(TaskImpl task) { return task.getInternalState(); } }
@Override public JobStateInternal transition(JobImpl job, JobEvent event) { return job.checkReadyForCommit(); } }
private void updateLastAttemptProgress(float p) { getLastAttempt().setProgress(p); }
private void updateLastAttemptState(TaskAttemptState s) { getLastAttempt().setState(s); }
@Override protected TaskAttemptImpl createAttempt() { MockTaskAttemptImpl attempt = new MockTaskAttemptImpl(getID(), ++taskAttemptCounter, eventHandler, taskAttemptListener, remoteJobConfFile, partition, conf, jobToken, credentials, clock, appContext, taskType); taskAttempts.add(attempt); return attempt; }
private void killTask(TaskId taskId) { mockTask.handle(new TaskEvent(taskId, TaskEventType.T_KILL)); assertTaskKillWaitState(); }
private void killRunningTaskAttempt(TaskAttemptId attemptId, boolean reschedule) { mockTask.handle(new TaskTAttemptKilledEvent(attemptId, reschedule)); assertTaskRunningState(); }
@SuppressWarnings("unchecked") @Override public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { // set the finish time taskAttempt.setFinishTime(); notifyTaskAttemptFailed(taskAttempt, taskAttempt.isTaskFailFast()); } }
private void mayBeConstructFinalFullCounters() { // Calculating full-counters. This should happen only once for the job. synchronized (this.fullCountersLock) { if (this.fullCounters != null) { // Already constructed. Just return. return; } this.constructFinalFullcounters(); } }
@Override public void transition(JobImpl job, JobEvent event) { //succeeded map task is restarted back job.decrementSucceededMapperCount(); } }
private void rememberLastNonFinalState(JobStateInternal stateInternal) { JobState state = getExternalState(stateInternal); // if state is not the final state, set lastNonFinalState if (state != JobState.SUCCEEDED && state != JobState.FAILED && state != JobState.KILLED && state != JobState.ERROR) { lastNonFinalState = state; } }
@Override public JobStateInternal transition(JobImpl job, JobEvent event) { return job.checkReadyForCommit(); } }
private void mayBeConstructFinalFullCounters() { // Calculating full-counters. This should happen only once for the job. synchronized (this.fullCountersLock) { if (this.fullCounters != null) { // Already constructed. Just return. return; } this.constructFinalFullcounters(); } }
private void rememberLastNonFinalState(JobStateInternal stateInternal) { JobState state = getExternalState(stateInternal); // if state is not the final state, set lastNonFinalState if (state != JobState.SUCCEEDED && state != JobState.FAILED && state != JobState.KILLED && state != JobState.ERROR) { lastNonFinalState = state; } }