Class ReductorConfig<I,F,G,O>
- java.lang.Object
-
- org.pipecraft.pipes.sync.inter.reduct.ReductorConfig<I,F,G,O>
-
- Type Parameters:
I- The data type of the input itemsF- The data type of the family identifierG- The intermediate form items get aggregated to. Must be mutable.O- The data type of output items
public class ReductorConfig<I,F,G,O> extends Object
A configuration for a reduction operation. Reduction consists of identifying disjoint "families" of items in the input and aggregating each family separately into some summary output item. Uses builder design pattern.- Author:
- Eyal Schneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReductorConfig.Builder<I,F,G,O>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <I,F,G,O>
ReductorConfig.Builder<I,F,G,O>builder()FailableBiConsumer<G,I,PipeException>getAggregationLogic()Function<F,G>getAggregatorCreator()FailableFunction<I,F,PipeException>getDiscriminator()Function<G,O>getPostProcessor()
-
-
-
Method Detail
-
builder
public static <I,F,G,O> ReductorConfig.Builder<I,F,G,O> builder()
- Returns:
- A new builder to use for defining the reductor settings
-
getDiscriminator
public FailableFunction<I,F,PipeException> getDiscriminator()
- Returns:
- The function that identifies which "family" an item belongs to. Items of the same family are being aggregated into the same aggregator object.
-
getAggregatorCreator
public Function<F,G> getAggregatorCreator()
- Returns:
- The generator of a blank new aggregator object of type G. The creator is given the family id in case that it's needed for initialization purposes.
-
getAggregationLogic
public FailableBiConsumer<G,I,PipeException> getAggregationLogic()
- Returns:
- the logic that accepts the current aggregator state (of the type denoted by G) and aggregates a given item of type I into it
-
-