public class RecordReader<T extends IOReadableWritable> extends AbstractReader implements Reader<T>
inputGate
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
void |
clearBuffers() |
protected boolean |
getNextRecord(T target) |
boolean |
hasNext() |
T |
next() |
handleEvent, hasReachedEndOfSuperstep, isFinished, publish, registerTaskEventListener, sendTaskEvent, setIterativeReader, startNextSuperstep
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasReachedEndOfSuperstep, isFinished, registerTaskEventListener, sendTaskEvent, setIterativeReader, startNextSuperstep
public RecordReader(InputGate inputGate, Class<T> recordType, String[] tmpDirectories)
inputGate
- The input gate to read from.tmpDirectories
- The temp directories. USed for spilling if the reader concurrently
reconstructs multiple large records.public boolean hasNext() throws IOException, InterruptedException
hasNext
in interface Reader<T extends IOReadableWritable>
IOException
InterruptedException
public T next() throws IOException, InterruptedException
next
in interface Reader<T extends IOReadableWritable>
IOException
InterruptedException
public void clearBuffers()
clearBuffers
in interface Reader<T extends IOReadableWritable>
protected boolean getNextRecord(T target) throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.