YARN-9791. Queue Mutation API does not allow to remove a config. Contributed by Prabhu Joseph.

(cherry picked from commit 751b5a1ac8)
This commit is contained in:
Abhishek Modi 2019-09-01 13:33:09 +05:30 committed by prabhujoseph
parent b04f152876
commit 31591bb296
1 changed files with 5 additions and 3 deletions

View File

@ -337,12 +337,14 @@ public class MutableCSConfigurationProvider implements CSConfigurationProvider,
String keyPrefix = CapacitySchedulerConfiguration.PREFIX String keyPrefix = CapacitySchedulerConfiguration.PREFIX
+ queuePath + CapacitySchedulerConfiguration.DOT; + queuePath + CapacitySchedulerConfiguration.DOT;
for (Map.Entry<String, String> kv : updateInfo.getParams().entrySet()) { for (Map.Entry<String, String> kv : updateInfo.getParams().entrySet()) {
if (kv.getValue() == null) { String keyValue = kv.getValue();
if (keyValue == null || keyValue.isEmpty()) {
keyValue = null;
proposedConf.unset(keyPrefix + kv.getKey()); proposedConf.unset(keyPrefix + kv.getKey());
} else { } else {
proposedConf.set(keyPrefix + kv.getKey(), kv.getValue()); proposedConf.set(keyPrefix + kv.getKey(), keyValue);
} }
confUpdate.put(keyPrefix + kv.getKey(), kv.getValue()); confUpdate.put(keyPrefix + kv.getKey(), keyValue);
} }
} }
} }