File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src
main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter
test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 2020import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .capacity .CapacitySchedulerConfiguration .MAPPING_RULE_FORMAT ;
2121import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .capacity .CapacitySchedulerConfiguration .MAPPING_RULE_JSON ;
2222import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .capacity .CapacitySchedulerConfiguration .MAPPING_RULE_FORMAT_JSON ;
23+ import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .capacity .CapacitySchedulerConfiguration .USER_LIMIT_FACTOR ;
2324import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .fair .converter .FSQueueConverter .QUEUE_MAX_AM_SHARE_DISABLED ;
2425
2526import java .io .ByteArrayOutputStream ;
@@ -295,6 +296,7 @@ private void convertCapacitySchedulerXml(FairScheduler fs) {
295296 emitDefaultUserMaxParallelApplications ();
296297 emitUserMaxParallelApplications ();
297298 emitDefaultMaxAMShare ();
299+ emitDefaultUserLimitFactor ();
298300 emitDisablePreemptionForObserveOnlyMode ();
299301
300302 FSQueueConverter queueConverter = FSQueueConverterBuilder .create ()
@@ -412,6 +414,14 @@ private void emitDefaultMaxAMShare() {
412414 queueMaxAMShareDefault );
413415 }
414416 }
417+
418+ private void emitDefaultUserLimitFactor () {
419+ capacitySchedulerConfig .setFloat (
420+ CapacitySchedulerConfiguration .
421+ PREFIX + USER_LIMIT_FACTOR ,
422+ -1.0f );
423+ }
424+
415425 private void emitDisablePreemptionForObserveOnlyMode () {
416426 if (preemptionMode == FSConfigToCSConfigConverterParams
417427 .PreemptionMode .OBSERVE_ONLY ) {
Original file line number Diff line number Diff line change 1717package org .apache .hadoop .yarn .server .resourcemanager .scheduler .fair .converter ;
1818
1919import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .capacity .CapacitySchedulerConfiguration .PREFIX ;
20+ import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .capacity .CapacitySchedulerConfiguration .USER_LIMIT_FACTOR ;
2021import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .fair .converter .FSConfigToCSConfigRuleHandler .DYNAMIC_MAX_ASSIGN ;
2122import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .fair .converter .FSConfigToCSConfigRuleHandler .MAX_CAPACITY_PERCENTAGE ;
2223import static org .apache .hadoop .yarn .server .resourcemanager .scheduler .fair .converter .FSConfigToCSConfigRuleHandler .MAX_CHILD_CAPACITY ;
@@ -185,6 +186,20 @@ public void testDefaultMaxAMShare() throws Exception {
185186 conf .get (PREFIX + "root.users.joe maximum-am-resource-percent" ));
186187 }
187188
189+ @ Test
190+ public void testDefaultUserLimitFactor () throws Exception {
191+ converter .convert (config );
192+
193+ Configuration conf = converter .getCapacitySchedulerConfig ();
194+ String userLimitFactor =
195+ conf .get (PREFIX + USER_LIMIT_FACTOR );
196+
197+ assertEquals ("Default user limit factor" , "-1.0" , userLimitFactor );
198+
199+ assertNull ("root.users.joe user-limit-factor should be null" ,
200+ conf .get (PREFIX + "root.users.joe user-limit-factor" ));
201+ }
202+
188203 @ Test
189204 public void testDefaultMaxAMShareDisabled () throws Exception {
190205 FSConfigToCSConfigConverterParams params = createDefaultParamsBuilder ()
You can’t perform that action at this time.
0 commit comments