Class RecordReader<T extends IOReadableWritable>
- java.lang.Object
-
- org.apache.flink.runtime.io.network.api.reader.AbstractReader
-
- org.apache.flink.runtime.io.network.api.reader.RecordReader<T>
-
- Type Parameters:
T
- Thy type of the records that is read.
- All Implemented Interfaces:
Reader<T>
,ReaderBase
public class RecordReader<T extends IOReadableWritable> extends AbstractReader implements Reader<T>
Record oriented reader for immutable types.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.io.network.api.reader.AbstractReader
inputGate
-
-
Constructor Summary
Constructors Constructor Description RecordReader(InputGate inputGate, Class<T> recordType, String[] tmpDirectories)
Creates a new RecordReader that de-serializes records from the given input gate and can spill partial records to disk, if they grow large.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearBuffers()
protected boolean
getNextRecord(T target)
boolean
hasNext()
T
next()
-
Methods inherited from class org.apache.flink.runtime.io.network.api.reader.AbstractReader
handleEvent, hasReachedEndOfSuperstep, isFinished, publish, registerTaskEventListener, sendTaskEvent, setIterativeReader, startNextSuperstep
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.io.network.api.reader.ReaderBase
hasReachedEndOfSuperstep, isFinished, registerTaskEventListener, sendTaskEvent, setIterativeReader, startNextSuperstep
-
-
-
-
Constructor Detail
-
RecordReader
public RecordReader(InputGate inputGate, Class<T> recordType, String[] tmpDirectories)
Creates a new RecordReader that de-serializes records from the given input gate and can spill partial records to disk, if they grow large.- Parameters:
inputGate
- The input gate to read from.tmpDirectories
- The temp directories. USed for spilling if the reader concurrently reconstructs multiple large records.
-
-
Method Detail
-
hasNext
public boolean hasNext() throws IOException, InterruptedException
- Specified by:
hasNext
in interfaceReader<T extends IOReadableWritable>
- Throws:
IOException
InterruptedException
-
next
public T next() throws IOException, InterruptedException
- Specified by:
next
in interfaceReader<T extends IOReadableWritable>
- Throws:
IOException
InterruptedException
-
clearBuffers
public void clearBuffers()
- Specified by:
clearBuffers
in interfaceReader<T extends IOReadableWritable>
-
getNextRecord
protected boolean getNextRecord(T target) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
-