Class ReusingBlockResettableIterator<T>
- java.lang.Object
-
- org.apache.flink.runtime.operators.resettable.NonReusingBlockResettableIterator<T>
-
- org.apache.flink.runtime.operators.resettable.ReusingBlockResettableIterator<T>
-
- All Implemented Interfaces:
Iterator<T>,MemoryBlockIterator,ResettableIterator<T>
public class ReusingBlockResettableIterator<T> extends NonReusingBlockResettableIterator<T>
Implementation of an iterator that fetches a block of data into main memory and offers resettable access to the data in that block.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanclosedprotected SimpleCollectingOutputViewcollectingViewprotected ArrayList<org.apache.flink.core.memory.MemorySegment>emptySegmentsprotected ArrayList<org.apache.flink.core.memory.MemorySegment>fullSegmentsstatic org.slf4j.LoggerLOGprotected intnumRecordsInBufferprotected intnumRecordsReturnedprotected RandomAccessInputViewreadViewprotected org.apache.flink.api.common.typeutils.TypeSerializer<T>serializer-
Fields inherited from class org.apache.flink.runtime.operators.resettable.NonReusingBlockResettableIterator
input, leftOverElement, nextElement, noMoreBlocks, readPhase
-
-
Constructor Summary
Constructors Constructor Description ReusingBlockResettableIterator(MemoryManager memoryManager, Iterator<T> input, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask)ReusingBlockResettableIterator(MemoryManager memoryManager, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TgetNextRecord()protected TgetNextRecord(T reuse)booleanhasNext()voidopen()protected booleanwriteNextRecord(T record)-
Methods inherited from class org.apache.flink.runtime.operators.resettable.NonReusingBlockResettableIterator
close, hasFurtherInput, next, nextBlock, remove, reopen, reset
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
LOG
public static final org.slf4j.Logger LOG
-
readView
protected final RandomAccessInputView readView
-
collectingView
protected final SimpleCollectingOutputView collectingView
-
serializer
protected final org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer
-
numRecordsInBuffer
protected int numRecordsInBuffer
-
numRecordsReturned
protected int numRecordsReturned
-
emptySegments
protected final ArrayList<org.apache.flink.core.memory.MemorySegment> emptySegments
-
fullSegments
protected final ArrayList<org.apache.flink.core.memory.MemorySegment> fullSegments
-
closed
protected volatile boolean closed
-
-
Constructor Detail
-
ReusingBlockResettableIterator
public ReusingBlockResettableIterator(MemoryManager memoryManager, Iterator<T> input, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask) throws MemoryAllocationException
- Throws:
MemoryAllocationException
-
ReusingBlockResettableIterator
public ReusingBlockResettableIterator(MemoryManager memoryManager, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, int numPages, AbstractInvokable ownerTask) throws MemoryAllocationException
- Throws:
MemoryAllocationException
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
open
public void open()
-
writeNextRecord
protected boolean writeNextRecord(T record) throws IOException- Throws:
IOException
-
getNextRecord
protected T getNextRecord(T reuse) throws IOException- Throws:
IOException
-
getNextRecord
protected T getNextRecord() throws IOException- Throws:
IOException
-
-