Package org.apache.nemo.common.ir
Class BoundedIteratorReadable<O>
- java.lang.Object
-
- org.apache.nemo.common.ir.BoundedIteratorReadable<O>
-
- Type Parameters:
O
- output type.
- All Implemented Interfaces:
java.io.Serializable
,Readable<O>
public abstract class BoundedIteratorReadable<O> extends java.lang.Object implements Readable<O>
An abstract readable class that retrieves data from iterator.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BoundedIteratorReadable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.util.Iterator<O>
initializeIterator()
Initialize iterator.boolean
isFinished()
void
prepare()
Prepare reading data.O
readCurrent()
Method to read current data from the source.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.nemo.common.ir.Readable
close, getLocations, readWatermark
-
-
-
-
Method Detail
-
initializeIterator
protected abstract java.util.Iterator<O> initializeIterator()
Initialize iterator.- Returns:
- iterator
-
prepare
public final void prepare()
Prepare reading data.
-
readCurrent
public final O readCurrent()
Description copied from interface:Readable
Method to read current data from the source. The caller should check whether the Readable is finished or not by using isFinished() method before calling this method.- Specified by:
readCurrent
in interfaceReadable<O>
- Returns:
- a data read by the readable.
-
isFinished
public final boolean isFinished()
- Specified by:
isFinished
in interfaceReadable<O>
- Returns:
- true if it reads all data.
-
-