MAPREDUCE-2489. Jobsplits with random hostnames can make the queue unusable (jeffrey naisbit via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1156821 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mahadev Konar 2011-08-11 20:42:28 +00:00
parent 86195ceb18
commit 3228351856
3 changed files with 12 additions and 2 deletions

View File

@ -212,6 +212,9 @@ Trunk (unreleased changes)
MAPREDUCE-2705. Permits parallel multiple task launches. MAPREDUCE-2705. Permits parallel multiple task launches.
(Thomas Graves via ddas) (Thomas Graves via ddas)
MAPREDUCE-2489. Jobsplits with random hostnames can make the queue
unusable (jeffrey naisbit via mahadev)
OPTIMIZATIONS OPTIMIZATIONS
MAPREDUCE-2026. Make JobTracker.getJobCounters() and MAPREDUCE-2026. Make JobTracker.getJobCounters() and

View File

@ -20,6 +20,7 @@
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.UnknownHostException;
import java.security.PrivilegedExceptionAction; import java.security.PrivilegedExceptionAction;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -622,7 +623,7 @@ void setNumSlotsPerReduce(int numSlotsPerReduce) {
* at {@link JobTracker#initJob(JobInProgress)} for more details. * at {@link JobTracker#initJob(JobInProgress)} for more details.
*/ */
public synchronized void initTasks() public synchronized void initTasks()
throws IOException, KillInterruptedException { throws IOException, KillInterruptedException, UnknownHostException {
if (tasksInited.get() || isComplete()) { if (tasksInited.get() || isComplete()) {
return; return;
} }
@ -653,6 +654,11 @@ public synchronized void initTasks()
checkTaskLimits(); checkTaskLimits();
// Sanity check the locations so we don't create/initialize unnecessary tasks
for (TaskSplitMetaInfo split : taskSplitMetaInfo) {
NetUtils.verifyHostnames(split.getLocations());
}
jobtracker.getInstrumentation().addWaitingMaps(getJobID(), numMapTasks); jobtracker.getInstrumentation().addWaitingMaps(getJobID(), numMapTasks);
jobtracker.getInstrumentation().addWaitingReduces(getJobID(), numReduceTasks); jobtracker.getInstrumentation().addWaitingReduces(getJobID(), numReduceTasks);

View File

@ -2778,7 +2778,8 @@ private void updateNodeHealthStatus(TaskTrackerStatus trackerStatus) {
*/ */
synchronized boolean processHeartbeat( synchronized boolean processHeartbeat(
TaskTrackerStatus trackerStatus, TaskTrackerStatus trackerStatus,
boolean initialContact) { boolean initialContact)
throws UnknownHostException {
getInstrumentation().heartbeat(); getInstrumentation().heartbeat();