I'm developing a Hazelcast Jet batch job using the core API (not the pipeline API). One of the intermediate vertices of my DAG must do a map operation, but would benefit from mapping a batch of items at a time, rather than one by one. My mapping operation - in fact - must enrich the input items by executing a database query, and rather than executing one query for each input item I would prefer to accumulate inputs and execute a batch query.
My solution so far has been to implement a custom BatchMapP processor which accumulates items and periodically (either when a batch size is reached or when a given grouping predicate says so), performs a map function on the group of items, and emits the transformed items using a traverser.
From the API perspective, my processor is created in this way:
public static <I, O> SupplierEx<Processor> batchMapP(int batchSize, FunctionEx<List<I>, List<O>> mapFunction);
public static <I, O> SupplierEx<Processor> batchMapP(BiPredicateEx<List<I>, I> groupPredicate, FunctionEx<List<I>, List<O>> mapFunction)
Isn't there a built-in processor that already does that for me?