MAPREDUCE-2705. Permits parallel multiple task launches. Contributed by Thomas Graves.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1153717 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2025d4e032
commit
44b7e03114
|
@ -209,6 +209,9 @@ Trunk (unreleased changes)
|
||||||
MAPREDUCE-2602. Allow setting of end-of-record delimiter for
|
MAPREDUCE-2602. Allow setting of end-of-record delimiter for
|
||||||
TextInputFormat for the old API. (Ahmed Radwan via todd)
|
TextInputFormat for the old API. (Ahmed Radwan via todd)
|
||||||
|
|
||||||
|
MAPREDUCE-2705. Permits parallel multiple task launches.
|
||||||
|
(Thomas Graves via ddas)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
MAPREDUCE-2026. Make JobTracker.getJobCounters() and
|
MAPREDUCE-2026. Make JobTracker.getJobCounters() and
|
||||||
|
|
|
@ -1253,7 +1253,7 @@ public class TaskTracker
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void launchTaskForJob(TaskInProgress tip, JobConf jobConf,
|
protected void launchTaskForJob(TaskInProgress tip, JobConf jobConf,
|
||||||
UserGroupInformation ugi) throws IOException {
|
UserGroupInformation ugi) throws IOException {
|
||||||
synchronized (tip) {
|
synchronized (tip) {
|
||||||
tip.setJobConf(jobConf);
|
tip.setJobConf(jobConf);
|
||||||
|
@ -2351,30 +2351,35 @@ public class TaskTracker
|
||||||
* All exceptions are handled locally, so that we don't mess up the
|
* All exceptions are handled locally, so that we don't mess up the
|
||||||
* task tracker.
|
* task tracker.
|
||||||
*/
|
*/
|
||||||
void startNewTask(TaskInProgress tip) {
|
void startNewTask(final TaskInProgress tip) {
|
||||||
try {
|
Thread launchThread = new Thread(new Runnable() {
|
||||||
RunningJob rjob = localizeJob(tip);
|
@Override
|
||||||
// Localization is done. Neither rjob.jobConf nor rjob.ugi can be null
|
public void run() {
|
||||||
launchTaskForJob(tip, new JobConf(rjob.jobConf), rjob.ugi);
|
try {
|
||||||
} catch (Throwable e) {
|
RunningJob rjob = localizeJob(tip);
|
||||||
String msg = ("Error initializing " + tip.getTask().getTaskID() +
|
// Localization is done. Neither rjob.jobConf nor rjob.ugi can be null
|
||||||
":\n" + StringUtils.stringifyException(e));
|
launchTaskForJob(tip, new JobConf(rjob.getJobConf()), rjob.ugi);
|
||||||
LOG.warn(msg);
|
} catch (Throwable e) {
|
||||||
tip.reportDiagnosticInfo(msg);
|
String msg = ("Error initializing " + tip.getTask().getTaskID() +
|
||||||
try {
|
":\n" + StringUtils.stringifyException(e));
|
||||||
tip.kill(true);
|
LOG.warn(msg);
|
||||||
tip.cleanup(true);
|
tip.reportDiagnosticInfo(msg);
|
||||||
} catch (IOException ie2) {
|
try {
|
||||||
LOG.info("Error cleaning up " + tip.getTask().getTaskID() + ":\n" +
|
tip.kill(true);
|
||||||
StringUtils.stringifyException(ie2));
|
tip.cleanup(true);
|
||||||
|
} catch (IOException ie2) {
|
||||||
|
LOG.info("Error cleaning up " + tip.getTask().getTaskID() + ":\n" +
|
||||||
|
StringUtils.stringifyException(ie2));
|
||||||
|
}
|
||||||
|
if (e instanceof Error) {
|
||||||
|
LOG.error("TaskLauncher error " +
|
||||||
|
StringUtils.stringifyException(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
launchThread.start();
|
||||||
|
|
||||||
// Careful!
|
|
||||||
// This might not be an 'Exception' - don't handle 'Error' here!
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw ((Error) e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void addToMemoryManager(TaskAttemptID attemptId, boolean isMap,
|
void addToMemoryManager(TaskAttemptID attemptId, boolean isMap,
|
||||||
|
|
Loading…
Reference in New Issue