Class AbstractReader
- java.lang.Object
-
- org.apache.flink.runtime.io.network.api.reader.AbstractReader
-
- All Implemented Interfaces:
ReaderBase
- Direct Known Subclasses:
MutableRecordReader
,RecordReader
public abstract class AbstractReader extends Object implements ReaderBase
A basic reader implementation, which wraps an input gate and handles events.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReader(InputGate inputGate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
handleEvent(AbstractEvent event)
Handles the event and returns whether the reader reached an end-of-stream event (either the end of the whole stream or the end of an superstep).boolean
hasReachedEndOfSuperstep()
boolean
isFinished()
Returns whether the reader has consumed the input.void
publish(TaskEvent event)
void
registerTaskEventListener(EventListener<TaskEvent> listener, Class<? extends TaskEvent> eventType)
void
sendTaskEvent(TaskEvent event)
void
setIterativeReader()
void
startNextSuperstep()
-
-
-
Field Detail
-
inputGate
protected final InputGate inputGate
The input gate to read from.
-
-
Constructor Detail
-
AbstractReader
protected AbstractReader(InputGate inputGate)
-
-
Method Detail
-
isFinished
public boolean isFinished()
Description copied from interface:ReaderBase
Returns whether the reader has consumed the input.- Specified by:
isFinished
in interfaceReaderBase
-
registerTaskEventListener
public void registerTaskEventListener(EventListener<TaskEvent> listener, Class<? extends TaskEvent> eventType)
- Specified by:
registerTaskEventListener
in interfaceReaderBase
-
sendTaskEvent
public void sendTaskEvent(TaskEvent event) throws IOException
- Specified by:
sendTaskEvent
in interfaceReaderBase
- Throws:
IOException
-
handleEvent
protected boolean handleEvent(AbstractEvent event) throws IOException
Handles the event and returns whether the reader reached an end-of-stream event (either the end of the whole stream or the end of an superstep).- Throws:
IOException
-
publish
public void publish(TaskEvent event)
-
setIterativeReader
public void setIterativeReader()
- Specified by:
setIterativeReader
in interfaceReaderBase
-
startNextSuperstep
public void startNextSuperstep()
- Specified by:
startNextSuperstep
in interfaceReaderBase
-
hasReachedEndOfSuperstep
public boolean hasReachedEndOfSuperstep()
- Specified by:
hasReachedEndOfSuperstep
in interfaceReaderBase
-
-