private int getActualNodeLocalityDelay() { return Math.min(rmContext.getScheduler().getNumClusterNodes(), application .getCSLeafQueue().getNodeLocalityDelay()); }
private int getActualRackLocalityDelay() { return Math.min(rmContext.getScheduler().getNumClusterNodes(), application.getCSLeafQueue().getNodeLocalityDelay() + application.getCSLeafQueue().getRackLocalityAdditionalDelay()); }
@Test (timeout = 30000) public void testNodeLocalityAfterQueueRefresh() throws Exception { // Manipulate queue 'e' LeafQueue e = stubLeafQueue((LeafQueue)queues.get(E)); // before reinitialization assertEquals(40, e.getNodeLocalityDelay()); csConf.setInt(CapacitySchedulerConfiguration .NODE_LOCALITY_DELAY, 60); Map<String, CSQueue> newQueues = new HashMap<String, CSQueue>(); CSQueue newRoot = CapacityScheduler.parseQueue(csContext, csConf, null, CapacitySchedulerConfiguration.ROOT, newQueues, queues, TestUtils.spyHook); queues = newQueues; root.reinitialize(newRoot, cs.getClusterResource()); // after reinitialization assertEquals(60, e.getNodeLocalityDelay()); }
Math.min(scheduler.getNumClusterNodes(), getNodeLocalityDelay()) < missedOpportunities );
Math.min(scheduler.getNumClusterNodes(), getNodeLocalityDelay()) < missedOpportunities );
@Test (timeout = 30000) public void testLocalityDelaysAfterQueueRefresh() throws Exception { // Manipulate queue 'e' LeafQueue e = stubLeafQueue((LeafQueue)queues.get(E)); // before reinitialization assertEquals(40, e.getNodeLocalityDelay()); assertEquals(-1, e.getRackLocalityAdditionalDelay()); csConf.setInt(CapacitySchedulerConfiguration.NODE_LOCALITY_DELAY, 60); csConf.setInt( CapacitySchedulerConfiguration.RACK_LOCALITY_ADDITIONAL_DELAY, 600); Map<String, CSQueue> newQueues = new HashMap<String, CSQueue>(); CSQueue newRoot = CapacitySchedulerQueueManager.parseQueue(csContext, csConf, null, ROOT, newQueues, queues, TestUtils.spyHook); root.reinitialize(newRoot, cs.getClusterResource()); // after reinitialization assertEquals(60, e.getNodeLocalityDelay()); assertEquals(600, e.getRackLocalityAdditionalDelay()); }
doReturn(1).when(a).getNodeLocalityDelay();
doReturn(1).when(a).getNodeLocalityDelay();
null); assertEquals(30, leafQueue.getNodeLocalityDelay()); assertEquals(20, leafQueue.getMaxApplications()); assertEquals(2, leafQueue.getMaxApplicationsPerUser());
assertEquals(2, a.getNodeLocalityDelay()); assertEquals(1, a.getRackLocalityAdditionalDelay());
doReturn(-1).when(a).getNodeLocalityDelay();