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);
}
Aggregations