Search in sources :

Example 1 with SkipP

use of com.hazelcast.jet.stream.impl.processor.SkipP in project hazelcast-jet by hazelcast.

the class SkipPipe method buildDAG.

@Override
public Vertex buildDAG(DAG dag) {
    Vertex previous = upstream.buildDAG(dag);
    // required final for lambda variable capture
    final long skip = this.skip;
    Vertex skipVertex = dag.newVertex(uniqueVertexName("skip"), () -> new SkipP(skip)).localParallelism(1);
    Edge edge = between(previous, skipVertex);
    // if upstream is not ordered, we need to shuffle data to one node
    if (!upstream.isOrdered()) {
        edge = edge.distributed().allToOne();
    }
    dag.edge(edge);
    return skipVertex;
}
Also used : Vertex(com.hazelcast.jet.core.Vertex) SkipP(com.hazelcast.jet.stream.impl.processor.SkipP) Edge(com.hazelcast.jet.core.Edge)

Aggregations

Edge (com.hazelcast.jet.core.Edge)1 Vertex (com.hazelcast.jet.core.Vertex)1 SkipP (com.hazelcast.jet.stream.impl.processor.SkipP)1