Interface KeyValueIterator<K,V>


public interface KeyValueIterator<K,V>
An internal iterator interface which presents a more restrictive API than Iterator. This iterator can avoid using Tuple2 to wrap key and value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Advance this iterator by a single kv.
    Retrieve the key from this iterator.
    Retrieve the value from this iterator.
  • Method Details

    • advanceNext

      boolean advanceNext() throws IOException
      Advance this iterator by a single kv. Returns false if this iterator has no more kvs and true otherwise. If this returns true, then the new kv can be retrieved by calling getKey() and getValue().
      Throws:
      IOException
    • getKey

      K getKey()
      Retrieve the key from this iterator. This method is idempotent. It is illegal to call this method after advanceNext() has returned false.
    • getValue

      V getValue()
      Retrieve the value from this iterator. This method is idempotent. It is illegal to call this method after advanceNext() has returned false.