YARN-10646. TestCapacitySchedulerWeightMode test descriptor comments doesnt reflect the correct scenario (#3339)

Co-authored-by: Benjamin Teke <bteke@cloudera.com>
This commit is contained in:
Benjamin Teke 2021-09-08 16:11:04 +02:00 committed by GitHub
parent 3024a47026
commit 40e639ad07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,9 +198,9 @@ public static Configuration getCSConfWithLabelsParentUseWeightChildUsePct(
* a x(=100%), y(50%) b y(=50%), z(=100%) * a x(=100%), y(50%) b y(=50%), z(=100%)
* ________________ ______________ * ________________ ______________
* / / \ * / / \
* a1 ([x,y]: w=100) b1(no) b2([y,z]: w=100) * a1 ([x,y]: w=1) b1(no) b2([y,z]: w=1)
* *
* Parent uses weight, child uses percentage * Parent uses percentages, child uses weights
*/ */
public static Configuration getCSConfWithLabelsParentUsePctChildUseWeight( public static Configuration getCSConfWithLabelsParentUsePctChildUseWeight(
Configuration config) { Configuration config) {
@ -210,9 +210,9 @@ public static Configuration getCSConfWithLabelsParentUsePctChildUseWeight(
// Define top-level queues // Define top-level queues
conf.setQueues(CapacitySchedulerConfiguration.ROOT, conf.setQueues(CapacitySchedulerConfiguration.ROOT,
new String[] { "a", "b" }); new String[] { "a", "b" });
conf.setLabeledQueueWeight(CapacitySchedulerConfiguration.ROOT, "x", 100); conf.setCapacityByLabel(CapacitySchedulerConfiguration.ROOT, "x", 100);
conf.setLabeledQueueWeight(CapacitySchedulerConfiguration.ROOT, "y", 100); conf.setCapacityByLabel(CapacitySchedulerConfiguration.ROOT, "y", 100);
conf.setLabeledQueueWeight(CapacitySchedulerConfiguration.ROOT, "z", 100); conf.setCapacityByLabel(CapacitySchedulerConfiguration.ROOT, "z", 100);
conf.setCapacityByLabel(A, RMNodeLabelsManager.NO_LABEL, 10); conf.setCapacityByLabel(A, RMNodeLabelsManager.NO_LABEL, 10);
conf.setMaximumCapacity(A, 10); conf.setMaximumCapacity(A, 10);
@ -228,23 +228,23 @@ public static Configuration getCSConfWithLabelsParentUsePctChildUseWeight(
// Define 2nd-level queues // Define 2nd-level queues
conf.setQueues(A, new String[] { "a1" }); conf.setQueues(A, new String[] { "a1" });
conf.setCapacityByLabel(A1, RMNodeLabelsManager.NO_LABEL, 100); conf.setLabeledQueueWeight(A1, RMNodeLabelsManager.NO_LABEL, 1);
conf.setMaximumCapacity(A1, 100); conf.setMaximumCapacity(A1, 100);
conf.setAccessibleNodeLabels(A1, toSet("x", "y")); conf.setAccessibleNodeLabels(A1, toSet("x", "y"));
conf.setDefaultNodeLabelExpression(A1, "x"); conf.setDefaultNodeLabelExpression(A1, "x");
conf.setCapacityByLabel(A1, "x", 100); conf.setLabeledQueueWeight(A1, "x", 1);
conf.setCapacityByLabel(A1, "y", 100); conf.setLabeledQueueWeight(A1, "y", 1);
conf.setQueues(B, new String[] { "b1", "b2" }); conf.setQueues(B, new String[] { "b1", "b2" });
conf.setCapacityByLabel(B1, RMNodeLabelsManager.NO_LABEL, 50); conf.setLabeledQueueWeight(B1, RMNodeLabelsManager.NO_LABEL, 1);
conf.setMaximumCapacity(B1, 50); conf.setMaximumCapacity(B1, 50);
conf.setAccessibleNodeLabels(B1, RMNodeLabelsManager.EMPTY_STRING_SET); conf.setAccessibleNodeLabels(B1, RMNodeLabelsManager.EMPTY_STRING_SET);
conf.setCapacityByLabel(B2, RMNodeLabelsManager.NO_LABEL, 50); conf.setLabeledQueueWeight(B2, RMNodeLabelsManager.NO_LABEL, 1);
conf.setMaximumCapacity(B2, 50); conf.setMaximumCapacity(B2, 50);
conf.setAccessibleNodeLabels(B2, toSet("y", "z")); conf.setAccessibleNodeLabels(B2, toSet("y", "z"));
conf.setCapacityByLabel(B2, "y", 100); conf.setLabeledQueueWeight(B2, "y", 1);
conf.setCapacityByLabel(B2, "z", 100); conf.setLabeledQueueWeight(B2, "z", 1);
return conf; return conf;
} }