use of org.apache.storm.perf.bolt.IdBolt in project storm by apache.
the class ConstSpoutIdBoltNullBoltTopo method getTopology.
public static StormTopology getTopology(Map conf) {
// 1 - Setup Spout --------
ConstSpout spout = new ConstSpout("some data").withOutputFields("str");
// 2 - Setup IdBolt & DevNullBolt --------
IdBolt bolt1 = new IdBolt();
DevNullBolt bolt2 = new DevNullBolt();
// 3 - Setup Topology --------
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(SPOUT_ID, spout, Helper.getInt(conf, SPOUT_COUNT, 1));
builder.setBolt(BOLT1_ID, bolt1, Helper.getInt(conf, BOLT1_COUNT, 1)).localOrShuffleGrouping(SPOUT_ID);
builder.setBolt(BOLT2_ID, bolt2, Helper.getInt(conf, BOLT2_COUNT, 1)).localOrShuffleGrouping(BOLT1_ID);
return builder.createTopology();
}
Aggregations