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> java.lang.Iterable<O>
performAsBatch(java.lang.Iterable<I> input, int expectedTotal, com.google.common.base.Function<I,O> task)
           
<I,O> java.lang.Iterable<O>
performInChunks(java.lang.Iterable<I> input, int chunkSize, int sizeToCollect, com.google.common.base.Function<java.util.List<I>,java.util.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> java.lang.Iterable<O> performAsBatch(java.lang.Iterable<I> input,
                                           int expectedTotal,
                                           com.google.common.base.Function<I,O> task)

performInChunks

<I,O> java.lang.Iterable<O> performInChunks(java.lang.Iterable<I> input,
                                            int chunkSize,
                                            int sizeToCollect,
                                            com.google.common.base.Function<java.util.List<I>,java.util.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-2014 Atlassian. All Rights Reserved.