|
17 | 17 | package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter;
|
18 | 18 |
|
19 | 19 | import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.PREFIX;
|
| 20 | +import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.DOT; |
| 21 | +import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.USER_LIMIT_FACTOR; |
20 | 22 |
|
21 | 23 | import java.util.List;
|
22 | 24 | import java.util.stream.Collectors;
|
23 | 25 |
|
24 | 26 | import org.apache.hadoop.conf.Configuration;
|
25 | 27 | import org.apache.hadoop.yarn.api.records.Resource;
|
| 28 | +import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration; |
26 | 29 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.ConfigurableResource;
|
27 | 30 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSLeafQueue;
|
28 | 31 | import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue;
|
@@ -79,6 +82,7 @@ public void convertQueueHierarchy(FSQueue queue) {
|
79 | 82 | emitMaxParallelApps(queueName, queue);
|
80 | 83 | emitMaxAllocations(queueName, queue);
|
81 | 84 | emitPreemptionDisabled(queueName, queue);
|
| 85 | + emitDefaultUserLimitFactor(queueName, children); |
82 | 86 |
|
83 | 87 | emitChildCapacity(queue);
|
84 | 88 | emitMaximumCapacity(queueName, queue);
|
@@ -215,6 +219,15 @@ private void emitPreemptionDisabled(String queueName, FSQueue queue) {
|
215 | 219 | }
|
216 | 220 | }
|
217 | 221 |
|
| 222 | + public void emitDefaultUserLimitFactor(String queueName, List<FSQueue> children) { |
| 223 | + if (children.isEmpty()) { |
| 224 | + capacitySchedulerConfig.setFloat( |
| 225 | + CapacitySchedulerConfiguration. |
| 226 | + PREFIX + queueName + DOT + USER_LIMIT_FACTOR, |
| 227 | + -1.0f); |
| 228 | + } |
| 229 | + } |
| 230 | + |
218 | 231 | /**
|
219 | 232 | * yarn.scheduler.fair.sizebasedweight ==>
|
220 | 233 | * yarn.scheduler.capacity.<queue-path>
|
|
0 commit comments