shuffleMetrics.serverHandlerBusy();
if(ClientTraceLog.isInfoEnabled())
startTime = System.nanoTime();
outStream = response.getOutputStream();
JobConf conf = (JobConf) context.getAttribute("conf");
LocalDirAllocator lDirAlloc =
(LocalDirAllocator)context.getAttribute("localDirAllocator");
FileSystem rfs = ((LocalFileSystem)
context.getAttribute("local.file.system")).getRaw();
String userName = null;
String runAsUserName = null;
synchronized (tracker.runningJobs) {
RunningJob rjob = tracker.runningJobs.get(JobID.forName(jobId));
if (rjob == null) {
throw new IOException("Unknown job " + jobId + "!!");
}
userName = rjob.jobConf.getUser();
runAsUserName = tracker.getTaskController().getRunAsUser(rjob.jobConf);
}
// Index file
String intermediateOutputDir = TaskTracker.getIntermediateOutputDir(userName, jobId, mapId);
String indexKey = intermediateOutputDir + "/file.out.index";
Path indexFileName = fileIndexCache.get(indexKey);
if (indexFileName == null) {
indexFileName = lDirAlloc.getLocalPathToRead(indexKey, conf);
fileIndexCache.put(indexKey, indexFileName);
}
// Map-output file
String fileKey = intermediateOutputDir + "/file.out";
Path mapOutputFileName = fileCache.get(fileKey);
if (mapOutputFileName == null) {
mapOutputFileName = lDirAlloc.getLocalPathToRead(fileKey, conf);
fileCache.put(fileKey, mapOutputFileName);
}
/**