java.lang.Object
org.apache.jena.sparql.service.enhancer.impl.Batcher<G,I>
Type Parameters:
G - group key type (e.g. type of service IRIs)
I - item type (e.g. Binding)

public class Batcher<G,I> extends Object
The batcher transform an iterator of input items into an iterator of batches. Thereby, items are assigned incremental ids. Every returned batch will start with the lowest item index not covered by any prior batch. Parameters are:
  • maxBulkSize: The maximum size of the batches which to form
  • maxOutOfBandItemCount: The maximum number of out-of-band-items when forming the next batch. Once this threshold is reached then a batch is returned even if it wasn't full yet.
A batch is guaranteed to have at least one item.
  • Constructor Details

    • Batcher

      public Batcher(Function<I,G> itemToGroupKey, int maxBulkSize, int maxOutOfBandItemCount)
  • Method Details

    • batch

      public org.apache.jena.atlas.iterator.IteratorCloseable<GroupedBatch<G,Long,I>> batch(org.apache.jena.atlas.iterator.IteratorCloseable<I> inputIterator)