|
26 | 26 | import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigRuleHandler.USER_MAX_APPS_DEFAULT; |
27 | 27 | import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigRuleHandler.USER_MAX_RUNNING_APPS; |
28 | 28 | import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigRuleHandler.RuleAction.ABORT; |
| 29 | +import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigRuleHandler.RuleAction.WARNING; |
29 | 30 | import static org.junit.Assert.assertEquals; |
30 | 31 | import static org.junit.Assert.assertNull; |
31 | 32 | import static org.junit.Assert.assertTrue; |
@@ -372,6 +373,41 @@ public void testConvertFSConfigurationRulesFile() throws Exception { |
372 | 373 | ABORT, actions.get(QUEUE_AUTO_CREATE)); |
373 | 374 | } |
374 | 375 |
|
| 376 | + @Test |
| 377 | + public void testConvertFSConfigurationWithoutRulesFile() throws Exception { |
| 378 | + ruleHandler = new FSConfigToCSConfigRuleHandler( |
| 379 | + createDefaultConversionOptions()); |
| 380 | + createConverter(); |
| 381 | + |
| 382 | + FSConfigToCSConfigConverterParams params = |
| 383 | + createDefaultParamsBuilder() |
| 384 | + .withClusterResource(CLUSTER_RESOURCE_STRING) |
| 385 | + .build(); |
| 386 | + |
| 387 | + converter.convert(params); |
| 388 | + |
| 389 | + ruleHandler = converter.getRuleHandler(); |
| 390 | + Map<String, FSConfigToCSConfigRuleHandler.RuleAction> actions = |
| 391 | + ruleHandler.getActions(); |
| 392 | + |
| 393 | + assertEquals("maxCapacityPercentage", |
| 394 | + WARNING, actions.get(MAX_CAPACITY_PERCENTAGE)); |
| 395 | + assertEquals("maxChildCapacity", |
| 396 | + WARNING, actions.get(MAX_CHILD_CAPACITY)); |
| 397 | + assertEquals("userMaxRunningApps", |
| 398 | + WARNING, actions.get(USER_MAX_RUNNING_APPS)); |
| 399 | + assertEquals("userMaxAppsDefault", |
| 400 | + WARNING, actions.get(USER_MAX_APPS_DEFAULT)); |
| 401 | + assertEquals("dynamicMaxAssign", |
| 402 | + WARNING, actions.get(DYNAMIC_MAX_ASSIGN)); |
| 403 | + assertEquals("specifiedNotFirstRule", |
| 404 | + WARNING, actions.get(SPECIFIED_NOT_FIRST)); |
| 405 | + assertEquals("reservationSystem", |
| 406 | + WARNING, actions.get(RESERVATION_SYSTEM)); |
| 407 | + assertEquals("queueAutoCreate", |
| 408 | + WARNING, actions.get(QUEUE_AUTO_CREATE)); |
| 409 | + } |
| 410 | + |
375 | 411 | @Test |
376 | 412 | public void testConvertFSConfigurationUndefinedYarnSiteConfig() |
377 | 413 | throws Exception { |
|
0 commit comments