Search in sources :

Example 1 with GlobalCountBolt

use of org.apache.storm.eventhubs.samples.bolt.GlobalCountBolt in project storm by apache.

the class EventCount method buildTopology.

protected StormTopology buildTopology(EventHubSpout eventHubSpout) {
    TopologyBuilder topologyBuilder = new TopologyBuilder();
    topologyBuilder.setSpout("EventHubsSpout", eventHubSpout, spoutConfig.getPartitionCount()).setNumTasks(spoutConfig.getPartitionCount());
    topologyBuilder.setBolt("PartialCountBolt", new PartialCountBolt(), spoutConfig.getPartitionCount()).localOrShuffleGrouping("EventHubsSpout").setNumTasks(spoutConfig.getPartitionCount());
    topologyBuilder.setBolt("GlobalCountBolt", new GlobalCountBolt(), 1).globalGrouping("PartialCountBolt").setNumTasks(1);
    return topologyBuilder.createTopology();
}
Also used : PartialCountBolt(org.apache.storm.eventhubs.samples.bolt.PartialCountBolt) TopologyBuilder(org.apache.storm.topology.TopologyBuilder) GlobalCountBolt(org.apache.storm.eventhubs.samples.bolt.GlobalCountBolt)

Aggregations

GlobalCountBolt (org.apache.storm.eventhubs.samples.bolt.GlobalCountBolt)1 PartialCountBolt (org.apache.storm.eventhubs.samples.bolt.PartialCountBolt)1 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)1