|
23 | 23 | import org.apache.commons.lang3.StringUtils; |
24 | 24 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractParentQueue; |
25 | 25 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue; |
| 26 | +import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AutoCreatedLeafQueue; |
26 | 27 | import org.slf4j.Logger; |
27 | 28 | import org.slf4j.LoggerFactory; |
28 | 29 | import org.apache.hadoop.classification.InterfaceStability.Unstable; |
|
41 | 42 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; |
42 | 43 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration; |
43 | 44 |
|
44 | | -import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity |
45 | | - .ManagedParentQueue; |
46 | 45 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacities; |
47 | 46 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.preemption.PreemptableQueue; |
48 | 47 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.ContainerPreemptEvent; |
@@ -431,25 +430,16 @@ private void cleanupStaledPreemptionCandidates(long currentTime) { |
431 | 430 | } |
432 | 431 |
|
433 | 432 | 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 | | - |
443 | 433 | // Only consider this a leaf queue if: |
444 | | - // It has no children and |
445 | 434 | // It is a concrete leaf queue (not a childless parent) |
446 | 435 | if (CollectionUtils.isEmpty(q.children)) { |
447 | 436 | CSQueue queue = scheduler.getQueue(q.queueName); |
448 | | - if (queue instanceof LeafQueue) { |
| 437 | + if (queue instanceof LeafQueue || queue instanceof AutoCreatedLeafQueue) { |
449 | 438 | return ImmutableSet.of(q.queueName); |
450 | 439 | } |
451 | 440 | return Collections.emptySet(); |
452 | 441 | } |
| 442 | + |
453 | 443 | Set<String> leafQueueNames = new HashSet<>(); |
454 | 444 | for (TempQueuePerPartition child : q.children) { |
455 | 445 | leafQueueNames.addAll(getLeafQueueNames(child)); |
|
0 commit comments