Search in sources :

Example 1 with EvaluatorRequest

use of org.apache.reef.driver.evaluator.EvaluatorRequest in project incubator-heron by apache.

the class HeronMasterDriver method requestContainerForWorker.

@VisibleForTesting
void requestContainerForWorker(int id, final HeronWorker worker) {
    int cpu = worker.cores;
    ByteAmount mem = worker.mem;
    EvaluatorRequest evaluatorRequest = createEvaluatorRequest(cpu, mem);
    LOG.info(String.format("Requesting container for worker: %d, mem: %s, cpu: %d", id, mem, cpu));
    requestor.submit(evaluatorRequest);
}
Also used : ByteAmount(com.twitter.heron.common.basics.ByteAmount) EvaluatorRequest(org.apache.reef.driver.evaluator.EvaluatorRequest) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 2 with EvaluatorRequest

use of org.apache.reef.driver.evaluator.EvaluatorRequest in project heron by twitter.

the class HeronMasterDriver method requestContainerForWorker.

@VisibleForTesting
void requestContainerForWorker(int id, final HeronWorker worker) {
    int cpu = worker.cores;
    ByteAmount mem = worker.mem;
    EvaluatorRequest evaluatorRequest = createEvaluatorRequest(cpu, mem);
    LOG.info(String.format("Requesting container for worker: %d, RAM: %s, CPU: %d", id, mem, cpu));
    requestor.submit(evaluatorRequest);
}
Also used : ByteAmount(org.apache.heron.common.basics.ByteAmount) EvaluatorRequest(org.apache.reef.driver.evaluator.EvaluatorRequest) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 3 with EvaluatorRequest

use of org.apache.reef.driver.evaluator.EvaluatorRequest in project heron by twitter.

the class HeronMasterDriverTest method requestContainerForWorkerSubmitsValidRequest.

@Test
public void requestContainerForWorkerSubmitsValidRequest() {
    ByteAmount memory = ByteAmount.fromMegabytes(786);
    EvaluatorRequest request = spyDriver.createEvaluatorRequest(5, memory);
    doReturn(request).when(spyDriver).createEvaluatorRequest(5, memory);
    HeronMasterDriver.HeronWorker worker = new HeronMasterDriver.HeronWorker(3, 5, memory);
    spyDriver.requestContainerForWorker(3, worker);
    verify(mockRequestor, times(1)).submit(request);
}
Also used : ByteAmount(org.apache.heron.common.basics.ByteAmount) EvaluatorRequest(org.apache.reef.driver.evaluator.EvaluatorRequest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 4 with EvaluatorRequest

use of org.apache.reef.driver.evaluator.EvaluatorRequest in project heron by twitter.

the class HeronMasterDriverTest method requestContainerForWorkerSubmitsValidRequest.

@Test
public void requestContainerForWorkerSubmitsValidRequest() {
    ByteAmount memory = ByteAmount.fromMegabytes(786);
    EvaluatorRequest request = spyDriver.createEvaluatorRequest(5, memory);
    doReturn(request).when(spyDriver).createEvaluatorRequest(5, memory);
    HeronMasterDriver.HeronWorker worker = new HeronMasterDriver.HeronWorker(3, 5, memory);
    spyDriver.requestContainerForWorker(3, worker);
    verify(mockRequestor, times(1)).submit(request);
}
Also used : ByteAmount(com.twitter.heron.common.basics.ByteAmount) EvaluatorRequest(org.apache.reef.driver.evaluator.EvaluatorRequest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 5 with EvaluatorRequest

use of org.apache.reef.driver.evaluator.EvaluatorRequest in project heron by twitter.

the class HeronMasterDriver method requestContainerForWorker.

@VisibleForTesting
void requestContainerForWorker(int id, final HeronWorker worker) {
    int cpu = worker.cores;
    ByteAmount mem = worker.mem;
    EvaluatorRequest evaluatorRequest = createEvaluatorRequest(cpu, mem);
    LOG.info(String.format("Requesting container for worker: %d, mem: %s, cpu: %d", id, mem, cpu));
    requestor.submit(evaluatorRequest);
}
Also used : ByteAmount(com.twitter.heron.common.basics.ByteAmount) EvaluatorRequest(org.apache.reef.driver.evaluator.EvaluatorRequest) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

EvaluatorRequest (org.apache.reef.driver.evaluator.EvaluatorRequest)6 ByteAmount (com.twitter.heron.common.basics.ByteAmount)4 VisibleForTesting (com.google.common.annotations.VisibleForTesting)3 Test (org.junit.Test)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 ByteAmount (org.apache.heron.common.basics.ByteAmount)2