Search in sources :

Example 1 with PhysicalPlanHelper

use of org.apache.heron.common.utils.misc.PhysicalPlanHelper in project heron by twitter.

the class ActivateDeactivateTest method buildMessage.

private InstanceControlMsg buildMessage(TopologyAPI.TopologyState state) {
    PhysicalPlans.PhysicalPlan physicalPlan = UnitTestHelper.getPhysicalPlan(true, -1, state);
    PhysicalPlanHelper physicalPlanHelper = new PhysicalPlanHelper(physicalPlan, SPOUT_INSTANCE_ID);
    return InstanceControlMsg.newBuilder().setNewPhysicalPlanHelper(physicalPlanHelper).build();
}
Also used : PhysicalPlanHelper(org.apache.heron.common.utils.misc.PhysicalPlanHelper) PhysicalPlans(org.apache.heron.proto.system.PhysicalPlans)

Example 2 with PhysicalPlanHelper

use of org.apache.heron.common.utils.misc.PhysicalPlanHelper 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 3 with PhysicalPlanHelper

use of org.apache.heron.common.utils.misc.PhysicalPlanHelper in project heron by twitter.

the class BoltStatefulInstanceTest method buildPhysicalPlanMessage.

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

Example 4 with PhysicalPlanHelper

use of org.apache.heron.common.utils.misc.PhysicalPlanHelper in project heron by twitter.

the class SpoutInstanceTest method initSpout.

private static void initSpout(ExecutorTester executorTester, boolean ackEnabled, int timeout) {
    PhysicalPlans.PhysicalPlan physicalPlan = UnitTestHelper.getPhysicalPlan(ackEnabled, timeout);
    PhysicalPlanHelper physicalPlanHelper = new PhysicalPlanHelper(physicalPlan, SPOUT_INSTANCE_ID);
    executorTester.getInControlQueue().offer(InstanceControlMsg.newBuilder().setNewPhysicalPlanHelper(physicalPlanHelper).build());
}
Also used : PhysicalPlanHelper(org.apache.heron.common.utils.misc.PhysicalPlanHelper) PhysicalPlans(org.apache.heron.proto.system.PhysicalPlans)

Example 5 with PhysicalPlanHelper

use of org.apache.heron.common.utils.misc.PhysicalPlanHelper in project heron by twitter.

the class InstanceExecutor method createPhysicalPlanHelper.

protected PhysicalPlanHelper createPhysicalPlanHelper(PhysicalPlans.PhysicalPlan physicalPlan, String instanceId, MetricsCollector metricsCollector) {
    PhysicalPlanHelper localPhysicalPlanHelper = new PhysicalPlanHelper(physicalPlan, instanceId);
    // Bind the MetricsCollector with topologyContext
    localPhysicalPlanHelper.setTopologyContext(metricsCollector);
    return localPhysicalPlanHelper;
}
Also used : PhysicalPlanHelper(org.apache.heron.common.utils.misc.PhysicalPlanHelper)

Aggregations

PhysicalPlanHelper (org.apache.heron.common.utils.misc.PhysicalPlanHelper)11 PhysicalPlans (org.apache.heron.proto.system.PhysicalPlans)5 InstanceControlMsg (org.apache.heron.instance.InstanceControlMsg)4 Test (org.junit.Test)4 ByteString (com.google.protobuf.ByteString)1 Message (com.google.protobuf.Message)1 InetSocketAddress (java.net.InetSocketAddress)1 ClosedChannelException (java.nio.channels.ClosedChannelException)1 ServerSocketChannel (java.nio.channels.ServerSocketChannel)1 SocketChannel (java.nio.channels.SocketChannel)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 TopologyAPI (org.apache.heron.api.generated.TopologyAPI)1 OutgoingPacket (org.apache.heron.common.network.OutgoingPacket)1 REQID (org.apache.heron.common.network.REQID)1 MetricsCollector (org.apache.heron.common.utils.metrics.MetricsCollector)1 HeronTuples (org.apache.heron.proto.system.HeronTuples)1 TestBolt (org.apache.heron.resource.TestBolt)1 TestSpout (org.apache.heron.resource.TestSpout)1 TopologyManagerTest (org.apache.heron.simulator.utils.TopologyManagerTest)1