Search in sources :

Example 46 with PlannerVertex

use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.

the class AggregateTransform method addToDagSingleStage.

// ---------       ---------
// | source0 | ... | sourceN |
// ---------       ---------
// |              |
// distributed    distributed
// all-to-one      all-to-one
// \              /
// ---\    /-----
// v  v
// ----------------
// |   aggregateP   | local parallelism = 1
// ----------------
private void addToDagSingleStage(Planner p) {
    PlannerVertex pv = p.addVertex(this, p.uniqueVertexName(name(), ""), 1, aggregateP(aggrOp));
    p.addEdges(this, pv.v, edge -> edge.distributed().allToOne());
}
Also used : PlannerVertex(com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex)

Example 47 with PlannerVertex

use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.

the class FlatMapUsingContextTransform method addToDag.

@Override
public void addToDag(Planner p) {
    PlannerVertex pv = p.addVertex(this, p.uniqueVertexName(name(), ""), localParallelism(), flatMapUsingContextP(contextFactory, flatMapFn));
    p.addEdges(this, pv.v);
}
Also used : PlannerVertex(com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex)

Example 48 with PlannerVertex

use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.

the class GroupTransform method addToDagTwoStage.

// ---------        ---------
// | source0 |  ... | sourceN |
// ---------        ---------
// |                |
// local            local
// partitioned      partitioned
// v                v
// --------------------
// |  accumulateByKeyP  |
// --------------------
// |
// distributed
// partitioned
// v
// ---------------
// | combineByKeyP |
// ---------------
private void addToDagTwoStage(Planner p) {
    List<DistributedFunction<?, ? extends K>> groupKeyFns = this.groupKeyFns;
    String namePrefix = p.uniqueVertexName(this.name(), "-step");
    Vertex v1 = p.dag.newVertex(namePrefix + '1', accumulateByKeyP(groupKeyFns, aggrOp)).localParallelism(localParallelism());
    PlannerVertex pv2 = p.addVertex(this, namePrefix + '2', localParallelism(), combineByKeyP(aggrOp, mapToOutputFn));
    p.addEdges(this, v1, (e, ord) -> e.partitioned(groupKeyFns.get(ord), HASH_CODE));
    p.dag.edge(between(v1, pv2.v).distributed().partitioned(entryKey()));
}
Also used : Vertex(com.hazelcast.jet.core.Vertex) PlannerVertex(com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex) PlannerVertex(com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex) DistributedFunction(com.hazelcast.jet.function.DistributedFunction)

Aggregations

PlannerVertex (com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex)48 Vertex (com.hazelcast.jet.core.Vertex)14 Edge (com.hazelcast.jet.core.Edge)9 JetEvent (com.hazelcast.jet.impl.JetEvent)6 JetEvent (com.hazelcast.jet.impl.pipeline.JetEvent)6 SlidingWindowPolicy (com.hazelcast.jet.core.SlidingWindowPolicy)4 FunctionEx (com.hazelcast.function.FunctionEx)3 BiFunctionEx (com.hazelcast.function.BiFunctionEx)2 Tag (com.hazelcast.jet.datamodel.Tag)2 DistributedFunction (com.hazelcast.jet.function.DistributedFunction)2 Planner.tailList (com.hazelcast.jet.impl.pipeline.Planner.tailList)2 HashJoinCollectP (com.hazelcast.jet.impl.processor.HashJoinCollectP)2 HashJoinP (com.hazelcast.jet.impl.processor.HashJoinP)2 ConstantFunctionEx (com.hazelcast.jet.impl.util.ConstantFunctionEx)2 List (java.util.List)2 ProcessorMetaSupplier (com.hazelcast.jet.core.ProcessorMetaSupplier)1 ItemsByTag (com.hazelcast.jet.datamodel.ItemsByTag)1 DistributedBiFunction (com.hazelcast.jet.function.DistributedBiFunction)1 DistributedTriFunction (com.hazelcast.jet.function.DistributedTriFunction)1 TriFunction (com.hazelcast.jet.function.TriFunction)1