@Override protected void reduce_(K key, SuspendableIterator<Long> counters, Context context) throws Exception { long counterSum = 0; while (counters.hasNext()) { counterSum += counters.next(); } emit(key, counterSum); }
public boolean hasNext() throws SuspendExecution { return counter < loopLimit && wrapped.hasNext(); }