hadoop-yetus commented on a change in pull request #1178: YARN-9680 Code 
cleanup in ResourcePluginManager init methods
URL: https://github.com/apache/hadoop/pull/1178#discussion_r309938524
 
 

 ##########
 File path: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/resourceplugin/ResourcePluginManager.java
 ##########
 @@ -70,80 +71,94 @@ public synchronized void initialize(Context context)
     Configuration conf = context.getConf();
     Map<String, ResourcePlugin> pluginMap = new HashMap<>();
 
+    getPlugins(context, pluginMap);
+    initializePluggableDevicePlugins(context, conf, pluginMap);
+
+    configuredPlugins = Collections.unmodifiableMap(pluginMap);
+  }
+
+  private void getPlugins(Context context,
+      Map<String, ResourcePlugin> pluginMap) throws YarnException {
+    Configuration conf = context.getConf();
     String[] plugins = conf.getStrings(YarnConfiguration.NM_RESOURCE_PLUGINS);
+
     if (plugins == null || plugins.length == 0) {
       LOG.info("No Resource plugins found from configuration!");
+      return;
     }
     LOG.info("Found Resource plugins from configuration: "
         + Arrays.toString(plugins));
+    
 
 Review comment:
   whitespace:end of line
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to