Search in sources :

Example 1 with WordGenSpout

use of org.apache.storm.perf.spout.WordGenSpout in project storm by apache.

the class SimplifiedWordCountTopo method getTopology.

static StormTopology getTopology(Map<String, Object> config) {
    final int spoutNum = Helper.getInt(config, SPOUT_NUM, DEFAULT_SPOUT_NUM);
    final int cntBoltNum = Helper.getInt(config, BOLT_NUM, DEFAULT_COUNT_BOLT_NUM);
    final String inputFile = Helper.getStr(config, INPUT_FILE);
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout(SPOUT_ID, new WordGenSpout(inputFile), spoutNum);
    builder.setBolt(COUNT_ID, new CountBolt(), cntBoltNum).fieldsGrouping(SPOUT_ID, new Fields(WordGenSpout.FIELDS));
    return builder.createTopology();
}
Also used : Fields(org.apache.storm.tuple.Fields) TopologyBuilder(org.apache.storm.topology.TopologyBuilder) WordGenSpout(org.apache.storm.perf.spout.WordGenSpout) CountBolt(org.apache.storm.perf.bolt.CountBolt)

Aggregations

CountBolt (org.apache.storm.perf.bolt.CountBolt)1 WordGenSpout (org.apache.storm.perf.spout.WordGenSpout)1 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)1 Fields (org.apache.storm.tuple.Fields)1