@Override
	protected void cleanup(Context context) throws IOException,
			InterruptedException {

		Configuration conf = context.getConfiguration();
		Path titlesDir = new Path(conf.get("inlinks.titles_dir"));

		MapFile.Reader[] readers = MapFileOutputFormat.getReaders(titlesDir, conf);
		Partitioner<IntWritable, Text> partitioner = new HashPartitioner<IntWritable, Text>();
		IntWritable page = new IntWritable();
		Text title = new Text();

		int[] inLinks = new int[topN.size()];
		String[] titles = new String[topN.size()];

		for (int i = inLinks.length - 1; i >= 0; i--) {
			Map.Entry<Integer, Integer> entry = topN.poll();
			page.set(entry.getValue());
			MapFileOutputFormat.getEntry(readers, partitioner, page, title);
			inLinks[i] = entry.getKey();
			titles[i] = title.toString();
		}

		for (MapFile.Reader reader : readers) {
			reader.close();
		}

		for (int i = 0; i < inLinks.length; i++) {
			context.write(new IntWritable(inLinks[i]), new Text(titles[i]));
		}
	}