YARN-10919. Remove LeafQueue#scheduler field (#3382)
Co-authored-by: Jie Wang <jie.wang@hulu.com>
This commit is contained in:
parent
40e639ad07
commit
4e209a31da
@ -109,8 +109,6 @@ public class LeafQueue extends AbstractCSQueue {
|
|||||||
private final RecordFactory recordFactory =
|
private final RecordFactory recordFactory =
|
||||||
RecordFactoryProvider.getRecordFactory(null);
|
RecordFactoryProvider.getRecordFactory(null);
|
||||||
|
|
||||||
private CapacitySchedulerContext scheduler;
|
|
||||||
|
|
||||||
private final UsersManager usersManager;
|
private final UsersManager usersManager;
|
||||||
|
|
||||||
// cache last cluster resource to compute actual capacity
|
// cache last cluster resource to compute actual capacity
|
||||||
@ -162,9 +160,8 @@ public LeafQueue(CapacitySchedulerContext cs,
|
|||||||
IOException {
|
IOException {
|
||||||
super(cs, configuration, queueName, parent, old);
|
super(cs, configuration, queueName, parent, old);
|
||||||
setDynamicQueue(isDynamic);
|
setDynamicQueue(isDynamic);
|
||||||
this.scheduler = cs;
|
|
||||||
|
|
||||||
this.usersManager = new UsersManager(metrics, this, labelManager, scheduler,
|
this.usersManager = new UsersManager(metrics, this, labelManager, csContext,
|
||||||
resourceCalculator);
|
resourceCalculator);
|
||||||
|
|
||||||
// One time initialization is enough since it is static ordering policy
|
// One time initialization is enough since it is static ordering policy
|
||||||
@ -217,7 +214,7 @@ protected void setupQueueConfigs(Resource clusterResource,
|
|||||||
}
|
}
|
||||||
|
|
||||||
priorityAcls = conf.getPriorityAcls(getQueuePath(),
|
priorityAcls = conf.getPriorityAcls(getQueuePath(),
|
||||||
scheduler.getMaxClusterLevelAppPriority());
|
csContext.getMaxClusterLevelAppPriority());
|
||||||
|
|
||||||
if (!SchedulerUtils.checkQueueLabelExpression(this.accessibleLabels,
|
if (!SchedulerUtils.checkQueueLabelExpression(this.accessibleLabels,
|
||||||
this.defaultLabelExpression, null)) {
|
this.defaultLabelExpression, null)) {
|
||||||
@ -2031,7 +2028,7 @@ public void recoverContainer(Resource clusterResource,
|
|||||||
// Careful! Locking order is important!
|
// Careful! Locking order is important!
|
||||||
writeLock.lock();
|
writeLock.lock();
|
||||||
try {
|
try {
|
||||||
FiCaSchedulerNode node = scheduler.getNode(
|
FiCaSchedulerNode node = csContext.getNode(
|
||||||
rmContainer.getContainer().getNodeId());
|
rmContainer.getContainer().getNodeId());
|
||||||
allocateResource(clusterResource, attempt,
|
allocateResource(clusterResource, attempt,
|
||||||
rmContainer.getContainer().getResource(), node.getPartition(),
|
rmContainer.getContainer().getResource(), node.getPartition(),
|
||||||
@ -2158,7 +2155,7 @@ public void attachContainer(Resource clusterResource,
|
|||||||
if (application != null && rmContainer != null
|
if (application != null && rmContainer != null
|
||||||
&& rmContainer.getExecutionType() == ExecutionType.GUARANTEED) {
|
&& rmContainer.getExecutionType() == ExecutionType.GUARANTEED) {
|
||||||
FiCaSchedulerNode node =
|
FiCaSchedulerNode node =
|
||||||
scheduler.getNode(rmContainer.getContainer().getNodeId());
|
csContext.getNode(rmContainer.getContainer().getNodeId());
|
||||||
allocateResource(clusterResource, application, rmContainer.getContainer()
|
allocateResource(clusterResource, application, rmContainer.getContainer()
|
||||||
.getResource(), node.getPartition(), rmContainer);
|
.getResource(), node.getPartition(), rmContainer);
|
||||||
LOG.info("movedContainer" + " container=" + rmContainer.getContainer()
|
LOG.info("movedContainer" + " container=" + rmContainer.getContainer()
|
||||||
@ -2178,7 +2175,7 @@ public void detachContainer(Resource clusterResource,
|
|||||||
if (application != null && rmContainer != null
|
if (application != null && rmContainer != null
|
||||||
&& rmContainer.getExecutionType() == ExecutionType.GUARANTEED) {
|
&& rmContainer.getExecutionType() == ExecutionType.GUARANTEED) {
|
||||||
FiCaSchedulerNode node =
|
FiCaSchedulerNode node =
|
||||||
scheduler.getNode(rmContainer.getContainer().getNodeId());
|
csContext.getNode(rmContainer.getContainer().getNodeId());
|
||||||
releaseResource(clusterResource, application, rmContainer.getContainer()
|
releaseResource(clusterResource, application, rmContainer.getContainer()
|
||||||
.getResource(), node.getPartition(), rmContainer);
|
.getResource(), node.getPartition(), rmContainer);
|
||||||
LOG.info("movedContainer" + " container=" + rmContainer.getContainer()
|
LOG.info("movedContainer" + " container=" + rmContainer.getContainer()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user