Class ReaderIterator<T>
- java.lang.Object
-
- org.apache.flink.runtime.operators.util.ReaderIterator<T>
-
- All Implemented Interfaces:
MutableObjectIterator<T>
public class ReaderIterator<T> extends Object implements MutableObjectIterator<T>
AMutableObjectIterator
that wraps a reader from an input channel and produces the reader's records.The reader supports reading objects with possible reuse of mutable types, and without reuse of mutable types.
-
-
Constructor Summary
Constructors Constructor Description ReaderIterator(MutableReader<DeserializationDelegate<T>> reader, TypeSerializer<T> serializer)
Creates a new iterator, wrapping the given reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
next()
Gets the next element from the collection.T
next(T target)
Gets the next element from the collection.
-
-
-
Constructor Detail
-
ReaderIterator
public ReaderIterator(MutableReader<DeserializationDelegate<T>> reader, TypeSerializer<T> serializer)
Creates a new iterator, wrapping the given reader.- Parameters:
reader
- The reader to wrap.
-
-
Method Detail
-
next
public T next(T target) throws IOException
Description copied from interface:MutableObjectIterator
Gets the next element from the collection. The contents of that next element is put into the given reuse object, if the type is mutable.- Specified by:
next
in interfaceMutableObjectIterator<T>
- Parameters:
target
- The target object into which to place next element if E is mutable.- Returns:
- The filled object or
null
if the iterator is exhausted. - Throws:
IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the serialization / deserialization logic
-
next
public T next() throws IOException
Description copied from interface:MutableObjectIterator
Gets the next element from the collection. The iterator implementation must obtain a new instance.- Specified by:
next
in interfaceMutableObjectIterator<T>
- Returns:
- The object or
null
if the iterator is exhausted. - Throws:
IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the serialization / deserialization logic
-
-