Search Java Code Snippets


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





Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of org.apache.storm.trident.windowing.WindowsStoreFactory

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

Config conf = new Config();

WindowsStoreFactory mapState = new InMemoryWindowsStoreFactory();



if (args.length == 0) {

List<? extends WindowConfig> list = Arrays.asList(

SlidingCountWindow.of(1000, 100)

,TumblingCountWindow.of(1000)

,SlidingDurationWindow.of(new BaseWindowedBolt.Duration(6, TimeUnit.SECONDS), new BaseWindowedBolt.Duration(3, TimeUnit.SECONDS))

,TumblingDurationWindow.of(new BaseWindowedBolt.Duration(3, TimeUnit.SECONDS))

);



for (WindowConfig windowConfig : list) {

LocalCluster cluster = new LocalCluster();

cluster.submitTopology("wordCounter", conf, buildTopology(mapState, windowConfig));

Utils.sleep(60 * 1000);

cluster.shutdown();

}

System.exit(0);

} else {

conf.setNumWorkers(3);

StormSubmitter.submitTopologyWithProgressBar(args[0], conf, buildTopology(mapState, SlidingCountWindow.of(1000, 100)));

}

}


   Like      Feedback      org.apache.storm.trident.windowing.WindowsStoreFactory



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