Class LazyBatchStreamIterator<T>

java.lang.Object
cz.drg.pregrouper.readers.LazyBatchStreamIterator<T>
Type Parameters:
T - the type of object to create batches of
All Implemented Interfaces:
Iterator<List<T>>

public class LazyBatchStreamIterator<T> extends Object implements Iterator<List<T>>
Custom iterator implementation that provides batches of data from provided regular iterator. Mainly used to grab a larger number of lines from a database and write them all to a temp csv file at once. Saves time accessing the file and writing there compared to writing each line separately.
  • Constructor Details

    • LazyBatchStreamIterator

      public LazyBatchStreamIterator(Iterator<T> sourceIterator, int batchSize)
  • Method Details