|
@@ -392,7 +392,7 @@ class JobInProgress {
|
|
jobInitKillStatus.initStarted = true;
|
|
jobInitKillStatus.initStarted = true;
|
|
}
|
|
}
|
|
|
|
|
|
- LOG.debug("initializing " + this.jobId);
|
|
|
|
|
|
+ LOG.info("Initializing " + jobId);
|
|
|
|
|
|
// log job info
|
|
// log job info
|
|
JobHistory.JobInfo.logSubmitted(getJobID(), conf, jobFile.toString(),
|
|
JobHistory.JobInfo.logSubmitted(getJobID(), conf, jobFile.toString(),
|
|
@@ -437,38 +437,15 @@ class JobInProgress {
|
|
splits[i],
|
|
splits[i],
|
|
jobtracker, conf, this, i);
|
|
jobtracker, conf, this, i);
|
|
}
|
|
}
|
|
- LOG.info("Input size for job "+ jobId + " = " + inputLength);
|
|
|
|
|
|
+ LOG.info("Input size for job " + jobId + " = " + inputLength
|
|
|
|
+ + ". Number of splits = " + splits.length);
|
|
if (numMapTasks > 0) {
|
|
if (numMapTasks > 0) {
|
|
- LOG.info("Split info for job:" + jobId + " with " +
|
|
|
|
- splits.length + " splits:");
|
|
|
|
nonRunningMapCache = createCache(splits, maxLevel);
|
|
nonRunningMapCache = createCache(splits, maxLevel);
|
|
}
|
|
}
|
|
|
|
|
|
// set the launch time
|
|
// set the launch time
|
|
this.launchTime = System.currentTimeMillis();
|
|
this.launchTime = System.currentTimeMillis();
|
|
|
|
|
|
- // if no split is returned, job is considered completed and successful
|
|
|
|
- if (numMapTasks == 0) {
|
|
|
|
- // Finished time need to be setted here to prevent this job to be retired
|
|
|
|
- // from the job tracker jobs at the next retire iteration.
|
|
|
|
- this.finishTime = this.launchTime;
|
|
|
|
- status.setSetupProgress(1.0f);
|
|
|
|
- status.setMapProgress(1.0f);
|
|
|
|
- status.setReduceProgress(1.0f);
|
|
|
|
- status.setCleanupProgress(1.0f);
|
|
|
|
- status.setRunState(JobStatus.SUCCEEDED);
|
|
|
|
- tasksInited.set(true);
|
|
|
|
- JobHistory.JobInfo.logInited(profile.getJobID(),
|
|
|
|
- this.launchTime, 0, 0);
|
|
|
|
- JobHistory.JobInfo.logFinished(profile.getJobID(),
|
|
|
|
- this.finishTime, 0, 0, 0, 0,
|
|
|
|
- getCounters());
|
|
|
|
- // Special case because the Job is not queued
|
|
|
|
- JobEndNotifier.registerNotification(this.getJobConf(), this.getStatus());
|
|
|
|
-
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//
|
|
//
|
|
// Create reduce tasks
|
|
// Create reduce tasks
|
|
//
|
|
//
|
|
@@ -490,9 +467,11 @@ class JobInProgress {
|
|
|
|
|
|
// create cleanup two cleanup tips, one map and one reduce.
|
|
// create cleanup two cleanup tips, one map and one reduce.
|
|
cleanup = new TaskInProgress[2];
|
|
cleanup = new TaskInProgress[2];
|
|
- // cleanup map tip. This map is doesn't use split.
|
|
|
|
- // Just assign splits[0]
|
|
|
|
- cleanup[0] = new TaskInProgress(jobId, jobFile, splits[0],
|
|
|
|
|
|
+
|
|
|
|
+ // cleanup map tip. This map doesn't use any splits. Just assign an empty
|
|
|
|
+ // split.
|
|
|
|
+ JobClient.RawSplit emptySplit = new JobClient.RawSplit();
|
|
|
|
+ cleanup[0] = new TaskInProgress(jobId, jobFile, emptySplit,
|
|
jobtracker, conf, this, numMapTasks);
|
|
jobtracker, conf, this, numMapTasks);
|
|
cleanup[0].setJobCleanupTask();
|
|
cleanup[0].setJobCleanupTask();
|
|
|
|
|
|
@@ -503,9 +482,10 @@ class JobInProgress {
|
|
|
|
|
|
// create two setup tips, one map and one reduce.
|
|
// create two setup tips, one map and one reduce.
|
|
setup = new TaskInProgress[2];
|
|
setup = new TaskInProgress[2];
|
|
- // setup map tip. This map is doesn't use split.
|
|
|
|
- // Just assign splits[0]
|
|
|
|
- setup[0] = new TaskInProgress(jobId, jobFile, splits[0],
|
|
|
|
|
|
+
|
|
|
|
+ // setup map tip. This map doesn't use any split. Just assign an empty
|
|
|
|
+ // split.
|
|
|
|
+ setup[0] = new TaskInProgress(jobId, jobFile, emptySplit,
|
|
jobtracker, conf, this, numMapTasks + 1 );
|
|
jobtracker, conf, this, numMapTasks + 1 );
|
|
setup[0].setJobSetupTask();
|
|
setup[0].setJobSetupTask();
|
|
|
|
|
|
@@ -898,20 +878,11 @@ class JobInProgress {
|
|
if (!tip.isJobCleanupTask() && !tip.isJobSetupTask()) {
|
|
if (!tip.isJobCleanupTask() && !tip.isJobSetupTask()) {
|
|
double progressDelta = tip.getProgress() - oldProgress;
|
|
double progressDelta = tip.getProgress() - oldProgress;
|
|
if (tip.isMapTask()) {
|
|
if (tip.isMapTask()) {
|
|
- if (maps.length == 0) {
|
|
|
|
- this.status.setMapProgress(1.0f);
|
|
|
|
- } else {
|
|
|
|
this.status.setMapProgress((float) (this.status.mapProgress() +
|
|
this.status.setMapProgress((float) (this.status.mapProgress() +
|
|
progressDelta / maps.length));
|
|
progressDelta / maps.length));
|
|
- }
|
|
|
|
} else {
|
|
} else {
|
|
- if (reduces.length == 0) {
|
|
|
|
- this.status.setReduceProgress(1.0f);
|
|
|
|
- } else {
|
|
|
|
- this.status.setReduceProgress
|
|
|
|
- ((float) (this.status.reduceProgress() +
|
|
|
|
- (progressDelta / reduces.length)));
|
|
|
|
- }
|
|
|
|
|
|
+ this.status.setReduceProgress((float) (this.status.reduceProgress() +
|
|
|
|
+ (progressDelta / reduces.length)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1138,8 +1109,10 @@ class JobInProgress {
|
|
status.getRunState() != JobStatus.PREP) {
|
|
status.getRunState() != JobStatus.PREP) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- // check if cleanup task has been launched already.
|
|
|
|
- if (launchedCleanup) {
|
|
|
|
|
|
+ // check if cleanup task has been launched already or if setup isn't
|
|
|
|
+ // launched already. The later check is useful when number of maps is
|
|
|
|
+ // zero.
|
|
|
|
+ if (launchedCleanup || !isSetupFinished()) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
// check if job has failed or killed
|
|
// check if job has failed or killed
|
|
@@ -1173,7 +1146,6 @@ class JobInProgress {
|
|
if (!canLaunchSetupTask()) {
|
|
if (!canLaunchSetupTask()) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
-
|
|
|
|
String taskTracker = tts.getTrackerName();
|
|
String taskTracker = tts.getTrackerName();
|
|
// Update the last-known clusterSize
|
|
// Update the last-known clusterSize
|
|
this.clusterSize = clusterSize;
|
|
this.clusterSize = clusterSize;
|
|
@@ -2121,6 +2093,12 @@ class JobInProgress {
|
|
if (this.status.getRunState() == JobStatus.RUNNING ) {
|
|
if (this.status.getRunState() == JobStatus.RUNNING ) {
|
|
this.status.setRunState(JobStatus.SUCCEEDED);
|
|
this.status.setRunState(JobStatus.SUCCEEDED);
|
|
this.status.setCleanupProgress(1.0f);
|
|
this.status.setCleanupProgress(1.0f);
|
|
|
|
+ if (maps.length == 0) {
|
|
|
|
+ this.status.setMapProgress(1.0f);
|
|
|
|
+ }
|
|
|
|
+ if (reduces.length == 0) {
|
|
|
|
+ this.status.setReduceProgress(1.0f);
|
|
|
|
+ }
|
|
this.finishTime = System.currentTimeMillis();
|
|
this.finishTime = System.currentTimeMillis();
|
|
LOG.info("Job " + this.status.getJobID() +
|
|
LOG.info("Job " + this.status.getJobID() +
|
|
" has completed successfully.");
|
|
" has completed successfully.");
|
|
@@ -2438,6 +2416,14 @@ class JobInProgress {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ boolean isSetupFinished() {
|
|
|
|
+ if (setup[0].isComplete() || setup[0].isFailed() || setup[1].isComplete()
|
|
|
|
+ || setup[1].isFailed()) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Fail a task with a given reason, but without a status object.
|
|
* Fail a task with a given reason, but without a status object.
|
|
*
|
|
*
|