public class NonReusingBlockResettableIterator<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 |
protected T |
leftOverElement |
static org.slf4j.Logger |
LOG |
protected T |
nextElement |
protected boolean |
noMoreBlocks |
protected int |
numRecordsInBuffer |
protected int |
numRecordsReturned |
protected boolean |
readPhase |
protected RandomAccessInputView |
readView |
protected TypeSerializer<T> |
serializer |
Constructor and Description |
---|
NonReusingBlockResettableIterator(MemoryManager memoryManager,
Iterator<T> input,
TypeSerializer<T> serializer,
int numPages,
AbstractInvokable ownerTask) |
NonReusingBlockResettableIterator(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() |
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, wait
forEachRemaining
public static final org.slf4j.Logger LOG
protected T nextElement
protected T leftOverElement
protected boolean readPhase
protected boolean noMoreBlocks
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 NonReusingBlockResettableIterator(MemoryManager memoryManager, Iterator<T> input, TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask) throws MemoryAllocationException
MemoryAllocationException
public NonReusingBlockResettableIterator(MemoryManager memoryManager, TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask) throws MemoryAllocationException
MemoryAllocationException
public void reopen(Iterator<T> input) throws IOException
IOException
public void reset()
ResettableIterator
reset
in interface ResettableIterator<T>
public boolean nextBlock() throws IOException
MemoryBlockIterator
nextBlock
in interface MemoryBlockIterator
IOException
- Thrown, when advancing to the next block failed.public boolean hasFurtherInput()
public void close()
public void open()
protected boolean writeNextRecord(T record) throws IOException
IOException
protected T getNextRecord(T reuse) throws IOException
IOException
protected T getNextRecord() throws IOException
IOException
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.