use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.
the class PeekTransform method addToDag.
@Override
public void addToDag(Planner p) {
PlannerVertex peekedPv = p.xform2vertex.get(this.upstream().get(0));
// Peeking transform doesn't add a vertex, so point to the upstream
// transform's vertex:
p.xform2vertex.put(this, peekedPv);
peekedPv.v.updateMetaSupplier(sup -> peekOutputP(toStringFn, shouldLogFn, sup));
}
use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.
the class SinkTransform method addToDag.
@Override
public void addToDag(Planner p) {
PlannerVertex pv = p.addVertex(this, p.uniqueVertexName(name(), ""), localParallelism(), adaptingMetaSupplier(metaSupplier, ordinalsToAdapt));
p.addEdges(this, pv.v);
}
use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.
the class WindowAggregateTransform method addSlidingWindowSingleStage.
// --------- ---------
// | source0 | ... | sourceN |
// --------- ---------
// | |
// distributed distributed
// all-to-one all-to-one
// \ /
// ---\ /-----
// v v
// ---------------------------
// | aggregateToSlidingWindowP | local parallelism = 1
// ---------------------------
private void addSlidingWindowSingleStage(Planner p, SlidingWindowDef wDef) {
PlannerVertex pv = p.addVertex(this, p.uniqueVertexName(name(), ""), 1, aggregateToSlidingWindowP(nCopies(aggrOp.arity(), constantKey()), nCopies(aggrOp.arity(), (DistributedToLongFunction<JetEvent>) JetEvent::timestamp), TimestampKind.EVENT, wDef.toSlidingWindowPolicy(), aggrOp, mapToOutputFn.toKeyedWindowResultFn()));
p.addEdges(this, pv.v, edge -> edge.distributed().allToOne());
}
use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.
the class WindowAggregateTransform method addSlidingWindowTwoStage.
// -------- ---------
// | source0 | ... | sourceN |
// -------- ---------
// | |
// local local
// unicast unicast
// v v
// --------------------
// | accumulateByFrameP | keyFn = constantKey()
// --------------------
// |
// distributed
// all-to-one
// v
// -------------------------
// | combineToSlidingWindowP | local parallelism = 1
// -------------------------
private void addSlidingWindowTwoStage(Planner p, SlidingWindowDef wDef) {
String namePrefix = p.uniqueVertexName(name(), "-step");
SlidingWindowPolicy winPolicy = wDef.toSlidingWindowPolicy();
Vertex v1 = p.dag.newVertex(namePrefix + '1', accumulateByFrameP(nCopies(aggrOp.arity(), constantKey()), nCopies(aggrOp.arity(), (DistributedToLongFunction<JetEvent>) JetEvent::timestamp), TimestampKind.EVENT, winPolicy, aggrOp));
v1.localParallelism(localParallelism());
PlannerVertex pv2 = p.addVertex(this, namePrefix + '2', 1, combineToSlidingWindowP(winPolicy, aggrOp, mapToOutputFn.toKeyedWindowResultFn()));
p.addEdges(this, v1);
p.dag.edge(between(v1, pv2.v).distributed().allToOne());
}
use of com.hazelcast.jet.impl.pipeline.Planner.PlannerVertex in project hazelcast-jet by hazelcast.
the class AggregateTransform method addToDagTwoStage.
// --------- ---------
// | source0 | ... | sourceN |
// --------- ---------
// | |
// local local
// unicast unicast
// v v
// -------------------
// | accumulateP |
// -------------------
// |
// distributed
// all-to-one
// v
// ----------------
// | combineP | local parallelism = 1
// ----------------
private void addToDagTwoStage(Planner p) {
String namePrefix = p.uniqueVertexName(name(), "-step");
Vertex v1 = p.dag.newVertex(namePrefix + '1', accumulateP(aggrOp)).localParallelism(localParallelism());
PlannerVertex pv2 = p.addVertex(this, namePrefix + '2', 1, combineP(aggrOp));
p.addEdges(this, v1);
p.dag.edge(between(v1, pv2.v).distributed().allToOne());
}
Aggregations