com.atlassian.confluence.core
Interface BatchOperationManager

All Known Implementing Classes:
SimpleHibernateBatchOperationManager

public interface BatchOperationManager

Perform batch operations without any explicit dependency on a particular version of Hibernate or Spring.


Method Summary
<I,O> Iterable<O>
performAsBatch(Iterable<I> input, int expectedTotal, com.google.common.base.Function<I,O> task)
           
<I,O> Iterable<O>
performInChunks(Iterable<I> input, int chunkSize, int sizeToCollect, com.google.common.base.Function<List<I>,List<O>> task)
          Processes a collection of items in chunks until a given number of processed items is reached, the processed items are then returned.
 

Method Detail

performAsBatch

<I,O> Iterable<O> performAsBatch(Iterable<I> input,
                                 int expectedTotal,
                                 com.google.common.base.Function<I,O> task)

performInChunks

<I,O> Iterable<O> performInChunks(Iterable<I> input,
                                  int chunkSize,
                                  int sizeToCollect,
                                  com.google.common.base.Function<List<I>,List<O>> task)
Processes a collection of items in chunks until a given number of processed items is reached, the processed items are then returned. .

Parameters:
input - the items to process
chunkSize - the size of the batch
sizeToCollect - the number of processed items to return
task - a function to process the items
Returns:
A list of processed items


Copyright © 2003–2015 Atlassian. All rights reserved.