use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue in project hadoop by apache.
the class TestCapacitySchedulerPlanFollower method assertReservationQueueExists.
@Override
protected void assertReservationQueueExists(ReservationId r2, double expectedCapacity, double expectedMaxCapacity) {
CSQueue q = cs.getQueue(r2.toString());
assertNotNull(q);
Assert.assertEquals(expectedCapacity, q.getCapacity(), 0.01);
Assert.assertEquals(expectedMaxCapacity, q.getMaximumCapacity(), 1.0);
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue in project hadoop by apache.
the class TestCapacitySchedulerPlanFollower method assertReservationQueueExists.
@Override
protected void assertReservationQueueExists(ReservationId r) {
CSQueue q = cs.getQueue(r.toString());
assertNotNull(q);
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue in project hadoop by apache.
the class TestCapacitySchedulerPlanFollower method verifyCapacity.
@Override
protected void verifyCapacity(Queue defQ) {
CSQueue csQueue = (CSQueue) defQ;
assertTrue(csQueue.getCapacity() > 0.9);
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue in project hadoop by apache.
the class TestCapacitySchedulerPlanFollower method getNumberOfApplications.
@Override
protected int getNumberOfApplications(Queue queue) {
CSQueue csQueue = (CSQueue) queue;
int numberOfApplications = csQueue.getNumApplications();
return numberOfApplications;
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue in project hadoop by apache.
the class TestPriorityUtilizationQueueOrderingPolicy method mockCSQueues.
private List<CSQueue> mockCSQueues(String[] queueNames, int[] priorities, float[] utilizations, String partition) {
// sanity check
assert queueNames != null && priorities != null && utilizations != null && queueNames.length > 0 && queueNames.length == priorities.length && priorities.length == utilizations.length;
List<CSQueue> list = new ArrayList<>();
for (int i = 0; i < queueNames.length; i++) {
CSQueue q = mock(CSQueue.class);
when(q.getQueueName()).thenReturn(queueNames[i]);
QueueCapacities qc = new QueueCapacities(false);
qc.setUsedCapacity(partition, utilizations[i]);
when(q.getQueueCapacities()).thenReturn(qc);
when(q.getPriority()).thenReturn(Priority.newInstance(priorities[i]));
list.add(q);
}
return list;
}
Aggregations