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;
}
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));
}
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);
}
Aggregations