Package com.atlassian.confluence.core
Interface BatchOperationManager
- All Known Implementing Classes:
SimpleHibernateBatchOperationManager5
public interface BatchOperationManager
Perform batch operations without any explicit dependency on a particular version of Hibernate or Spring.
-
Method Summary
Modifier and TypeMethodDescription<I,
O> Iterable<O> applyInBatches
(Iterable<I> input, int batchSize, int expectedTotal, Function<I, O> task) Executes a task for each item in a collection in batches with configurable batch size<I,
O> Iterable<O> applyInBatches
(Iterable<I> input, int expectedTotal, Function<I, O> task) Executes a task for each item in a collection in batches<I,
O> Iterable<O> applyInChunks
(Iterable<I> input, int chunkSize, int sizeToCollect, Function<List<I>, @NonNull 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 Details
-
applyInBatches
<I,O> Iterable<O> applyInBatches(Iterable<I> input, int batchSize, int expectedTotal, Function<I, O> task) Executes a task for each item in a collection in batches with configurable batch size- Type Parameters:
I
- input typeO
- output type- Parameters:
input
- the items to processbatchSize
- the size of the batchexpectedTotal
- the expected number of items to processtask
- a function to process the items- Returns:
- list of task outputs of specified type
- Since:
- 7.0.1
-
applyInBatches
Executes a task for each item in a collection in batches- Type Parameters:
I
- input typeO
- output type- Parameters:
input
- the items to processexpectedTotal
- the expected number of items to processtask
- a function to process the items- Returns:
- list of task outputs of specified type
- Since:
- 7.0.1
-
applyInChunks
<I,O> Iterable<O> applyInChunks(Iterable<I> input, int chunkSize, int sizeToCollect, Function<List<I>, @NonNull 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 processchunkSize
- the size of the batchsizeToCollect
- the number of processed items to returntask
- a function to process the items- Returns:
- A list of processed items
- Since:
- 7.0.1
-