Skip to content

Commit

Permalink
after pull of trunk updated all left getters and setters
Browse files Browse the repository at this point in the history
Change-Id: I51e191870f435e79a13143f35a9bec73d564d35d
  • Loading branch information
susheel-gupta committed Jul 12, 2023
1 parent ce76e8a commit 4de2e19
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ public Integer getMaxParallelAppsForUser(String user) {
+ MAX_PARALLEL_APPLICATIONS);

return (maxParallelAppsForUser != null) ?
Integer.parseInt(maxParallelAppsForUser)
Integer.valueOf(maxParallelAppsForUser)
: getDefaultMaxParallelAppsPerUser();
}

Expand All @@ -1886,7 +1886,7 @@ public Integer getMaxParallelAppsForQueue(String queue) {
+ MAX_PARALLEL_APPLICATIONS);

return (maxParallelAppsForQueue != null) ?
Integer.parseInt(maxParallelAppsForQueue)
Integer.valueOf(maxParallelAppsForQueue)
: getDefaultMaxParallelAppsPerQueue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter;

import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.MAPPING_RULE_FORMAT;
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.MAPPING_RULE_JSON;
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.MAPPING_RULE_FORMAT_JSON;
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSQueueConverter.QUEUE_MAX_AM_SHARE_DISABLED;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.DEFAULT_AUTO_QUEUE_CREATION_ENABLED;
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;
Expand All @@ -37,8 +36,6 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies.FifoPolicy;
import org.apache.hadoop.yarn.util.resource.Resources;

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

/**
* Converts a Fair Schedule queue hierarchy to Capacity Scheduler
* configuration.
Expand Down Expand Up @@ -221,7 +218,8 @@ private void emitPreemptionDisabled(String queueName, FSQueue queue) {
}

public void emitDefaultUserLimitFactor(String queueName, List<FSQueue> children) {
if (children.isEmpty() && checkAutoQueueCreationV2Disabled(queueName)) {
if (children.isEmpty() &&
!capacitySchedulerConfig.isAutoQueueCreationV2Enabled(queueName)) {
capacitySchedulerConfig.setUserLimitFactor(queueName, -1.0f);
}
}
Expand Down Expand Up @@ -304,12 +302,6 @@ private void checkMaxChildCapacitySetting(FSQueue queue) {
}
}

private boolean checkAutoQueueCreationV2Disabled(String queueName) {
return !capacitySchedulerConfig.getBoolean(
PREFIX + queueName + DOT + AUTO_QUEUE_CREATION_V2_ENABLED,
DEFAULT_AUTO_QUEUE_CREATION_ENABLED);
}

private String getQueueShortName(String queueName) {
int lastDot = queueName.lastIndexOf(".");
return queueName.substring(lastDot + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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.fair.converter.FSConfigToCSConfigRuleHandler.DYNAMIC_MAX_ASSIGN;
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigRuleHandler.MAX_CAPACITY_PERCENTAGE;
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigRuleHandler.MAX_CHILD_CAPACITY;
Expand All @@ -33,7 +32,6 @@
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigRuleHandler.RuleAction.WARNING;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
Expand Down Expand Up @@ -197,8 +195,8 @@ public void testDefaultUserLimitFactor() throws Exception {

assertEquals("root.users user-limit-factor", 1.0f,
conf.getUserLimitFactor("root.users"), 0.0f);
assertEquals("root.users auto-queue-creation-v2.enabled", "true",
conf.get(PREFIX + "root.users.auto-queue-creation-v2.enabled"));
assertEquals("root.users auto-queue-creation-v2.enabled", true,
conf.isAutoQueueCreationV2Enabled( "root.users"));

assertEquals("root.default user-limit-factor", -1.0f,
conf.getUserLimitFactor("root.default"), 0.0f);
Expand All @@ -208,8 +206,8 @@ public void testDefaultUserLimitFactor() throws Exception {

assertEquals("root.admins.bob user-limit-factor", -1.0f,
conf.getUserLimitFactor("root.admins.bob"), 0.0f);
assertNull("root.admin.bob auto-queue-creation-v2.enabled should be null",
conf.get(PREFIX + "root.admin.bob.auto-queue-creation-v2.enabled"));
assertEquals("root.admin.bob auto-queue-creation-v2.enabled", false,
conf.isAutoQueueCreationV2Enabled("root.admin.bob"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ public void testConvertQueueHierarchy() {
"root.misc"));

for (String queue : leafs) {
String key = PREFIX + queue + ".queues";
key = PREFIX + queue + ".queues";
assertNull("Key " + key + " has value, but it should be null",
csConfig.getQueues(queue));
csConfig.getQueues(queue));
}

}
Expand Down Expand Up @@ -393,9 +393,7 @@ public void testAutoCreateV2FlagsInWeightMode() {
assertTrue("root.admins autocreate v2 flag",
csConfig.isAutoQueueCreationV2Enabled("root.admins"));
assertTrue("root.admins.alice autocreate v2 flag",
csConfig.getBoolean(
PREFIX + "root.admins.alice.auto-queue-creation-v2.enabled",
false));
csConfig.isAutoQueueCreationV2Enabled("root.admins.alice"));
assertTrue("root.users autocreate v2 flag",
csConfig.isAutoQueueCreationV2Enabled("root.users"));
assertTrue("root.misc autocreate v2 flag",
Expand Down

0 comments on commit 4de2e19

Please sign in to comment.