@Override public void setFairShare(Resource fairShare) { this.fairShare = fairShare; metrics.setFairShare(fairShare); if (LOG.isDebugEnabled()) { LOG.debug("The updated fairShare for " + getName() + " is " + fairShare); } }
protected void throwPolicyDoesnotApplyException(SchedulingPolicy policy) throws AllocationConfigurationException { throw new AllocationConfigurationException("SchedulingPolicy " + policy + " does not apply to queue " + getName()); }
protected void throwPolicyDoesnotApplyException(SchedulingPolicy policy) throws AllocationConfigurationException { throw new AllocationConfigurationException("SchedulingPolicy " + policy + " does not apply to queue " + getName()); }
@Override public Set<String> getPlanQueues() throws YarnException { Set<String> planQueues = new HashSet<String>(); for (FSQueue fsQueue : queueMgr.getQueues()) { String queueName = fsQueue.getName(); if (allocConf.isReservable(queueName)) { planQueues.add(queueName); } } return planQueues; }
@Override public Set<String> getPlanQueues() throws YarnException { Set<String> planQueues = new HashSet<String>(); for (FSQueue fsQueue : queueMgr.getQueues()) { String queueName = fsQueue.getName(); if (allocConf.isReservable(queueName)) { planQueues.add(queueName); } } return planQueues; }
@Override public Set<String> getPlanQueues() throws YarnException { Set<String> planQueues = new HashSet<String>(); for (FSQueue fsQueue : queueMgr.getQueues()) { String queueName = fsQueue.getName(); if (allocConf.isReservable(queueName)) { planQueues.add(queueName); } } return planQueues; }
@Override protected String getReservationQueueName(String planQueueName, String reservationQueueName) { String planQueueNameFullPath = fs.getQueueManager().getQueue (planQueueName).getName(); if (!reservationQueueName.startsWith(planQueueNameFullPath)) { // If name is not a path we need full path for FairScheduler. See // YARN-2773 for the root cause return planQueueNameFullPath + "." + reservationQueueName; } return reservationQueueName; }
@Override protected String getReservationQueueName(String planQueueName, String reservationQueueName) { String planQueueNameFullPath = fs.getQueueManager().getQueue (planQueueName).getName(); if (!reservationQueueName.startsWith(planQueueNameFullPath)) { // If name is not a path we need full path for FairScheduler. See // YARN-2773 for the root cause return planQueueNameFullPath + "." + reservationQueueName; } return reservationQueueName; }
@Override protected String getReservationQueueName(String planQueueName, String reservationQueueName) { String planQueueNameFullPath = fs.getQueueManager().getQueue (planQueueName).getName(); if (!reservationQueueName.startsWith(planQueueNameFullPath)) { // If name is not a path we need full path for FairScheduler. See // YARN-2773 for the root cause return planQueueNameFullPath + "." + reservationQueueName; } return reservationQueueName; }
@Override public ResourceWeights getWeights() { return scheduler.getAllocationConfiguration().getQueueWeight(getName()); }
@Override public Resource getMaxShare() { return scheduler.getAllocationConfiguration().getMaxResources(getName()); }
/** Convenient toString implementation for debugging. */ @Override public String toString() { return String.format("[%s, demand=%s, running=%s, share=%s, w=%s]", getName(), getDemand(), getResourceUsage(), fairShare, getWeights()); }
/** Convenient toString implementation for debugging. */ @Override public String toString() { return String.format("[%s, demand=%s, running=%s, share=%s, w=%s]", getName(), getDemand(), getResourceUsage(), fairShare, getWeight()); }
/** Convenient toString implementation for debugging. */ @Override public String toString() { return String.format("[%s, demand=%s, running=%s, share=%s, w=%s]", getName(), getDemand(), getResourceUsage(), fairShare, getWeights()); }
@Override public Resource getMaxShare() { Resource maxResource = maxShare.getResource(scheduler.getClusterResource()); // Max resource should be greater than or equal to min resource Resource result = Resources.componentwiseMax(maxResource, minShare); if (!Resources.equals(maxResource, result)) { LOG.warn(String.format("Queue %s has max resources %s less than " + "min resources %s", getName(), maxResource, minShare)); } return result; }
/** * Helper method to check if the queue should attempt assigning resources * * @return true if check passes (can assign) or false otherwise */ protected boolean assignContainerPreCheck(FSSchedulerNode node) { if (!Resources.fitsIn(getResourceUsage(), scheduler.getAllocationConfiguration().getMaxResources(getName())) || node.getReservedContainer() != null) { return false; } return true; }
public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent) { this.name = name; this.scheduler = scheduler; this.metrics = FSQueueMetrics.forQueue(getName(), parent, true, scheduler.getConf()); metrics.setMinShare(getMinShare()); metrics.setMaxShare(getMaxShare()); this.parent = parent; }
public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent) { this.name = name; this.scheduler = scheduler; this.metrics = FSQueueMetrics.forQueue(getName(), parent, true, scheduler.getConf()); metrics.setMinShare(getMinShare()); metrics.setMaxShare(getMaxShare()); this.parent = parent; }
public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent) { this.name = name; this.scheduler = scheduler; this.authorizer = YarnAuthorizationProvider.getInstance(scheduler.getConf()); this.queueEntity = new PrivilegedEntity(EntityType.QUEUE, name); this.metrics = FSQueueMetrics.forQueue(getName(), parent, true, scheduler.getConf()); this.parent = parent; setPolicy(scheduler.getAllocationConfiguration().getSchedulingPolicy(name)); reinit(false); }
/** * Test simple leaf queue creation. */ @Test public void testCreateLeafQueue() { AllocationConfiguration allocConf = scheduler.getAllocationConfiguration(); queueManager.updateAllocationConfiguration(allocConf); FSQueue q1 = queueManager.createQueue("root.queue1", FSQueueType.LEAF); assertNotNull("Leaf queue root.queue1 was not created", queueManager.getLeafQueue("root.queue1", false)); assertEquals("createQueue() returned wrong queue", "root.queue1", q1.getName()); }