Search in sources :

Example 1 with EventIncrementer

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

the class EventIncrementerApp method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    EventIncrementer eventInc = dag.addOperator("eventInc", new EventIncrementer());
    ArrayList<String> keys = new ArrayList<String>(2);
    ArrayList<Double> low = new ArrayList<Double>(2);
    ArrayList<Double> high = new ArrayList<Double>(2);
    keys.add("x");
    keys.add("y");
    low.add(1.0);
    low.add(1.0);
    high.add(100.0);
    high.add(100.0);
    eventInc.setKeylimits(keys, low, high);
    eventInc.setDelta(1);
    HashMapOperator hmapOper = dag.addOperator("hmapOper", new HashMapOperator());
    dag.addStream("eventIncInput1", hmapOper.hmapList_data, eventInc.seed);
    dag.addStream("eventIncInput2", hmapOper.hmapMap_data, eventInc.increment);
    DevNull<HashMap<String, Integer>> dev1 = dag.addOperator("dev1", new DevNull());
    DevNull<HashMap<String, String>> dev2 = dag.addOperator("dev2", new DevNull());
    dag.addStream("eventIncOutput1", eventInc.count, dev1.data).setLocality(locality);
    dag.addStream("eventIncOutput2", eventInc.data, dev2.data).setLocality(locality);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) EventIncrementer(org.apache.apex.malhar.lib.testbench.EventIncrementer) DevNull(org.apache.apex.malhar.lib.stream.DevNull)

Aggregations

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