use of org.apache.apex.malhar.lib.stream.StreamDuplicater in project apex-malhar by apache.
the class StreamDuplicaterApp method populateDAG.
@Override
public void populateDAG(DAG dag, Configuration conf) {
// RandomEventGenerator rand = dag.addOperator("rand", new RandomEventGenerator());
// rand.setMinvalue(0);
// rand.setMaxvalue(999999);
// rand.setTuplesBlastIntervalMillis(50);
// dag.getMeta(rand).getMeta(rand.integer_data).getAttributes().put(PortContext.QUEUE_CAPACITY, QUEUE_CAPACITY);
IntegerOperator intInput = dag.addOperator("intInput", new IntegerOperator());
StreamDuplicater stream = dag.addOperator("stream", new StreamDuplicater());
dag.getMeta(stream).getMeta(stream.data).getAttributes().put(PortContext.QUEUE_CAPACITY, QUEUE_CAPACITY);
dag.addStream("streamdup1", intInput.integer_data, stream.data).setLocality(locality);
DevNull<Integer> dev1 = dag.addOperator("dev1", new DevNull());
DevNull<Integer> dev2 = dag.addOperator("dev2", new DevNull());
dag.addStream("streamdup2", stream.out1, dev1.data).setLocality(locality);
dag.addStream("streamdup3", stream.out2, dev2.data).setLocality(locality);
}
Aggregations