Search in sources :

Example 6 with RoundRobinPacking

use of com.twitter.heron.packing.roundrobin.RoundRobinPacking in project heron by twitter.

the class SchedulerMainTest method getTestPacking.

private SettableFuture<PackingPlans.PackingPlan> getTestPacking() {
    PackingPlans.PackingPlan packingPlan = PackingTestUtils.testProtoPackingPlan("testTopology", new RoundRobinPacking());
    final SettableFuture<PackingPlans.PackingPlan> future = SettableFuture.create();
    future.set(packingPlan);
    return future;
}
Also used : PackingPlans(com.twitter.heron.proto.system.PackingPlans) RoundRobinPacking(com.twitter.heron.packing.roundrobin.RoundRobinPacking) PackingPlan(com.twitter.heron.spi.packing.PackingPlan)

Example 7 with RoundRobinPacking

use of com.twitter.heron.packing.roundrobin.RoundRobinPacking in project heron by twitter.

the class HeronMasterDriverTest method scheduleHeronWorkersAddsContainers.

@Test
public void scheduleHeronWorkersAddsContainers() throws Exception {
    PackingPlan packingPlan = PackingTestUtils.testPackingPlan("test", new RoundRobinPacking());
    spyDriver.scheduleHeronWorkers(packingPlan);
    verify(spyDriver, times(1)).requestContainerForWorker(eq(1), anyHeronWorker());
    verify(mockRequestor, times(1)).submit(any(EvaluatorRequest.class));
    Set<PackingPlan.ContainerPlan> toBeAddedContainerPlans = new HashSet<>();
    toBeAddedContainerPlans.add(PackingTestUtils.testContainerPlan(2));
    toBeAddedContainerPlans.add(PackingTestUtils.testContainerPlan(3));
    spyDriver.scheduleHeronWorkers(toBeAddedContainerPlans);
    verify(spyDriver, times(1)).requestContainerForWorker(eq(2), anyHeronWorker());
    verify(spyDriver, times(1)).requestContainerForWorker(eq(3), anyHeronWorker());
    verify(mockRequestor, times(3)).submit(any(EvaluatorRequest.class));
}
Also used : RoundRobinPacking(com.twitter.heron.packing.roundrobin.RoundRobinPacking) PackingPlan(com.twitter.heron.spi.packing.PackingPlan) EvaluatorRequest(org.apache.reef.driver.evaluator.EvaluatorRequest) HashSet(java.util.HashSet) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 8 with RoundRobinPacking

use of com.twitter.heron.packing.roundrobin.RoundRobinPacking in project heron by twitter.

the class HeronMasterDriverTest method scheduleHeronWorkersFailsOnDuplicateRequest.

@Test(expected = HeronMasterDriver.ContainerAllocationException.class)
public void scheduleHeronWorkersFailsOnDuplicateRequest() throws Exception {
    PackingPlan packingPlan = PackingTestUtils.testPackingPlan("test", new RoundRobinPacking());
    spyDriver.scheduleHeronWorkers(packingPlan);
    verify(spyDriver, times(1)).requestContainerForWorker(eq(1), anyHeronWorker());
    verify(mockRequestor, times(1)).submit(any(EvaluatorRequest.class));
    PackingPlan.ContainerPlan duplicatePlan = PackingTestUtils.testContainerPlan(1);
    Set<PackingPlan.ContainerPlan> toBeAddedContainerPlans = new HashSet<>();
    toBeAddedContainerPlans.add(duplicatePlan);
    spyDriver.scheduleHeronWorkers(toBeAddedContainerPlans);
}
Also used : RoundRobinPacking(com.twitter.heron.packing.roundrobin.RoundRobinPacking) PackingPlan(com.twitter.heron.spi.packing.PackingPlan) EvaluatorRequest(org.apache.reef.driver.evaluator.EvaluatorRequest) HashSet(java.util.HashSet) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

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