org.apache.hadoop.fs
Class BatchedRemoteIterator<K,E>

java.lang.Object
  extended by 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.


Nested Class Summary
static interface BatchedRemoteIterator.BatchedEntries<E>
           
static class BatchedRemoteIterator.BatchedListEntries<E>
           
 
Constructor Summary
BatchedRemoteIterator(K prevKey)
           
 
Method Summary
abstract  K elementToPrevKey(E element)
          Return the next list key associated with an element.
 boolean hasNext()
          Returns true if the iteration has more elements.
abstract  BatchedRemoteIterator.BatchedEntries<E> makeRequest(K prevKey)
          Perform the actual remote request.
 E next()
          Returns the next element in the iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchedRemoteIterator

public BatchedRemoteIterator(K prevKey)
Method Detail

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

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<E>
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.


next

public E next()
       throws IOException
Description copied from interface: RemoteIterator
Returns the next element in the iteration.

Specified by:
next in interface RemoteIterator<E>
Returns:
the next element in the iteration.
Throws:
IOException - if any IO error occurs


Copyright © 2014 Apache Software Foundation. All Rights Reserved.