Skip to content

Commit 711051f

Browse files
Susheel GuptaSusheel Gupta
authored andcommitted
included auto created leaf queue
1 parent c8777cc commit 711051f

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.commons.lang3.StringUtils;
2424
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractParentQueue;
2525
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue;
26+
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AutoCreatedLeafQueue;
2627
import org.slf4j.Logger;
2728
import org.slf4j.LoggerFactory;
2829
import org.apache.hadoop.classification.InterfaceStability.Unstable;
@@ -41,8 +42,6 @@
4142
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
4243
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
4344

44-
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity
45-
.ManagedParentQueue;
4645
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacities;
4746
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.preemption.PreemptableQueue;
4847
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.ContainerPreemptEvent;
@@ -431,25 +430,16 @@ private void cleanupStaledPreemptionCandidates(long currentTime) {
431430
}
432431

433432
private Set<String> getLeafQueueNames(TempQueuePerPartition q) {
434-
boolean isAutoQueueEligible = q.parentQueue != null &&
435-
(q.parentQueue.isEligibleForAutoQueueCreation() ||
436-
q.parentQueue.isEligibleForLegacyAutoQueueCreation());
437-
boolean isManagedParent = q.parentQueue instanceof ManagedParentQueue;
438-
439-
if ((isAutoQueueEligible || isManagedParent)) {
440-
return Collections.emptySet();
441-
}
442-
443433
// Only consider this a leaf queue if:
444-
// It has no children and
445434
// It is a concrete leaf queue (not a childless parent)
446435
if (CollectionUtils.isEmpty(q.children)) {
447436
CSQueue queue = scheduler.getQueue(q.queueName);
448-
if (queue instanceof LeafQueue) {
437+
if (queue instanceof LeafQueue || queue instanceof AutoCreatedLeafQueue) {
449438
return ImmutableSet.of(q.queueName);
450439
}
451440
return Collections.emptySet();
452441
}
442+
453443
Set<String> leafQueueNames = new HashSet<>();
454444
for (TempQueuePerPartition child : q.children) {
455445
leafQueueNames.addAll(getLeafQueueNames(child));

0 commit comments

Comments
 (0)