public class BlockResettableMutableObjectIterator<T> extends Object implements ResettableMutableObjectIterator<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
protected SimpleCollectingOutputView |
collectingView |
protected ArrayList<MemorySegment> |
emptySegments |
protected ArrayList<MemorySegment> |
fullSegments |
static org.slf4j.Logger |
LOG |
protected int |
numRecordsInBuffer |
protected int |
numRecordsReturned |
protected RandomAccessInputView |
readView |
protected TypeSerializer<T> |
serializer |
Constructor and Description |
---|
BlockResettableMutableObjectIterator(MemoryManager memoryManager,
MutableObjectIterator<T> input,
TypeSerializer<T> serializer,
int numMemoryPages,
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.
|
T |
next()
Gets the next element from the collection.
|
T |
next(T target)
Gets the next element from the collection.
|
boolean |
nextBlock()
Move the iterator to the next memory block.
|
void |
open() |
void |
reset()
Resets the iterator.
|
protected boolean |
writeNextRecord(T record) |
public 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 BlockResettableMutableObjectIterator(MemoryManager memoryManager, MutableObjectIterator<T> input, TypeSerializer<T> serializer, int numMemoryPages, AbstractInvokable ownerTask) throws MemoryAllocationException
MemoryAllocationException
public T next(T target) throws IOException
MutableObjectIterator
next
in interface MutableObjectIterator<T>
target
- The target object into which to place next element if E is mutable.null
if the iterator is exhausted.IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the
serialization / deserialization logicpublic T next() throws IOException
MutableObjectIterator
next
in interface MutableObjectIterator<T>
null
if the iterator is exhausted.IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the
serialization / deserialization logicpublic void reset()
ResettableMutableObjectIterator
reset
in interface ResettableMutableObjectIterator<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–2024 The Apache Software Foundation. All rights reserved.