Sfoglia il codice sorgente

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

(cherry picked from commit d86a1acc866cbda845fb3896dc824baf12217383)
(cherry picked from commit f4f210d2e57e49999579efb7db039cc623798267)
Jonathan Hung 5 anni fa
parent
commit
95ec7050b5

+ 6 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java

@@ -625,9 +625,13 @@ public class RMContextImpl implements RMContext {
   // Note: Read java doc before adding any services over here.
 
   public Set<String> getExclusiveEnforcedPartitions() {
-    String[] configuredPartitions = getYarnConfiguration().getStrings(
-        YarnConfiguration.EXCLUSIVE_ENFORCED_PARTITIONS);
     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) {
       for (String partition : configuredPartitions) {
         exclusiveEnforcedPartitions.add(partition);