T - The type of the record that can be read from this record reader.public class RecordReader<T extends IOReadableWritable> extends AbstractSingleGateRecordReader<T> implements Reader<T>
inputGate| Constructor and Description |
|---|
RecordReader(AbstractInvokable taskBase,
Class<T> recordType)
Constructs a new record reader and registers a new input gate with the application's environment.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Checks if at least one more record can be read from the associated input gate.
|
boolean |
isInputClosed() |
T |
next()
Reads the current record from the associated input gate.
|
getInputGate, getNumberOfInputChannels, publishEvent, publishEventhandleEvent, hasReachedEndOfSuperstep, incrementEndOfSuperstepEventAndCheck, setIterative, startNextSuperstep, subscribeToEvent, unsubscribeFromEventclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasReachedEndOfSuperstep, publishEvent, publishEvent, setIterative, startNextSuperstep, subscribeToEvent, unsubscribeFromEventpublic RecordReader(AbstractInvokable taskBase, Class<T> recordType)
taskBase - The application that instantiated the record reader.recordType - The class of records that can be read from the record reader.public boolean hasNext()
throws IOException,
InterruptedException
hasNext in interface Reader<T extends IOReadableWritable>trueit at least one more record can be read from the associated input gate, otherwise
falseIOExceptionInterruptedExceptionpublic T next() throws IOException, InterruptedException
next in interface Reader<T extends IOReadableWritable>IOException - thrown if any error occurs while reading the record from the input gateInterruptedExceptionpublic boolean isInputClosed()
isInputClosed in interface ReaderBaseCopyright © 2015 The Apache Software Foundation. All rights reserved.