Search in sources :

Example 1 with EventGenerator

use of org.apache.apex.malhar.lib.testbench.EventGenerator in project apex-malhar by apache.

the class EventGeneratorApp method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    EventGenerator eventGenerator = dag.addOperator("eventGenerator", new EventGenerator());
    dag.getMeta(eventGenerator).getMeta(eventGenerator.count).getAttributes().put(PortContext.QUEUE_CAPACITY, QUEUE_CAPACITY);
    DevNull<String> devString = dag.addOperator("devString", new DevNull());
    DevNull<HashMap<String, Double>> devMap = dag.addOperator("devMap", new DevNull());
    DevNull<HashMap<String, Number>> devInt = dag.addOperator("devInt", new DevNull());
    dag.addStream("EventGenString", eventGenerator.string_data, devString.data).setLocality(locality);
    dag.addStream("EventGenMap", eventGenerator.hash_data, devMap.data).setLocality(locality);
    dag.addStream("EventGenInt", eventGenerator.count, devInt.data).setLocality(locality);
}
Also used : EventGenerator(org.apache.apex.malhar.lib.testbench.EventGenerator) HashMap(java.util.HashMap) DevNull(org.apache.apex.malhar.lib.stream.DevNull)

Aggregations

HashMap (java.util.HashMap)1 DevNull (org.apache.apex.malhar.lib.stream.DevNull)1 EventGenerator (org.apache.apex.malhar.lib.testbench.EventGenerator)1