[ https://issues.apache.org/jira/browse/YARN-11786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17932459#comment-17932459 ]
ASF GitHub Bot commented on YARN-11786: --------------------------------------- slfan1989 commented on code in PR #7453: URL: https://github.com/apache/hadoop/pull/7453#discussion_r1980328964 ########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/AbstractTimelineReaderHBaseTestBase.java: ########## @@ -109,19 +106,25 @@ protected void addFilters(Configuration conf) { } protected Client createClient() { - ClientConfig cfg = new DefaultClientConfig(); - cfg.getClasses().add(YarnJacksonJaxbJsonProvider.class); - return new Client( - new URLConnectionClientHandler(new DummyURLConnectionFactory()), cfg); + final ClientConfig cc = new ClientConfig(); + cc.connectorProvider(getHttpURLConnectionFactory()); + return ClientBuilder.newClient(cc) + .register(TimelineEntityReader.class) Review Comment: This is a good question. I believe we need to update some parts of the code to align with Jersey 2's standards, as certain parts of the code are not well-supported by the latest standards. I first became aware of the issue with Jersey during the release of Hadoop 3.4.0, when aajisaka mentioned that, with Hadoop supporting JDK 11, there was an area that needed optimization — Jersey support. For more details, you can refer to HADOOP-15984 (updating Jersey from 1.19 to 2.x). Jersey is a framework that supports RESTful WebService. When upgrading from version 1.x to 2.x, compatibility issues arise because these two versions are completely incompatible, with even basic methods being different. To address this, we define custom readers because Jersey 2.x only supports automatic JSON conversion for basic data types and does not support automatic conversion for more complex types. More details can be found in the [official documentation](https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/message-body-workers.html#d0e6976). While writing these readers, I used `com.fasterxml.jackson.databind.ObjectMapper` to implement automatic conversion between objects and JSON. However, ObjectMapper cannot handle null pointer exceptions, which leads to the first question — the need to assign initial values to certain variables. After upgrading to JUnit 5, we will configure a new JDK 17 CI pipeline. Following that, I will begin the deeper adaptation and upgrade of Jersey 2. > Upgrade hadoop-yarn-server-timelineservice-hbase-tests to Support Trunk > Compilation and Remove compatible hadoop version. > ------------------------------------------------------------------------------------------------------------------------- > > Key: YARN-11786 > URL: https://issues.apache.org/jira/browse/YARN-11786 > Project: Hadoop YARN > Issue Type: Improvement > Components: timelineservice > Affects Versions: 3.5.0 > Reporter: Shilun Fan > Assignee: Shilun Fan > Priority: Major > Labels: pull-request-available > > The {{hadoop-yarn-server-timelineservice-hbase-tests}} module is currently > using the compatible Hadoop version 3.3.6, which causes the following issues: > # We are unable to upgrade the Jersey version because we made necessary > improvements on the trunk branch, but these changes have not been > synchronized to the Hadoop-3.3.6 branch. > # We cannot upgrade the JUnit version because part of the module's code > depends on the trunk branch, while another part depends on Hadoop-3.3.6. > In this JIRA, we will attempt to make the > {{hadoop-yarn-server-timelineservice-hbase-tests}} module successfully > compile and run unit tests on the trunk branch, while removing support for > the compatible Hadoop version. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org