pjfanning commented on code in PR #8841:
URL: https://github.com/apache/hadoop/pull/8841#discussion_r4592183028


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java:
##########
@@ -358,20 +355,15 @@ private static InetSocketAddress 
getBindAddress(Configuration conf) {
 
   protected ResourceConfig configure() {
     ResourceConfig config = new ResourceConfig();
-    config.packages("org.apache.hadoop.yarn.server.timeline.webapp");
-    
config.packages("org.apache.hadoop.yarn.server.applicationhistoryservice.webapp");
-    config.packages("org.apache.hadoop.yarn.api.records.writer");
     config.register(TimelineWebServices.class);
     config.register(AHSWebServices.class);
     config.register(TimelineEntitiesWriter.class);
     config.register(TimelineEntitiesReader.class);
-    config.register(TimelineEntityReader.class);
     config.register(TimelineEntityWriter.class);
     config.register(TimelineDomainReader.class);
-    config.register(TimelinePutResponseReader.class);
     config.register(new JerseyBinder());
     config.register(GenericExceptionHandler.class);
-    config.register(new 
JettisonFeature()).register(YarnJacksonJaxbJsonProvider.class);
+    config.register(YarnJacksonJaxbJsonProvider.class);

Review Comment:
   Removing `JettisonFeature` looks like it also changes the JSON shape of 
error responses, not just successful ones. `GenericExceptionHandler` returns 
`RemoteExceptionData`, which is `@XmlRootElement(name = "RemoteException")`. 
Where Jettison wrote the response, a 404/400 from `/ws/v1/applicationhistory` 
or `/ws/v1/timeline` came back as 
`{"RemoteException":{"exception":...,"message":...,"javaClassName":...}}`. With 
Jackson only, it is now the flat 
`{"exception":...,"message":...,"javaClassName":...}`, so a client calling 
`getJSONObject("RemoteException")` would break.
   
   The JSON shape table in the description and the tests only cover successful 
responses. Could you confirm what error bodies looked like before and after, 
add a test for one, and mention it alongside the other shape changes?



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/YarnJacksonJaxbJsonProvider.java:
##########
@@ -45,17 +43,16 @@
 @Private
 public class YarnJacksonJaxbJsonProvider extends JacksonJaxbJsonProvider {
 
-  public YarnJacksonJaxbJsonProvider() {
-    super();
-  }
+  private final ObjectMapper mapper = newMapper();
 
   @Override
   public ObjectMapper locateMapper(Class<?> type, MediaType mediaType) {
-    ObjectMapper mapper = super.locateMapper(type, mediaType);
+    return mapper;

Review Comment:
   Dropping the `WRAP_ROOT_VALUE` special case for `TimelineAbout` also affects 
ATSv2, not just the AHS: `TimelineReaderServer` registers this same provider 
(`TimelineReaderServer.java:260`). So `GET /ws/v2/timeline/` changes from 
`{"about":{"About":...}}` in 3.5.0 to `{"About":...}`.
   
   The new shape matches `TimelineServiceV2.md`, so I think the change is 
right. But a 3.5.0 client that adapted to the wrapped form will now read null 
fields. Could the PR description call out the ATSv2 compatibility change, and 
could the JIRA get a release note? At the moment only the timelineservice test 
reader is updated.



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