Class DataUtil.InputStreamIterator<T>
- java.lang.Object
-
- org.apache.nemo.runtime.executor.data.DataUtil.InputStreamIterator<T>
-
- Type Parameters:
T
- The type of elements.
- All Implemented Interfaces:
java.util.Iterator<T>
,DataUtil.IteratorWithNumBytes<T>
- Enclosing class:
- DataUtil
@NotThreadSafe public static final class DataUtil.InputStreamIterator<T> extends java.lang.Object implements DataUtil.IteratorWithNumBytes<T>
An iterator that emits objects fromInputStream
using the correspondingDecoderFactory
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.nemo.runtime.executor.data.DataUtil.IteratorWithNumBytes
DataUtil.IteratorWithNumBytes.NumBytesNotSupportedException
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCurrNumEncodedBytes()
This method can be called before the every actual data completely taken from iterator, When the every actual data completely taken from iterator, its return value must be same with a return value of getNumSerializedBytes().long
getCurrNumSerializedBytes()
This method can be called before the every actual data completely taken from iterator, When the every actual data completely taken from iterator, its return value must be same with a return value of getNumSerializedBytes().long
getNumEncodedBytes()
This method should be called after the actual data is taken out of iterator, since the existence of an iterator does not guarantee that data inside it is ready.long
getNumSerializedBytes()
This method should be called after the actual data is taken out of iterator, since the existence of an iterator does not guarantee that data inside it is ready.boolean
hasNext()
boolean
isReadNotSerializedData()
T
next()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
getNumSerializedBytes
public long getNumSerializedBytes()
Description copied from interface:DataUtil.IteratorWithNumBytes
This method should be called after the actual data is taken out of iterator, since the existence of an iterator does not guarantee that data inside it is ready.- Specified by:
getNumSerializedBytes
in interfaceDataUtil.IteratorWithNumBytes<T>
- Returns:
- the number of bytes in serialized form (which is, for example, encoded and compressed)
-
getNumEncodedBytes
public long getNumEncodedBytes()
Description copied from interface:DataUtil.IteratorWithNumBytes
This method should be called after the actual data is taken out of iterator, since the existence of an iterator does not guarantee that data inside it is ready.- Specified by:
getNumEncodedBytes
in interfaceDataUtil.IteratorWithNumBytes<T>
- Returns:
- the number of bytes in encoded form (which is ready to be decoded)
-
getCurrNumSerializedBytes
public long getCurrNumSerializedBytes()
Description copied from interface:DataUtil.IteratorWithNumBytes
This method can be called before the every actual data completely taken from iterator, When the every actual data completely taken from iterator, its return value must be same with a return value of getNumSerializedBytes().- Specified by:
getCurrNumSerializedBytes
in interfaceDataUtil.IteratorWithNumBytes<T>
- Returns:
- the number of currently read bytes in serialized form (which is, for example, encoded and compressed)
-
getCurrNumEncodedBytes
public long getCurrNumEncodedBytes()
Description copied from interface:DataUtil.IteratorWithNumBytes
This method can be called before the every actual data completely taken from iterator, When the every actual data completely taken from iterator, its return value must be same with a return value of getNumSerializedBytes().- Specified by:
getCurrNumEncodedBytes
in interfaceDataUtil.IteratorWithNumBytes<T>
- Returns:
- the number of bytes in encoded form (which is ready to be decoded)
-
isReadNotSerializedData
public boolean isReadNotSerializedData()
- Specified by:
isReadNotSerializedData
in interfaceDataUtil.IteratorWithNumBytes<T>
-
-