Search in sources :

Example 1 with IdentityBolt

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

the class AllGrouping method buildTopology.

@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
    builder.setSpout("ab-spout", new ABSpout(), 1);
    builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 2).allGrouping("ab-spout");
    return builder;
}
Also used : IdentityBolt(org.apache.heron.integration_test.common.bolt.IdentityBolt) Fields(org.apache.heron.api.tuple.Fields) ABSpout(org.apache.heron.integration_test.common.spout.ABSpout)

Example 2 with IdentityBolt

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

the class NonGrouping method buildTopology.

@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
    builder.setSpout("ab-spout", new ABSpout(), 1);
    builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 3).noneGrouping("ab-spout");
    return builder;
}
Also used : IdentityBolt(org.apache.heron.integration_test.common.bolt.IdentityBolt) Fields(org.apache.heron.api.tuple.Fields) ABSpout(org.apache.heron.integration_test.common.spout.ABSpout)

Example 3 with IdentityBolt

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

the class OneSpoutBoltMultiTasks method buildTopology.

@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
    builder.setSpout("ab-spout", new ABSpout(), 3);
    builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 3).shuffleGrouping("ab-spout");
    return builder;
}
Also used : IdentityBolt(org.apache.heron.integration_test.common.bolt.IdentityBolt) Fields(org.apache.heron.api.tuple.Fields) ABSpout(org.apache.heron.integration_test.common.spout.ABSpout)

Example 4 with IdentityBolt

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

the class ShuffleGrouping method buildTopology.

@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
    builder.setSpout("ab-spout", new ABSpout(), 1);
    builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 3).localOrShuffleGrouping("ab-spout");
    return builder;
}
Also used : IdentityBolt(org.apache.heron.integration_test.common.bolt.IdentityBolt) Fields(org.apache.heron.api.tuple.Fields) ABSpout(org.apache.heron.integration_test.common.spout.ABSpout)

Example 5 with IdentityBolt

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

the class LocalReadWriteTopology method main.

public static void main(String[] args) throws Exception {
    if (args.length < 3 || args.length > 4) {
        throw new RuntimeException("Expects 3 or 4 arguments, topology name, " + "inputFile, outputFile and max emit count (optional)");
    }
    String topologyName = args[0];
    String inputFile = args[1];
    String outputFile = args[2];
    TestTopologyBuilder builder = new TestTopologyBuilder(outputFile);
    builder.setTerminalBoltClass(LOCAL_AGGREGATOR_BOLT_CLASS);
    if (args.length == 3) {
        builder.setSpout("paused-local-spout", new PausedLocalFileSpout(inputFile), 1);
    } else {
        int maxEmits = Integer.parseInt(args[3]);
        builder.setSpout("paused-local-spout", new PausedLocalFileSpout(inputFile), 1, maxEmits);
    }
    builder.setBolt("identity-bolt", new IdentityBolt(new Fields("line")), 1).shuffleGrouping("paused-local-spout");
    Config conf = new BasicConfig();
    HeronSubmitter.submitTopology(topologyName, conf, builder.createTopology());
}
Also used : BasicConfig(org.apache.heron.integration_test.common.BasicConfig) IdentityBolt(org.apache.heron.integration_test.common.bolt.IdentityBolt) Fields(org.apache.heron.api.tuple.Fields) Config(org.apache.heron.api.Config) BasicConfig(org.apache.heron.integration_test.common.BasicConfig) PausedLocalFileSpout(org.apache.heron.integration_test.common.spout.PausedLocalFileSpout) TestTopologyBuilder(org.apache.heron.integration_test.core.TestTopologyBuilder)

Aggregations

Fields (org.apache.heron.api.tuple.Fields)13 IdentityBolt (org.apache.heron.integration_test.common.bolt.IdentityBolt)13 ABSpout (org.apache.heron.integration_test.common.spout.ABSpout)12 Config (org.apache.heron.api.Config)1 BasicConfig (org.apache.heron.integration_test.common.BasicConfig)1 PausedLocalFileSpout (org.apache.heron.integration_test.common.spout.PausedLocalFileSpout)1 TestTopologyBuilder (org.apache.heron.integration_test.core.TestTopologyBuilder)1