@Override
	public void map(IntWritable inKey, IntWritable inValue,
			Context context) throws IOException, InterruptedException {

		Configuration conf = context.getConfiguration();
		int topResults = Integer.parseInt(conf.get("inlinks.top_results"));

		int page = inKey.get(), pageInLinks = inValue.get();

		if (topN.size() < topResults || pageInLinks >= topN.peek().getKey()) {
			topN.add(new AbstractMap.SimpleEntry<Integer, Integer>(pageInLinks, page));
			if (topN.size() > topResults) {
				topN.poll();
			}
		}
	}