Hean-Chhinling commented on code in PR #8215:
URL: https://github.com/apache/hadoop/pull/8215#discussion_r2753554311


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebApp.java:
##########
@@ -54,15 +54,21 @@ public RMWebApp(ResourceManager rm) {
     this.rm = rm;
   }
 
-  public ResourceConfig resourceConfig() {
-    ResourceConfig config = new ResourceConfig();
-    config.packages("org.apache.hadoop.yarn.server.resourcemanager.webapp");
-    config.register(new JerseyBinder());
-    config.register(RMWebServices.class);
-    config.register(GenericExceptionHandler.class);
-    config.register(JsonProviderFeature.class);
-    config.register(JAXBContextResolver.class);
-    return config;
+  public ResourceConfig resourceConfig(Configuration config) {
+    ResourceConfig resourceConfig = new ResourceConfig();
+    resourceConfig.register(new JerseyBinder());
+
+    Class webService = 
config.getClass(YarnConfiguration.YARN_WEBAPP_CUSTOM_WEBSERVICE_CLASS,
+        RMWebServices.class);
+    resourceConfig.register(webService);
+    if (LOG.isDebugEnabled()) {

Review Comment:
   Is the debug log by default will run when the log level set to DEBUG (like 
[here](https://github.com/apache/hadoop/blob/f79bca8369de55c57c672b833709a3e15fafdd40/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractLeafQueue.java#L822))?
   I think the LOG.isDebugEnabled() is used when it is needed to run more code 
there.
   E.g. 
https://github.com/apache/hadoop/blob/f79bca8369de55c57c672b833709a3e15fafdd40/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java#L831
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to