Source:
<code>private boolean iterateLoop() { Iterable.CloseableIterator iterator; long getIteratorStart = System.nanoTime(); try { if (converter == null) { iterator = iterable.getIterator(containerName, filter); } else { iterator = iterable.getIterator(containerName, filter, converter); } stats.registerRequest(System.nanoTime() - getIteratorStart, Iterable.GET_ITERATOR); } catch (Exception e) { log.error("Failed to get the iterator", e); this.failed = true; return true; } int nextFailures = 0; long elements = 0; long loopStart = System.nanoTime(); while (!terminate) { boolean hasNext; long hasNextStart = System.nanoTime(); try { hasNext = iterator.hasNext(); stats.registerRequest(System.nanoTime() - hasNextStart, Iterable.HAS_NEXT); } catch (Exception e) { stats.registerError(System.nanoTime() - hasNextStart, Iterable.HAS_NEXT); hasNext = false; log.error("hasNext() failed", e); } if (!hasNext) break; long nextStart = System.nanoTime(); try { iterator.next(); stats.registerRequest(System.nanoTime() - nextStart, Iterable.NEXT); elements++; } catch (Exception e) { stats.registerError(System.nanoTime() - nextStart, Iterable.NEXT); log.error("next() failed", e); nextFailures++; <START> if (nextFailures >= maxNextFailures) { <END> failed = true; break; } } } if (minElements < 0 || elements < minElements) minElements = elements; if (maxElements < 0 || elements > maxElements) maxElements = elements; try { iterator.close(); } catch (IOException e) { log.error("Failed to close the iterator", e); failed = true; } stats.registerRequest(System.nanoTime() - loopStart, Iterable.FULL_LOOP); return false; }</code><technical_language>doc, this fail nextFailures > maxNextFailures</technical_language>

Target:
private boolean iterateLoop() { Iterable.CloseableIterator iterator; long getIteratorStart = System.nanoTime(); try { if (converter == null) { iterator = iterable.getIterator(containerName, filter); } else { iterator = iterable.getIterator(containerName, filter, converter); } stats.registerRequest(System.nanoTime() - getIteratorStart, Iterable.GET_ITERATOR); } catch (Exception e) { log.error("Failed to get the iterator", e); this.failed = true; return true; } int nextFailures = 0; long elements = 0; long loopStart = System.nanoTime(); while (!terminate) { boolean hasNext; long hasNextStart = System.nanoTime(); try { hasNext = iterator.hasNext(); stats.registerRequest(System.nanoTime() - hasNextStart, Iterable.HAS_NEXT); } catch (Exception e) { stats.registerError(System.nanoTime() - hasNextStart, Iterable.HAS_NEXT); hasNext = false; log.error("hasNext() failed", e); } if (!hasNext) break; long nextStart = System.nanoTime(); try { iterator.next(); stats.registerRequest(System.nanoTime() - nextStart, Iterable.NEXT); elements++; } catch (Exception e) { stats.registerError(System.nanoTime() - nextStart, Iterable.NEXT); log.error("next() failed", e); nextFailures++; if (nextFailures > maxNextFailures) { failed = true; break; } } } if (minElements < 0 || elements < minElements) minElements = elements; if (maxElements < 0 || elements > maxElements) maxElements = elements; try { iterator.close(); } catch (IOException e) { log.error("Failed to close the iterator", e); failed = true; } stats.registerRequest(System.nanoTime() - loopStart, Iterable.FULL_LOOP); return false; }