Search Java Code Snippets

  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.

#Java - Code Snippets for '#Org.apache.storm.transactional.TransactionalTopologyBuilder' - 1 code snippet(s) found

 Sample 1. Code Sample / Example / Snippet of org.apache.storm.transactional.TransactionalTopologyBuilder

  public static void main(String[] args) throws Exception {

MemoryTransactionalSpout spout = new MemoryTransactionalSpout(DATA, new Fields("word"), PARTITION_TAKE_PER_BATCH);

TransactionalTopologyBuilder builder = new TransactionalTopologyBuilder("global-count", "spout", spout, 3);

builder.setBolt("partial-count", new BatchCount(), 5).noneGrouping("spout");

builder.setBolt("sum", new UpdateGlobalCount()).globalGrouping("partial-count");

LocalCluster cluster = new LocalCluster();

Config config = new Config();



cluster.submitTopology("global-count-topology", config, builder.buildTopology());




   Like      Feedback      org.apache.storm.transactional.TransactionalTopologyBuilder

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner