Skip to content

YARN-11006. Allow overriding user limit factor and maxAMResourcePerce… #3652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1707,12 +1707,12 @@ protected boolean canAssignToUser(Resource clusterResource,
@Override
protected void setDynamicQueueProperties(
CapacitySchedulerConfiguration configuration) {
super.setDynamicQueueProperties(configuration);
// set to -1, to disable it
configuration.setUserLimitFactor(getQueuePath(), -1);
// Set Max AM percentage to a higher value
configuration.setMaximumApplicationMasterResourcePerQueuePercent(
getQueuePath(), 1f);
super.setDynamicQueueProperties(configuration);
}

private void updateSchedulerHealthForCompletedContainer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,27 @@ public void testAutoCreatedQueueTemplateConfig() throws Exception {
LeafQueue a2 = createQueue("root.a.a-auto.a2");
Assert.assertEquals("weight is not set by template", 6f,
a2.getQueueCapacities().getWeight(), 1e-6);
Assert.assertEquals("user limit factor should be disabled with dynamic queues",
-1f, a2.getUserLimitFactor(), 1e-6);
Assert.assertEquals("maximum AM resource percent should be 1 with dynamic queues",
1f, a2.getMaxAMResourcePerQueuePercent(), 1e-6);

// Set the user-limit-factor and maximum-am-resource-percent via templates to ensure their
// modified defaults are indeed overridden
csConf.set(AutoCreatedQueueTemplate.getAutoQueueTemplatePrefix(
"root.a.*") + "user-limit-factor", "10");
csConf.set(AutoCreatedQueueTemplate.getAutoQueueTemplatePrefix(
"root.a.*") + "maximum-am-resource-percent", "0.8");

cs.reinitialize(csConf, mockRM.getRMContext());
a2 = (LeafQueue) cs.getQueue("root.a.a-auto.a2");
Assert.assertEquals("weight is overridden", 6f,
a2.getQueueCapacities().getWeight(), 1e-6);
Assert.assertEquals("user limit factor should be modified by templates",
10f, a2.getUserLimitFactor(), 1e-6);
Assert.assertEquals("maximum AM resource percent should be modified by templates",
0.8f, a2.getMaxAMResourcePerQueuePercent(), 1e-6);


csConf.setNonLabeledQueueWeight("root.a.a-auto.a2", 4f);
cs.reinitialize(csConf, mockRM.getRMContext());
Expand Down