cnauroth commented on code in PR #8215:
URL: https://github.com/apache/hadoop/pull/8215#discussion_r2755582681


##########
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:
   Agreed, we don't need to guard this with the conditional. LGTM after making 
that change.



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