Search in sources :

Example 6 with CSQueue

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);
}
Also used : CSQueue(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue)

Example 7 with CSQueue

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);
}
Also used : CSQueue(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue)

Example 8 with CSQueue

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);
}
Also used : CSQueue(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue)

Example 9 with CSQueue

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;
}
Also used : CSQueue(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue)

Example 10 with CSQueue

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;
}
Also used : QueueCapacities(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacities) ArrayList(java.util.ArrayList) CSQueue(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue)

Aggregations

CSQueue (org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue)20 Resource (org.apache.hadoop.yarn.api.records.Resource)5 ArrayList (java.util.ArrayList)4 ParentQueue (org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.ParentQueue)4 LeafQueue (org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue)3 QueueCapacities (org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacities)3 ReentrantReadWriteLock (java.util.concurrent.locks.ReentrantReadWriteLock)2 CapacityScheduler (org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler)2 QueueOrderingPolicy (org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.policy.QueueOrderingPolicy)2 ResourceCalculator (org.apache.hadoop.yarn.util.resource.ResourceCalculator)2 Matchers.anyString (org.mockito.Matchers.anyString)2 Counter (com.codahale.metrics.Counter)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 TreeSet (java.util.TreeSet)1 ReadLock (java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1