Class BatchedRemoteIterator<K,E>

java.lang.Object
org.apache.hadoop.fs.BatchedRemoteIterator<K,E>
All Implemented Interfaces:
RemoteIterator<E>

public abstract class BatchedRemoteIterator<K,E> extends Object implements RemoteIterator<E>
A RemoteIterator that fetches elements in batches.
  • Constructor Details

    • BatchedRemoteIterator

      public BatchedRemoteIterator(K prevKey)
  • Method Details

    • makeRequest

      public abstract BatchedRemoteIterator.BatchedEntries<E> makeRequest(K prevKey) throws IOException
      Perform the actual remote request.
      Parameters:
      prevKey - The key to send.
      Returns:
      A list of replies.
      Throws:
      IOException - If an I/O error occurred.
    • hasNext

      public boolean hasNext() throws IOException
      Description copied from interface: RemoteIterator
      Returns true if the iteration has more elements.
      Specified by:
      hasNext in interface RemoteIterator<K>
      Returns:
      true if the iterator has more elements.
      Throws:
      IOException - if any IO error occurs
    • elementToPrevKey

      public abstract K elementToPrevKey(E element)
      Return the next list key associated with an element.
      Parameters:
      element - element.
      Returns:
      K Generics Type.
    • next

      public E next() throws IOException
      Description copied from interface: RemoteIterator
      Returns the next element in the iteration.
      Specified by:
      next in interface RemoteIterator<K>
      Returns:
      the next element in the iteration.
      Throws:
      IOException - if any IO error occurs