Package org.apache.flink.util
Interface MutableObjectIterator<E>
-
- Type Parameters:
E
- The element type of the collection iterated over.
- All Known Subinterfaces:
ResettableMutableObjectIterator<E>
- All Known Implementing Classes:
BinaryMergeIterator
,BinaryRowChannelInputViewIterator
,BlockResettableMutableObjectIterator
,ChannelReaderInputViewIterator
,ChannelReaderKVInputViewIterator
,CompactingHashTable.EntryIterator
,CountingMutableObjectIterator
,EmptyMutableObjectIterator
,HashPartitionIterator
,InPlaceMutableHashTable.EntryIterator
,InputViewIterator
,LongHashPartitionChannelReaderInputViewIterator
,MergeIterator
,MutableHashTable.HashBucketIterator
,MutableHashTable.UnmatchedBuildIterator
,ReaderIterator
,RegularToMutableObjectIterator
,SpillingResettableMutableObjectIterator
@Internal public interface MutableObjectIterator<E>
A simple iterator interface. The key differences to theIterator
are- It has two distinct
next()
, where one variant allows to pass an object that may be reused, if the type is mutable. - It consolidates the logic in a single
next()
function, rather than splitting it over two different functions such ashasNext()
andnext()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description E
next()
Gets the next element from the collection.E
next(E reuse)
Gets the next element from the collection.
-
-
-
Method Detail
-
next
E next(E reuse) throws IOException
Gets the next element from the collection. The contents of that next element is put into the given reuse object, if the type is mutable.- Parameters:
reuse
- The target object into which to place next element if E is mutable.- Returns:
- The filled object or
null
if the iterator is exhausted. - Throws:
IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the serialization / deserialization logic
-
next
E next() throws IOException
Gets the next element from the collection. The iterator implementation must obtain a new instance.- Returns:
- The object or
null
if the iterator is exhausted. - Throws:
IOException
- Thrown, if a problem occurred in the underlying I/O layer or in the serialization / deserialization logic
-
-