Skip to content

Commit c8777cc

Browse files
committed
similar changes as prev code
1 parent cff663f commit c8777cc

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,28 +431,26 @@ private void cleanupStaledPreemptionCandidates(long currentTime) {
431431
}
432432

433433
private Set<String> getLeafQueueNames(TempQueuePerPartition q) {
434-
Set<String> leafQueueNames = new HashSet<>();
435-
436434
boolean isAutoQueueEligible = q.parentQueue != null &&
437435
(q.parentQueue.isEligibleForAutoQueueCreation() ||
438436
q.parentQueue.isEligibleForLegacyAutoQueueCreation());
439437
boolean isManagedParent = q.parentQueue instanceof ManagedParentQueue;
440438

441-
if (isAutoQueueEligible || isManagedParent) {
442-
return leafQueueNames;
439+
if ((isAutoQueueEligible || isManagedParent)) {
440+
return Collections.emptySet();
443441
}
444442

445443
// Only consider this a leaf queue if:
446-
// It has no children AND
444+
// It has no children and
447445
// It is a concrete leaf queue (not a childless parent)
448446
if (CollectionUtils.isEmpty(q.children)) {
449447
CSQueue queue = scheduler.getQueue(q.queueName);
450448
if (queue instanceof LeafQueue) {
451-
leafQueueNames.add(q.queueName);
449+
return ImmutableSet.of(q.queueName);
452450
}
453-
return leafQueueNames;
451+
return Collections.emptySet();
454452
}
455-
453+
Set<String> leafQueueNames = new HashSet<>();
456454
for (TempQueuePerPartition child : q.children) {
457455
leafQueueNames.addAll(getLeafQueueNames(child));
458456
}

0 commit comments

Comments
 (0)