You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/07/26 09:02:01 UTC
[GitHub] [hadoop] brumi1024 commented on a diff in pull request #4622: YARN-11063. Support auto queue creation template wildcards for arbitr…
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org