use of com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector in project hazelcast by hazelcast.
the class JoinByEquiJoinProcessorSupplier method get.
@Nonnull
@Override
public Collection<? extends Processor> get(int count) {
List<Processor> processors = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
PartitionIdSet partitions = this.partitions == null ? null : new PartitionIdSet(partitionCount, this.partitions);
QueryPath[] rightPaths = rightRowProjectorSupplier.paths();
KvRowProjector rightProjector = rightRowProjectorSupplier.get(evalContext, extractors);
Processor processor = new TransformP<JetSqlRow, JetSqlRow>(joinFn(joinInfo, map, partitions, rightPaths, rightProjector, evalContext)) {
@Override
public boolean isCooperative() {
return false;
}
};
processors.add(processor);
}
return processors;
}
use of com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector in project hazelcast by hazelcast.
the class RowProjectorProcessorSupplier method get.
@Nonnull
@Override
public Collection<? extends Processor> get(int count) {
List<Processor> processors = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
KvRowProjector projector = projectorSupplier.get(evalContext, extractors);
Processor processor = new StreamKafkaP<>(properties, singletonList(topic), record -> projector.project(record.key(), record.value()), eventTimePolicy);
processors.add(processor);
}
return processors;
}
use of com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector 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;
}
use of com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector in project hazelcast by hazelcast.
the class RowProjectorProcessorSupplier method get.
@Nonnull
@Override
public Collection<? extends Processor> get(int count) {
List<Processor> processors = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
ResettableSingletonTraverser<JetSqlRow> traverser = new ResettableSingletonTraverser<>();
KvRowProjector projector = projectorSupplier.get(evalContext, extractors);
Processor processor = new TransformP<LazyMapEntry<Object, Object>, JetSqlRow>(entry -> {
traverser.accept(projector.project(entry.getKeyData(), entry.getValueData()));
return traverser;
});
processors.add(processor);
}
return processors;
}
Aggregations