public class BlockResettableIterator<T> extends Object implements ResettableIterator<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected SimpleCollectingOutputView |
collectingView |
protected ArrayList<MemorySegment> |
emptySegments |
protected ArrayList<MemorySegment> |
fullSegments |
protected Iterator<T> |
input |
static org.slf4j.Logger |
LOG |
protected int |
numRecordsInBuffer |
protected int |
numRecordsReturned |
protected RandomAccessInputView |
readView |
protected TypeSerializer<T> |
serializer |
| Constructor and Description |
|---|
BlockResettableIterator(MemoryManager memoryManager,
Iterator<T> input,
TypeSerializer<T> serializer,
int numPages,
AbstractInvokable ownerTask) |
BlockResettableIterator(MemoryManager memoryManager,
TypeSerializer<T> serializer,
int numPages,
AbstractInvokable ownerTask) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This method closes the iterator and releases all resources.
|
protected T |
getNextRecord(T reuse) |
boolean |
hasFurtherInput()
Checks, whether the input that is blocked by this iterator, has further elements
available.
|
boolean |
hasNext() |
T |
next() |
boolean |
nextBlock()
Move the iterator to the next memory block.
|
void |
open() |
void |
remove() |
void |
reopen(Iterator<T> input) |
void |
reset()
Resets the iterator.
|
protected boolean |
writeNextRecord(T record) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic static final org.slf4j.Logger LOG
protected final RandomAccessInputView readView
protected final SimpleCollectingOutputView collectingView
protected final TypeSerializer<T> serializer
protected int numRecordsInBuffer
protected int numRecordsReturned
protected final ArrayList<MemorySegment> emptySegments
protected final ArrayList<MemorySegment> fullSegments
protected volatile boolean closed
public BlockResettableIterator(MemoryManager memoryManager, Iterator<T> input, TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask) throws MemoryAllocationException
MemoryAllocationExceptionpublic BlockResettableIterator(MemoryManager memoryManager, TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask) throws MemoryAllocationException
MemoryAllocationExceptionpublic void reopen(Iterator<T> input) throws IOException
IOExceptionpublic void reset()
ResettableIteratorreset in interface ResettableIterator<T>public boolean nextBlock()
throws IOException
MemoryBlockIteratornextBlock in interface MemoryBlockIteratorIOException - Thrown, when advancing to the next block failed.public boolean hasFurtherInput()
public void close()
public void open()
protected boolean writeNextRecord(T record)
throws IOException
IOExceptionprotected T getNextRecord(T reuse)
throws IOException
IOExceptionCopyright © 2015 The Apache Software Foundation. All rights reserved.