Example #1
0
 public static LinearDRPCTopologyBuilder construct() {
   LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder(TOPOLOGY_NAME);
   builder.addBolt(new GetTweeters(), 1);
   builder.addBolt(new GetFollowers(), 1).shuffleGrouping();
   builder.addBolt(new PartialUniquer(), 1).fieldsGrouping(new Fields("id", "follower"));
   builder.addBolt(new CountAggregator(), 1).fieldsGrouping(new Fields("id"));
   return builder;
 }
  public static void SetDPRCTopology() throws AlreadyAliveException, InvalidTopologyException {
    LinearDRPCTopologyBuilder builder = new LinearDRPCTopologyBuilder("exclamation");

    builder.addBolt(new TotalCount(), 3);

    Config conf = new Config();

    conf.setNumWorkers(3);
    StormSubmitter.submitTopology("rpc", conf, builder.createRemoteTopology());
  }