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 Detail

      • performAsBatch

        @Deprecated
        <I,​O> Iterable<O> performAsBatch​(Iterable<I> input,
                                               int batchSize,
                                               int expectedTotal,
                                               com.google.common.base.Function<I,​O> task)
        Deprecated.
        Executes a task for each item in a collection in batches with configurable batch size
        Type Parameters:
        I - input type
        O - output type
        Parameters:
        input - the items to process
        batchSize - the size of the batch
        expectedTotal - the expected number of items to process
        task - a function to process the items
        Returns:
        list of task outputs of specified type
        Since:
        6.14.0
      • applyInBatches

        default <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 type
        O - output type
        Parameters:
        input - the items to process
        batchSize - the size of the batch
        expectedTotal - the expected number of items to process
        task - a function to process the items
        Returns:
        list of task outputs of specified type
        Since:
        7.0.1
      • performAsBatch

        @Deprecated
        <I,​O> Iterable<O> performAsBatch​(Iterable<I> input,
                                               int expectedTotal,
                                               com.google.common.base.Function<I,​O> task)
        Deprecated.
        Executes a task for each item in a collection in batches
        Type Parameters:
        I - input type
        O - output type
        Parameters:
        input - the items to process
        expectedTotal - the expected number of items to process
        task - a function to process the items
        Returns:
        list of task outputs of specified type
      • applyInBatches

        default <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
        Type Parameters:
        I - input type
        O - output type
        Parameters:
        input - the items to process
        expectedTotal - the expected number of items to process
        task - a function to process the items
        Returns:
        list of task outputs of specified type
        Since:
        7.0.1
      • performInChunks

        @Deprecated
        <I,​O> Iterable<O> performInChunks​(Iterable<I> input,
                                                int chunkSize,
                                                int sizeToCollect,
                                                com.google.common.base.Function<List<I>,​@NonNull List<O>> task)
        Deprecated.
        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
      • applyInChunks

        default <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 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
        Since:
        7.0.1