diff --git a/TopPopularLinks.java b/TopPopularLinks.java index 816c73e..24efb71 100644 --- a/TopPopularLinks.java +++ b/TopPopularLinks.java @@ -157,9 +157,9 @@ protected void setup(Context context) throws IOException,InterruptedException { @Override public void reduce(NullWritable key, Iterable values, Context context) throws IOException, InterruptedException { for (IntArrayWritable val: values) { - Integer[] pair= (Integer[]) val.toArray(); - Integer link = pair[0]; - Integer count = pair[1]; + IntWritable[] pair= (IntWritable[]) val.toArray(); + Integer link = pair[0].get(); + Integer count = pair[1].get(); countToLinkMap.add(new Pair(count, link)); if (countToLinkMap.size() > this.N) {