Search in sources :

Example 11 with RoundRobinPacking

use of org.apache.heron.packing.roundrobin.RoundRobinPacking in project heron by twitter.

the class HeronMasterDriverTest method onNextAllocatedEvaluatorStartsWorker.

@Test
public void onNextAllocatedEvaluatorStartsWorker() throws Exception {
    PackingPlan packingPlan = PackingTestUtils.testPackingPlan("test", new RoundRobinPacking());
    spyDriver.scheduleHeronWorkers(packingPlan);
    assertTrue(spyDriver.lookupByContainerPlan(1).isPresent());
    PackingPlan.ContainerPlan containerPlan = spyDriver.lookupByContainerPlan(1).get();
    AllocatedEvaluator mockEvaluator = createMockEvaluator("test", getCpu(containerPlan), getRam(containerPlan));
    assertFalse(spyDriver.lookupByEvaluatorId("test").isPresent());
    spyDriver.new ContainerAllocationHandler().onNext(mockEvaluator);
    assertTrue(spyDriver.lookupByEvaluatorId("test").isPresent());
    assertEquals(Integer.valueOf(1), spyDriver.lookupByEvaluatorId("test").get());
    verify(mockEvaluator, times(1)).submitContext(any(Configuration.class));
}
Also used : RoundRobinPacking(org.apache.heron.packing.roundrobin.RoundRobinPacking) Configuration(org.apache.reef.tang.Configuration) PackingPlan(org.apache.heron.spi.packing.PackingPlan) AllocatedEvaluator(org.apache.reef.driver.evaluator.AllocatedEvaluator) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

RoundRobinPacking (org.apache.heron.packing.roundrobin.RoundRobinPacking)11 PackingPlan (org.apache.heron.spi.packing.PackingPlan)7 Test (org.junit.Test)7 PackingPlans (org.apache.heron.proto.system.PackingPlans)5 SchedulerStateManagerAdaptor (org.apache.heron.spi.statemgr.SchedulerStateManagerAdaptor)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 HashSet (java.util.HashSet)3 Config (org.apache.heron.spi.common.Config)2 EvaluatorRequest (org.apache.reef.driver.evaluator.EvaluatorRequest)2 TopologyAPI (org.apache.heron.api.generated.TopologyAPI)1 TopologyUpdate (org.apache.heron.healthmgr.common.HealthManagerEvents.TopologyUpdate)1 Scheduler (org.apache.heron.proto.scheduler.Scheduler)1 ISchedulerClient (org.apache.heron.scheduler.client.ISchedulerClient)1 IPacking (org.apache.heron.spi.packing.IPacking)1 ILauncher (org.apache.heron.spi.scheduler.ILauncher)1 IStateManager (org.apache.heron.spi.statemgr.IStateManager)1 IUploader (org.apache.heron.spi.uploader.IUploader)1 AllocatedEvaluator (org.apache.reef.driver.evaluator.AllocatedEvaluator)1 Configuration (org.apache.reef.tang.Configuration)1 Before (org.junit.Before)1