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.
A generic class for batch processing of input objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.LoggerShared logger for batch processing implementations. -
Constructor Summary
ConstructorsConstructorDescriptionBatchProcessor(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. -
Method Summary
Modifier and TypeMethodDescriptionApplies the transformation function to all input objects and returns the results.Applies the transformation function to all input objects in parallel while controlling the level of parallelization, and returns the results.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGShared 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 processingoutputIfTimeout- Default output in case of timeout
-
-
Method Details
-
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
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.
-