Search in sources :

Example 6 with IdentityBolt

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

the class OneBoltMultiTasks 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).shuffleGrouping("ab-spout");
    return builder;
}
Also used : IdentityBolt(com.twitter.heron.integration_test.common.bolt.IdentityBolt) Fields(com.twitter.heron.api.tuple.Fields) ABSpout(com.twitter.heron.integration_test.common.spout.ABSpout)

Example 7 with IdentityBolt

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

the class OneSpoutMultiTasks method buildTopology.

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

Example 8 with IdentityBolt

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

the class OneSpoutTwoBolts method buildTopology.

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

Example 9 with IdentityBolt

use of com.twitter.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(com.twitter.heron.integration_test.common.bolt.IdentityBolt) Fields(com.twitter.heron.api.tuple.Fields) ABSpout(com.twitter.heron.integration_test.common.spout.ABSpout)

Example 10 with IdentityBolt

use of com.twitter.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(com.twitter.heron.integration_test.common.BasicConfig) IdentityBolt(com.twitter.heron.integration_test.common.bolt.IdentityBolt) Fields(com.twitter.heron.api.tuple.Fields) Config(com.twitter.heron.api.Config) BasicConfig(com.twitter.heron.integration_test.common.BasicConfig) PausedLocalFileSpout(com.twitter.heron.integration_test.common.spout.PausedLocalFileSpout) TestTopologyBuilder(com.twitter.heron.integration_test.core.TestTopologyBuilder)

Aggregations

Fields (com.twitter.heron.api.tuple.Fields)10 IdentityBolt (com.twitter.heron.integration_test.common.bolt.IdentityBolt)10 ABSpout (com.twitter.heron.integration_test.common.spout.ABSpout)9 Config (com.twitter.heron.api.Config)1 BasicConfig (com.twitter.heron.integration_test.common.BasicConfig)1 PausedLocalFileSpout (com.twitter.heron.integration_test.common.spout.PausedLocalFileSpout)1 TestTopologyBuilder (com.twitter.heron.integration_test.core.TestTopologyBuilder)1