Search in sources :

Example 1 with TestBolt

use of org.apache.heron.resource.TestBolt in project heron by twitter.

the class SpoutStatefulInstanceTest method buildPhysicalPlanMessage.

private InstanceControlMsg buildPhysicalPlanMessage(IRichSpout spout) {
    PhysicalPlans.PhysicalPlan physicalPlan = MockPhysicalPlansBuilder.newBuilder().withTopologyConfig(Config.TopologyReliabilityMode.EFFECTIVELY_ONCE, -1).withTopologyState(TopologyAPI.TopologyState.RUNNING).withSpoutInstance("test-spout", 0, "spout-id", spout).withBoltInstance("test-bolt", 1, "bolt-id", "test-spout", new TestBolt()).build();
    PhysicalPlanHelper ph = new PhysicalPlanHelper(physicalPlan, "spout-id");
    return InstanceControlMsg.newBuilder().setNewPhysicalPlanHelper(ph).build();
}
Also used : TestBolt(org.apache.heron.resource.TestBolt) PhysicalPlanHelper(org.apache.heron.common.utils.misc.PhysicalPlanHelper) PhysicalPlans(org.apache.heron.proto.system.PhysicalPlans)

Example 2 with TestBolt

use of org.apache.heron.resource.TestBolt in project heron by twitter.

the class CustomGroupingTest method initBoltA.

@Override
protected void initBoltA(TopologyBuilder topologyBuilder, String boltId, String upstreamComponentId) {
    final CustomStreamGrouping myCustomGrouping = new MyRoundRobinCustomGrouping(getInitInfoKey(upstreamComponentId));
    topologyBuilder.setBolt(boltId, new TestBolt(), 1).customGrouping(upstreamComponentId, myCustomGrouping);
}
Also used : CustomStreamGrouping(org.apache.heron.api.grouping.CustomStreamGrouping) TestBolt(org.apache.heron.resource.TestBolt)

Aggregations

TestBolt (org.apache.heron.resource.TestBolt)2 CustomStreamGrouping (org.apache.heron.api.grouping.CustomStreamGrouping)1 PhysicalPlanHelper (org.apache.heron.common.utils.misc.PhysicalPlanHelper)1 PhysicalPlans (org.apache.heron.proto.system.PhysicalPlans)1