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