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.tuple.Fields

    public static StormTopology buildDevicesTopology() {

String deviceID = "device-id";

String count = "count";

Fields allFields = new Fields(deviceID, count);



RandomNumberGeneratorSpout spout = new RandomNumberGeneratorSpout(allFields, 10, 1000);



TridentTopology topology = new TridentTopology();

Stream devicesStream = topology.newStream("devicegen-spout", spout).

each(allFields, new Debug("##### devices"));



devicesStream.minBy(deviceID).

each(allFields, new Debug("#### device with min id"));



devicesStream.maxBy(count).

each(allFields, new Debug("#### device with max count"));



return topology.build();

}


   Like      Feedback      org.apache.storm.tuple.Fields



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