Skip to content

Commit

Permalink
Merge pull request #401 from balashashanka/MAHOUT-2096
Browse files Browse the repository at this point in the history
MAHOUT-2096 [WIP] next() Called On Possible Empty iterator()
  • Loading branch information
rawkintrevo authored Jan 25, 2024
2 parents 343fc71 + 358f72a commit 21a14af
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,11 @@ static class IDMapReducer extends Reducer<VarIntWritable,VarLongWritable,VarIntW
@Override
protected void reduce(VarIntWritable index, Iterable<VarLongWritable> ids, Context ctx)
throws IOException, InterruptedException {
ctx.write(index, ids.iterator().next());
if (ids.iterator().hasNext()) {
ctx.write(index, ids.iterator().next());
} else {
log.debug("Iterator is empty");
}
}
}

Expand Down

0 comments on commit 21a14af

Please sign in to comment.