Skip to content

Commit

Permalink
Merge branch 'apache:trunk' into YARN-11225
Browse files Browse the repository at this point in the history
  • Loading branch information
slfan1989 authored Jan 3, 2023
2 parents 14a7b19 + c44c9f9 commit de61c01
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 192 deletions.
2 changes: 1 addition & 1 deletion hadoop-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<properties>
<!-- Set the Release year during release -->
<release-year>2022</release-year>
<release-year>2023</release-year>

<failIfNoTests>false</failIfNoTests>
<!--Whether to proceed to next module if any test failures exist-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter;

import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.PREFIX;
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.DOT;
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.USER_LIMIT_FACTOR;

import java.util.List;
import java.util.stream.Collectors;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.ConfigurableResource;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSLeafQueue;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue;
Expand Down Expand Up @@ -79,6 +82,7 @@ public void convertQueueHierarchy(FSQueue queue) {
emitMaxParallelApps(queueName, queue);
emitMaxAllocations(queueName, queue);
emitPreemptionDisabled(queueName, queue);
emitDefaultUserLimitFactor(queueName, children);

emitChildCapacity(queue);
emitMaximumCapacity(queueName, queue);
Expand Down Expand Up @@ -215,6 +219,15 @@ private void emitPreemptionDisabled(String queueName, FSQueue queue) {
}
}

public void emitDefaultUserLimitFactor(String queueName, List<FSQueue> children) {
if (children.isEmpty()) {
capacitySchedulerConfig.setFloat(
CapacitySchedulerConfiguration.
PREFIX + queueName + DOT + USER_LIMIT_FACTOR,
-1.0f);
}
}

/**
* yarn.scheduler.fair.sizebasedweight ==>
* yarn.scheduler.capacity.&lt;queue-path&gt;
Expand Down
Loading

0 comments on commit de61c01

Please sign in to comment.