/** * This function returns the index information for the given mapId, Spill * number and reducer combination. Index Information is obtained * transparently from either the indexMap or the underlying indexFile * @param mapId * @param spillNum * @param reducer * @return * @throws IOException */ private IndexRecord getIndexInformation( TaskAttemptID mapId, int spillNum, int reducer) throws IOException { IndexRecord[] irArray = null; if (indexCacheList.size() > spillNum) { irArray = indexCacheList.get(spillNum); } else { Path indexFileName = mapOutputFile.getSpillIndexFile(mapId, spillNum); irArray = IndexRecord.readIndexFile(indexFileName, job); indexCacheList.add(spillNum,irArray); rfs.delete(indexFileName,false); } return irArray[reducer]; }
rfs.rename(filename[0], outFile); if (indexCacheList.size() == 0) { rfs.rename(task.mapOutputFile.getSpillIndexFile(mapId, 0), new Path( filename[0].getParent(), "file.out.index")); } else { Path indexFileName = task.mapOutputFile.getSpillIndexFile(mapId, i); indexCacheList.add(new SpillRecord(indexFileName, job));
new Path(filename[0].getParent(), "file.out")); if (indexCacheList.size() == 0) { rfs.rename(mapOutputFile.getSpillIndexFile(mapId, 0), new Path(filename[0].getParent(),"file.out.index")); } else { Path indexFileName = mapOutputFile.getSpillIndexFile(mapId, i); indexCacheList.add(new SpillRecord(indexFileName, job));
new Path(filename[0].getParent(), "file.out")); if (indexCacheList.size() == 0) { rfs.rename(mapOutputFile.getSpillIndexFile(0), new Path(filename[0].getParent(),"file.out.index")); } else { Path indexFileName = mapOutputFile.getSpillIndexFile(i); indexCacheList.add(new SpillRecord(indexFileName, job));
new Path(filename[0].getParent(), "file.out")); if (indexCacheList.size() == 0) { rfs.rename(mapOutputFile.getSpillIndexFile(getTaskID(), 0), new Path(filename[0].getParent(),"file.out.index"));
mapOutputFile.getOutputFileForWriteInVolume(filename[0])); if (indexCacheList.size() == 0) { sameVolRename(mapOutputFile.getSpillIndexFile(0), mapOutputFile.getOutputIndexFileForWriteInVolume(filename[0])); } else { Path indexFileName = mapOutputFile.getSpillIndexFile(i); indexCacheList.add(new SpillRecord(indexFileName, job));
mapOutputFile.getOutputFileForWriteInVolume(filename[0])); if (indexCacheList.size() == 0) { sameVolRename(mapOutputFile.getSpillIndexFile(0), mapOutputFile.getOutputIndexFileForWriteInVolume(filename[0])); } else { Path indexFileName = mapOutputFile.getSpillIndexFile(i); indexCacheList.add(new SpillRecord(indexFileName, job));
mapOutputFile.getOutputFileForWriteInVolume(filename[0])); if (indexCacheList.size() == 0) { sameVolRename(mapOutputFile.getSpillIndexFile(0), mapOutputFile.getOutputIndexFileForWriteInVolume(filename[0])); } else { Path indexFileName = mapOutputFile.getSpillIndexFile(i); indexCacheList.add(new SpillRecord(indexFileName, job));
mapOutputFile.getOutputFileForWriteInVolume(filename[0])); if (indexCacheList.size() == 0) { sameVolRename(mapOutputFile.getSpillIndexFile(0), mapOutputFile.getOutputIndexFileForWriteInVolume(filename[0])); } else { Path indexFileName = mapOutputFile.getSpillIndexFile(i); indexCacheList.add(new SpillRecord(indexFileName, job));