Class StreamBackedIterator<X extends Writable>
java.lang.Object
org.apache.hadoop.mapreduce.lib.join.StreamBackedIterator<X>
- All Implemented Interfaces:
ResetableIterator<X>
- Direct Known Subclasses:
StreamBackedIterator
@Public
@Stable
public class StreamBackedIterator<X extends Writable>
extends Object
implements ResetableIterator<X>
This class provides an implementation of ResetableIterator. This
implementation uses a byte array to store elements added to it.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.mapreduce.lib.join.ResetableIterator
org.apache.hadoop.mapreduce.lib.join.ResetableIterator.EMPTY<U extends Writable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an element to the collection of elements to iterate over.voidclear()Close datasources, but do not release internal resources.voidclose()Close datasources and release resources.booleanhasNext()True if a call to next may return a value.booleanAssign next value to actual.booleanAssign last value returned to actual.voidreset()Set iterator to return to the start of its range.
-
Constructor Details
-
StreamBackedIterator
public StreamBackedIterator()
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from interface:ResetableIteratorTrue if a call to next may return a value. This is permitted false positives, but not false negatives.- Specified by:
hasNextin interfaceResetableIterator<X extends Writable>
-
next
Description copied from interface:ResetableIteratorAssign next value to actual. It is required that elements added to a ResetableIterator be returned in the same order after a call toResetableIterator.reset()(FIFO). Note that a call to this may fail for nested joins (i.e. more elements available, but none satisfying the constraints of the join)- Specified by:
nextin interfaceResetableIterator<X extends Writable>- Throws:
IOException
-
replay
Description copied from interface:ResetableIteratorAssign last value returned to actual.- Specified by:
replayin interfaceResetableIterator<X extends Writable>- Throws:
IOException
-
reset
public void reset()Description copied from interface:ResetableIteratorSet iterator to return to the start of its range. Must be called after callingResetableIterator.add(T)to avoid a ConcurrentModificationException.- Specified by:
resetin interfaceResetableIterator<X extends Writable>
-
add
Description copied from interface:ResetableIteratorAdd an element to the collection of elements to iterate over.- Specified by:
addin interfaceResetableIterator<X extends Writable>- Throws:
IOException
-
close
Description copied from interface:ResetableIteratorClose datasources and release resources. Calling methods on the iterator after calling close has undefined behavior.- Specified by:
closein interfaceResetableIterator<X extends Writable>- Throws:
IOException
-
clear
public void clear()Description copied from interface:ResetableIteratorClose datasources, but do not release internal resources. Calling this method should permit the object to be reused with a different datasource.- Specified by:
clearin interfaceResetableIterator<X extends Writable>
-