From 9bf2ac07bb8451e5b7ee5aa84d3afcb7b9e8b312 Mon Sep 17 00:00:00 2001 From: Szilard Nemeth Date: Tue, 2 Feb 2021 09:13:46 +0100 Subject: [PATCH] YARN-10605. Add queue-mappings-override.enable property in FS2CS conversions. Contributed by Andras Gyori --- .../scheduler/fair/converter/FSConfigToCSConfigConverter.java | 1 + .../fair/converter/TestFSConfigToCSConfigConverter.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/FSConfigToCSConfigConverter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/FSConfigToCSConfigConverter.java index 7a0b711b24..a7602343db 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/FSConfigToCSConfigConverter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/FSConfigToCSConfigConverter.java @@ -339,6 +339,7 @@ private void performRuleConversion(FairScheduler fs) capacitySchedulerConfig.set(MAPPING_RULE_FORMAT, MAPPING_RULE_FORMAT_JSON); + capacitySchedulerConfig.setOverrideWithQueueMappings(true); if (!rulesToFile) { String json = ((ByteArrayOutputStream)mappingRulesOutputStream) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/TestFSConfigToCSConfigConverter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/TestFSConfigToCSConfigConverter.java index 6375fe9995..5450d409bd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/TestFSConfigToCSConfigConverter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/TestFSConfigToCSConfigConverter.java @@ -668,6 +668,8 @@ public void testPlacementRulesConversionEnabled() throws Exception { any(FSConfigToCSConfigRuleHandler.class), any(CapacitySchedulerConfiguration.class), anyBoolean()); + assertTrue(converter.getCapacitySchedulerConfig().getBoolean( + CapacitySchedulerConfiguration.ENABLE_QUEUE_MAPPING_OVERRIDE, false)); } @Test