Skip to content

Commit

Permalink
Added TopPopularLinks implementation #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrés Gomez committed Sep 11, 2015
1 parent 41b481c commit 4f2cede
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TopPopularLinks.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ protected void setup(Context context) throws IOException,InterruptedException {
@Override
public void reduce(NullWritable key, Iterable<IntArrayWritable> 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<Integer, Integer>(count, link));

if (countToLinkMap.size() > this.N) {
Expand Down

0 comments on commit 4f2cede

Please sign in to comment.