public void close() throws IOException, InterruptedException { long totalSize = 0; for (int i = 0; i < numberOfPartitions; i++) { recordWriters[i].close(); outStreams[i].close(); totalSize += outStreams[i].size(); } MapOutputFile mapOutputFile = mapTask.getMapOutputFile(); Path finalOutput = mapOutputFile.getOutputFileForWrite(totalSize); Path indexPath = mapOutputFile.getOutputIndexFileForWrite( numberOfPartitions*mapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH); // Copy partitions to final map output. copyPartitions(finalOutput, indexPath); }
mapOutputFile.getOutputFileForWrite(finalOutFileSize); Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite(finalIndexFileSize);
mapOutputFile.getOutputFileForWrite(finalOutFileSize); Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite(finalIndexFileSize);
Path finalOutputFile = task.mapOutputFile.getOutputFileForWrite(mapId, finalOutFileSize); Path finalIndexFile = task.mapOutputFile.getOutputIndexFileForWrite(mapId, finalIndexFileSize);
mapOutputFile.getOutputFileForWrite(finalOutFileSize); Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite(finalIndexFileSize);
Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite( getTaskID(), finalIndexFileSize);
mapOutputFile.getOutputFileForWrite(finalOutFileSize); Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite(finalIndexFileSize);
Path finalOutputFile = mapOutputFile.getOutputFileForWrite(mapId, finalOutFileSize); Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite( mapId, finalIndexFileSize);
mapOutputFile.getOutputFileForWrite(finalOutFileSize); Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite(finalIndexFileSize);