Interface KeyValueIterator<K,V>
-
public interface KeyValueIterator<K,V>
An internal iterator interface which presents a more restrictive API thanIterator
. This iterator can avoid using Tuple2 to wrap key and value.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
advanceNext()
Advance this iterator by a single kv.K
getKey()
Retrieve the key from this iterator.V
getValue()
Retrieve the value from this iterator.
-
-
-
Method Detail
-
advanceNext
boolean advanceNext() throws IOException
Advance this iterator by a single kv. Returnsfalse
if this iterator has no more kvs andtrue
otherwise. If this returnstrue
, then the new kv can be retrieved by callinggetKey()
andgetValue()
.- Throws:
IOException
-
getKey
K getKey()
Retrieve the key from this iterator. This method is idempotent. It is illegal to call this method afteradvanceNext()
has returnedfalse
.
-
getValue
V getValue()
Retrieve the value from this iterator. This method is idempotent. It is illegal to call this method afteradvanceNext()
has returnedfalse
.
-
-