use of com.hazelcast.jet.impl.processor.AsyncTransformUsingServiceOrderedP in project hazelcast by hazelcast.
the class JoinByPrimitiveKeyProcessorSupplier method get.
@Nonnull
@Override
public Collection<? extends Processor> get(int count) {
List<Processor> processors = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
String mapName = this.mapName;
KvRowProjector projector = rightRowProjectorSupplier.get(evalContext, extractors);
Processor processor = new AsyncTransformUsingServiceOrderedP<>(ServiceFactories.nonSharedService(SecuredFunctions.iMapFn(mapName)), null, MAX_CONCURRENT_OPS, (IMap<Object, Object> map, JetSqlRow left) -> {
Object key = left.get(leftEquiJoinIndex);
if (key == null) {
return inner ? null : completedFuture(null);
}
return map.getAsync(key).toCompletableFuture();
}, (left, value) -> {
JetSqlRow joined = join(left, left.get(leftEquiJoinIndex), value, projector, condition, evalContext);
return joined != null ? singleton(joined) : inner ? null : singleton(left.extendedRow(projector.getColumnCount()));
});
processors.add(processor);
}
return processors;
}
Aggregations