brumi1024 commented on code in PR #4622:
URL: https://github.com/apache/hadoop/pull/4622#discussion_r929697804
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestAutoCreatedQueueTemplate.java:
##########
@@ -66,6 +66,34 @@ public void testOneLevelWildcardTemplate() {
}
+ @Test
+ public void testTwoLevelWildcardTemplate() {
+ conf.set(getTemplateKey("root.*", "capacity"), "6w");
+ conf.set(getTemplateKey("root.*.*", "capacity"), "5w");
+
+ new AutoCreatedQueueTemplate(conf, TEST_QUEUE_A)
+ .setTemplateEntriesForChild(conf, TEST_QUEUE_AB.getFullPath());
+ new AutoCreatedQueueTemplate(conf, TEST_QUEUE_AB)
+ .setTemplateEntriesForChild(conf, TEST_QUEUE_ABC.getFullPath());
+
+ Assert.assertEquals("weight is not set well", 6f,
Review Comment:
Nit: "weight is not set well" -> here "weight is not set" would be a bit
more descriptive as here the options are either weight is correctly set because
of the wildcard or is not.
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestAutoCreatedQueueTemplate.java:
##########
@@ -66,6 +66,34 @@ public void testOneLevelWildcardTemplate() {
}
+ @Test
+ public void testTwoLevelWildcardTemplate() {
+ conf.set(getTemplateKey("root.*", "capacity"), "6w");
+ conf.set(getTemplateKey("root.*.*", "capacity"), "5w");
+
+ new AutoCreatedQueueTemplate(conf, TEST_QUEUE_A)
+ .setTemplateEntriesForChild(conf, TEST_QUEUE_AB.getFullPath());
+ new AutoCreatedQueueTemplate(conf, TEST_QUEUE_AB)
+ .setTemplateEntriesForChild(conf, TEST_QUEUE_ABC.getFullPath());
+
+ Assert.assertEquals("weight is not set well", 6f,
+ conf.getNonLabeledQueueWeight(TEST_QUEUE_AB.getFullPath()), 10e-6);
+ Assert.assertEquals("weight is not set well", 5f,
+ conf.getNonLabeledQueueWeight(TEST_QUEUE_ABC.getFullPath()),
10e-6);
+ }
+
+ @Test
+ public void testMultiLevelWildcardTemplateAccuracy() {
+ conf.set(getTemplateKey("root.*.*", "capacity"), "5w");
+ conf.set(getTemplateKey("root.a.*", "capacity"), "6w");
+
+ new AutoCreatedQueueTemplate(conf, TEST_QUEUE_AB)
+ .setTemplateEntriesForChild(conf, TEST_QUEUE_ABC.getFullPath());
+
+ Assert.assertEquals("weight is not set well", 6f,
Review Comment:
Nit: "weight is not set well" -> "weight is incorrectly set" describes the
issue a bit better.
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestAutoCreatedQueueTemplate.java:
##########
@@ -66,6 +66,34 @@ public void testOneLevelWildcardTemplate() {
}
+ @Test
+ public void testTwoLevelWildcardTemplate() {
+ conf.set(getTemplateKey("root.*", "capacity"), "6w");
+ conf.set(getTemplateKey("root.*.*", "capacity"), "5w");
+
+ new AutoCreatedQueueTemplate(conf, TEST_QUEUE_A)
+ .setTemplateEntriesForChild(conf, TEST_QUEUE_AB.getFullPath());
+ new AutoCreatedQueueTemplate(conf, TEST_QUEUE_AB)
+ .setTemplateEntriesForChild(conf, TEST_QUEUE_ABC.getFullPath());
+
+ Assert.assertEquals("weight is not set well", 6f,
+ conf.getNonLabeledQueueWeight(TEST_QUEUE_AB.getFullPath()), 10e-6);
+ Assert.assertEquals("weight is not set well", 5f,
+ conf.getNonLabeledQueueWeight(TEST_QUEUE_ABC.getFullPath()),
10e-6);
+ }
+
+ @Test
+ public void testMultiLevelWildcardTemplateAccuracy() {
+ conf.set(getTemplateKey("root.*.*", "capacity"), "5w");
Review Comment:
Isn't this basically the subset of testTemplatePrecedence below?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]