Search in sources :

Example 1 with CountAggregatorBolt

use of org.apache.heron.integration_test.common.bolt.CountAggregatorBolt in project heron by twitter.

the class FieldsGrouping method buildTopology.

@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
    builder.setSpout("ab-spout", new ABSpout(), 1, 400);
    builder.setBolt("count-bolt", new WordCountBolt(), 2).fieldsGrouping("ab-spout", new Fields("word"));
    builder.setBolt("sum-bolt", new CountAggregatorBolt(), 1).noneGrouping("count-bolt");
    return builder;
}
Also used : Fields(org.apache.heron.api.tuple.Fields) CountAggregatorBolt(org.apache.heron.integration_test.common.bolt.CountAggregatorBolt) ABSpout(org.apache.heron.integration_test.common.spout.ABSpout) WordCountBolt(org.apache.heron.integration_test.common.bolt.WordCountBolt)

Example 2 with CountAggregatorBolt

use of org.apache.heron.integration_test.common.bolt.CountAggregatorBolt in project heron by twitter.

the class FieldsGrouping method buildTopology.

@Override
protected TopologyBuilder buildTopology(TopologyBuilder builder) {
    builder.setSpout("ab-spout", new ABSpout(), 1);
    builder.setBolt("count-bolt", new WordCountBolt(), 2).fieldsGrouping("ab-spout", new Fields("word"));
    builder.setBolt("sum-bolt", new CountAggregatorBolt(), 1).noneGrouping("count-bolt");
    return builder;
}
Also used : Fields(org.apache.heron.api.tuple.Fields) CountAggregatorBolt(org.apache.heron.integration_test.common.bolt.CountAggregatorBolt) ABSpout(org.apache.heron.integration_test.common.spout.ABSpout) WordCountBolt(org.apache.heron.integration_test.common.bolt.WordCountBolt)

Aggregations

Fields (org.apache.heron.api.tuple.Fields)2 CountAggregatorBolt (org.apache.heron.integration_test.common.bolt.CountAggregatorBolt)2 WordCountBolt (org.apache.heron.integration_test.common.bolt.WordCountBolt)2 ABSpout (org.apache.heron.integration_test.common.spout.ABSpout)2