YARN-6917. Queue path is recomputed from scratch on every allocation. Contributed by Eric Payne

This commit is contained in:
Jason Lowe 2017-08-14 15:31:34 -05:00
parent 3325ef653d
commit 5558792894
3 changed files with 8 additions and 11 deletions

View File

@ -76,6 +76,7 @@ public abstract class AbstractCSQueue implements CSQueue {
private static final Log LOG = LogFactory.getLog(AbstractCSQueue.class); private static final Log LOG = LogFactory.getLog(AbstractCSQueue.class);
volatile CSQueue parent; volatile CSQueue parent;
final String queueName; final String queueName;
private final String queuePath;
volatile int numContainers; volatile int numContainers;
final Resource minimumAllocation; final Resource minimumAllocation;
@ -119,6 +120,8 @@ public abstract class AbstractCSQueue implements CSQueue {
this.labelManager = cs.getRMContext().getNodeLabelManager(); this.labelManager = cs.getRMContext().getNodeLabelManager();
this.parent = parent; this.parent = parent;
this.queueName = queueName; this.queueName = queueName;
this.queuePath =
((parent == null) ? "" : (parent.getQueuePath() + ".")) + this.queueName;
this.resourceCalculator = cs.getResourceCalculator(); this.resourceCalculator = cs.getResourceCalculator();
this.activitiesManager = cs.getActivitiesManager(); this.activitiesManager = cs.getActivitiesManager();
@ -151,6 +154,11 @@ public abstract class AbstractCSQueue implements CSQueue {
parent == null ? null : parent.getQueueCapacities()); parent == null ? null : parent.getQueueCapacities());
} }
@Override
public String getQueuePath() {
return queuePath;
}
@Override @Override
public float getCapacity() { public float getCapacity() {
return queueCapacities.getCapacity(); return queueCapacities.getCapacity();

View File

@ -299,11 +299,6 @@ public class LeafQueue extends AbstractCSQueue {
} }
} }
@Override
public String getQueuePath() {
return getParent().getQueuePath() + "." + getQueueName();
}
/** /**
* Used only by tests. * Used only by tests.
*/ */

View File

@ -198,12 +198,6 @@ public class ParentQueue extends AbstractCSQueue {
} }
} }
@Override
public String getQueuePath() {
String parentPath = ((parent == null) ? "" : (parent.getQueuePath() + "."));
return parentPath + getQueueName();
}
@Override @Override
public QueueInfo getQueueInfo( public QueueInfo getQueueInfo(
boolean includeChildQueues, boolean recursive) { boolean includeChildQueues, boolean recursive) {