Addendum to YARN-9730. Support forcing configured partitions to be exclusive based on app node label

This commit is contained in:
Jonathan Hung 2019-09-25 17:48:40 -07:00
parent f647185905
commit 606e341c1a
1 changed files with 6 additions and 2 deletions

View File

@ -683,9 +683,13 @@ public class RMContextImpl implements RMContext {
} }
public Set<String> getExclusiveEnforcedPartitions() { public Set<String> getExclusiveEnforcedPartitions() {
String[] configuredPartitions = getYarnConfiguration().getStrings(
YarnConfiguration.EXCLUSIVE_ENFORCED_PARTITIONS);
Set<String> exclusiveEnforcedPartitions = new HashSet<>(); Set<String> exclusiveEnforcedPartitions = new HashSet<>();
Configuration conf = getYarnConfiguration();
if (conf == null) {
return new HashSet<>();
}
String[] configuredPartitions = conf.getStrings(
YarnConfiguration.EXCLUSIVE_ENFORCED_PARTITIONS);
if (configuredPartitions != null) { if (configuredPartitions != null) {
for (String partition : configuredPartitions) { for (String partition : configuredPartitions) {
exclusiveEnforcedPartitions.add(partition); exclusiveEnforcedPartitions.add(partition);