Class BatchProcessor<I, OutputType>

java.lang.Object
fr.inria.rules.integraal.component_builder.evaluators.generic.processors.BatchProcessor<I, OutputType>
Type Parameters:
I - The input type.
OutputType - The output type.

public class BatchProcessor<I, OutputType> extends Object
A generic class for batch processing of input objects.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
      Shared logger for batch processing implementations.
  • Constructor Details

    • BatchProcessor

      public BatchProcessor(Collection<I> inputs, Function<I, OutputType> transformationFunction, ExternalAlgorithmHaltingConditions externalHaltingConditions, BiFunction<I, String, OutputType> outputIfTimeout)
      Constructs a BatchProcessor with the given inputs and a transformation function.
      Parameters:
      inputs - The collection of input objects.
      transformationFunction - The function to apply to each input object.
      externalHaltingConditions - halting constraints applied during batch processing
      outputIfTimeout - Default output in case of timeout
  • Method Details

    • processBatch

      public List<OutputType> processBatch()
      Applies the transformation function to all input objects and returns the results.
      Returns:
      A list of output objects resulting from the transformation of each input object.
    • processBatchParallel

      public List<OutputType> processBatchParallel()
      Applies the transformation function to all input objects in parallel while controlling the level of parallelization, and returns the results.
      Returns:
      A list of output objects resulting from the transformation of each input object.