Class SpillingResettableMutableObjectIterator<T>
- java.lang.Object
-
- org.apache.flink.runtime.operators.resettable.SpillingResettableMutableObjectIterator<T>
-
- Type Parameters:
T- The type of record that the iterator handles.
- All Implemented Interfaces:
ResettableMutableObjectIterator<T>,org.apache.flink.util.MutableObjectIterator<T>
public class SpillingResettableMutableObjectIterator<T> extends Object implements ResettableMutableObjectIterator<T>
Implementation of a resettable iterator. While iterating the first time over the data, the iterator writes the records to a spillable buffer. Any subsequent iteration re-reads the data from that buffer.
-
-
Field Summary
Fields Modifier and Type Field Description protected SpillingBufferbufferprotected org.apache.flink.util.MutableObjectIterator<T>inputprotected org.apache.flink.core.memory.DataInputViewinViewprotected MemoryManagermemoryManagerprotected org.apache.flink.api.common.typeutils.TypeSerializer<T>serializer
-
Constructor Summary
Constructors Constructor Description SpillingResettableMutableObjectIterator(org.apache.flink.util.MutableObjectIterator<T> input, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, MemoryManager memoryManager, IOManager ioManager, int numPages, AbstractInvokable parentTask)SpillingResettableMutableObjectIterator(org.apache.flink.util.MutableObjectIterator<T> input, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, MemoryManager memoryManager, IOManager ioManager, List<org.apache.flink.core.memory.MemorySegment> memory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.apache.flink.core.memory.MemorySegment>close()voidconsumeAndCacheRemainingData()Tnext()Tnext(T reuse)voidopen()voidreset()Resets the iterator.
-
-
-
Field Detail
-
inView
protected org.apache.flink.core.memory.DataInputView inView
-
serializer
protected final org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer
-
buffer
protected final SpillingBuffer buffer
-
input
protected final org.apache.flink.util.MutableObjectIterator<T> input
-
memoryManager
protected final MemoryManager memoryManager
-
-
Constructor Detail
-
SpillingResettableMutableObjectIterator
public SpillingResettableMutableObjectIterator(org.apache.flink.util.MutableObjectIterator<T> input, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, MemoryManager memoryManager, IOManager ioManager, int numPages, AbstractInvokable parentTask) throws MemoryAllocationException
- Throws:
MemoryAllocationException
-
SpillingResettableMutableObjectIterator
public SpillingResettableMutableObjectIterator(org.apache.flink.util.MutableObjectIterator<T> input, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, MemoryManager memoryManager, IOManager ioManager, List<org.apache.flink.core.memory.MemorySegment> memory)
-
-
Method Detail
-
open
public void open()
-
reset
public void reset() throws IOExceptionDescription copied from interface:ResettableMutableObjectIteratorResets the iterator.- Specified by:
resetin interfaceResettableMutableObjectIterator<T>- Throws:
IOException- May be thrown when the serialization into buffers or the spilling to secondary storage fails.
-
close
public List<org.apache.flink.core.memory.MemorySegment> close() throws IOException
- Throws:
IOException
-
next
public T next(T reuse) throws IOException
- Specified by:
nextin interfaceorg.apache.flink.util.MutableObjectIterator<T>- Throws:
IOException
-
next
public T next() throws IOException
- Specified by:
nextin interfaceorg.apache.flink.util.MutableObjectIterator<T>- Throws:
IOException
-
consumeAndCacheRemainingData
public void consumeAndCacheRemainingData() throws IOException- Throws:
IOException
-
-