Class BatchedIterable<T>

  • Type Parameters:
    T - the type of items in the iterable.
    All Implemented Interfaces:
    Closeable, AutoCloseable, Iterable<T>

    public abstract class BatchedIterable<T>
    extends Object
    implements Closeable, Iterable<T>
    A BatchedIterable is a Closeable Iterable of batches. To use, extend this class and implement the createBatch method. When you have no more batches of items left, return null.

    As a client iterators round this iterable it will first create a batch, then iterate around the batch. When there are no more items in the batch createBatch will be called again. This should only be used in a single thread and only 1 iterator can be used at a time.