Class RemoteIterators.WrappingRemoteIterator<S,T>
java.lang.Object
org.apache.hadoop.util.functional.RemoteIterators.WrappingRemoteIterator<S,T>
- Type Parameters:
S- source typeT- type of returned value
- All Implemented Interfaces:
Closeable,AutoCloseable,RemoteIterator<T>,IOStatisticsSource
- Enclosing class:
- RemoteIterators
public abstract static class RemoteIterators.WrappingRemoteIterator<S,T>
extends Object
implements RemoteIterator<T>, IOStatisticsSource, Closeable
Wrapper of another remote iterator; IOStatistics
and Closeable methods are passed down if implemented.
This class may be subclassed within the hadoop codebase
if custom iterators are needed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Return a statistics instance.protected RemoteIterator<S>protected booleanCheck for the source having a next element.protected SGet the next source value.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.fs.RemoteIterator
hasNext, next
-
Constructor Details
-
WrappingRemoteIterator
-
-
Method Details
-
getSource
-
getIOStatistics
Description copied from interface:IOStatisticsSourceReturn a statistics instance.It is not a requirement that the same instance is returned every time.
IOStatisticsSource.If the object implementing this is Closeable, this method may return null if invoked on a closed object, even if it returns a valid instance when called earlier.
- Specified by:
getIOStatisticsin interfaceIOStatisticsSource- Returns:
- an IOStatistics instance or null
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
sourceHasNext
Check for the source having a next element. If it does not, this object's close() method is called and false returned- Returns:
- true if there is a new value
- Throws:
IOException- failure to retrieve next value
-
sourceNext
Get the next source value. This callssourceHasNext()first to verify that there is data.- Returns:
- the next value
- Throws:
IOException- failureNoSuchElementException- no more data
-
toString
-