@Override public Entry next() throws IOException { if (currHead != null) { if (!currHead.nextHead()) { this.heap.poll(); } else { this.heap.adjustTop(); } } if (this.heap.size() > 0) { currHead = this.heap.peek(); return currHead.getHead(); } else { return null; } }
/** * Gets the next smallest element, with respect to the definition of order implied by * the {@link TypeSerializer} provided to this iterator. * * @return The next element if the iterator has another element, null otherwise. * * @see org.apache.flink.util.MutableObjectIterator#next() */ @Override public E next() throws IOException { if (this.heap.size() > 0) { // get the smallest element final HeadStream<E> top = this.heap.peek(); E result = top.getHead(); // read an element if (!top.nextHead()) { this.heap.poll(); } else { this.heap.adjustTop(); } return result; } else { return null; } }
/** * Gets the next smallest element, with respect to the definition of order implied by * the {@link TypeSerializer} provided to this iterator. * * @return The next element if the iterator has another element, null otherwise. * * @see org.apache.flink.util.MutableObjectIterator#next() */ @Override public E next() throws IOException { if (this.heap.size() > 0) { // get the smallest element final HeadStream<E> top = this.heap.peek(); E result = top.getHead(); // read an element if (!top.nextHead()) { this.heap.poll(); } else { this.heap.adjustTop(); } return result; } else { return null; } }
/** * Gets the next smallest element, with respect to the definition of order implied by * the {@link TypeSerializer} provided to this iterator. * * @return The next element if the iterator has another element, null otherwise. * * @see org.apache.flink.util.MutableObjectIterator#next() */ @Override public E next() throws IOException { if (this.heap.size() > 0) { // get the smallest element final HeadStream<E> top = this.heap.peek(); E result = top.getHead(); // read an element if (!top.nextHead()) { this.heap.poll(); } else { this.heap.adjustTop(); } return result; } else { return null; } }
/** * Gets the next smallest element, with respect to the definition of order implied by * the {@link TypeSerializer} provided to this iterator. * * @return The next element if the iterator has another element, null otherwise. * * @see org.apache.flink.util.MutableObjectIterator#next() */ @Override public E next() throws IOException { if (this.heap.size() > 0) { // get the smallest element final HeadStream<E> top = this.heap.peek(); E result = top.getHead(); // read an element if (!top.nextHead()) { this.heap.poll(); } else { this.heap.adjustTop(); } return result; } else { return null; } }
heap.poll(); } else { heap.adjustTop();
this.heap.poll(); } else { this.heap.adjustTop();
this.heap.poll(); } else { this.heap.adjustTop();
this.heap.poll(); } else { this.heap.adjustTop();
this.heap.poll(); } else { this.heap.adjustTop();