Search in sources :

Example 1 with ResettableSingletonTraverser

use of com.hazelcast.jet.core.ResettableSingletonTraverser 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;
}
Also used : ResettableSingletonTraverser(com.hazelcast.jet.core.ResettableSingletonTraverser) KvRowProjector(com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector) Processor(com.hazelcast.jet.core.Processor) TransformP(com.hazelcast.jet.impl.processor.TransformP) ArrayList(java.util.ArrayList) JetSqlRow(com.hazelcast.sql.impl.row.JetSqlRow) Nonnull(javax.annotation.Nonnull)

Aggregations

Processor (com.hazelcast.jet.core.Processor)1 ResettableSingletonTraverser (com.hazelcast.jet.core.ResettableSingletonTraverser)1 TransformP (com.hazelcast.jet.impl.processor.TransformP)1 KvRowProjector (com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector)1 JetSqlRow (com.hazelcast.sql.impl.row.JetSqlRow)1 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1