This repository was archived by the owner on Feb 24, 2026. It is now read-only.
feat(common): replace jersey dependencies with OkHttp (Breaking Change)#133
Merged
imbajin merged 32 commits intoapache:masterfrom Nov 22, 2023
Merged
feat(common): replace jersey dependencies with OkHttp (Breaking Change)#133imbajin merged 32 commits intoapache:masterfrom
imbajin merged 32 commits intoapache:masterfrom
Conversation
zhenyuT
commented
Aug 27, 2023
hugegraph-common/src/test/java/org/apache/hugegraph/unit/rest/RestClientTest.java
Show resolved
Hide resolved
zhenyuT
commented
Aug 27, 2023
zhenyuT
commented
Aug 27, 2023
hugegraph-common/src/test/java/org/apache/hugegraph/unit/rest/RestClientTest.java
Outdated
Show resolved
Hide resolved
zhenyuT
commented
Aug 27, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClient.java
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #133 +/- ##
=========================================
Coverage 93.15% 93.15%
Complexity 65 65
=========================================
Files 9 9
Lines 263 263
Branches 22 22
=========================================
Hits 245 245
Misses 8 8
Partials 10 10 ☔ View full report in Codecov by Sentry. |
2 tasks
zhenyuT
commented
Aug 30, 2023
hugegraph-common/src/test/java/org/apache/hugegraph/unit/util/ReflectionUtilTest.java
Show resolved
Hide resolved
zhenyuT
commented
Aug 30, 2023
hugegraph-common/src/test/java/org/apache/hugegraph/unit/rest/RestClientTest.java
Outdated
Show resolved
Hide resolved
javeme
reviewed
Aug 30, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClient.java
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Show resolved
Hide resolved
hugegraph-common/src/test/java/org/apache/hugegraph/unit/util/ReflectionUtilTest.java
Show resolved
Hide resolved
hugegraph-common/src/test/java/org/apache/hugegraph/unit/rest/RestClientTest.java
Outdated
Show resolved
Hide resolved
|
Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label |
javeme
reviewed
Oct 28, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestHeaders.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestHeaders.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestHeaders.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestHeaders.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
javeme
reviewed
Nov 4, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/OkhttpBasicAuthInterceptor.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestResult.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestResult.java
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RequestHeaders.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RequestHeaders.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestResult.java
Outdated
Show resolved
Hide resolved
javeme
reviewed
Nov 5, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestResult.java
Show resolved
Hide resolved
javeme
reviewed
Nov 11, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/OkhttpBasicAuthInterceptor.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/OkHttpConfig.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/OkhttpTokenInterceptor.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/OkhttpTokenInterceptor.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/OkHttpConfig.java
Outdated
Show resolved
Hide resolved
javeme
reviewed
Nov 12, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/test/java/org/apache/hugegraph/unit/rest/RestClientTest.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/HttpHeadersConstant.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java
Outdated
Show resolved
Hide resolved
javeme
reviewed
Nov 18, 2023
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/HttpHeadersConstant.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/HttpHeadersConstant.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java
Outdated
Show resolved
Hide resolved
javeme
reviewed
Nov 21, 2023
| private Integer idleTime = 5; | ||
| private TimeUnit idleTimeUnit = TimeUnit.MINUTES; | ||
| private Integer idleTime = 30; | ||
| private TimeUnit idleTimeUnit = TimeUnit.SECONDS; |
Contributor
There was a problem hiding this comment.
seems don't need to add a var for the unit, prefer to just hardcode it
| return this.headersBuilder.build(); | ||
| } | ||
|
|
||
| public static class HttpHeadersConstant { |
Contributor
There was a problem hiding this comment.
prefer to merge these vars into class RestHeaders
| ConnectionPool connectionPool = new ConnectionPool(config.getMaxIdleConns(), | ||
| config.getIdleTime(), | ||
| TimeUnit.MINUTES); | ||
| config.getIdleTimeUnit()); |
Contributor
There was a problem hiding this comment.
we can just hardcode TimeUnit.SECONDS here
imbajin
approved these changes
Nov 22, 2023
Member
imbajin
left a comment
There was a problem hiding this comment.
thanks a lot for the job, I'll publish it to stage maven repo soon
This was referenced Nov 22, 2023
11 tasks
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
之前在tool-chains提过一个pr,直接修改client的代码将jersey使用okhttp替换
现在尝试直接修改common的代码,不过common的代码中单元测试和jersey是强相关的,在这一块遇到一些问题,然后尝试自己修改单测代码进行跑通。不过由于对单测的代码不太熟悉,对于代码的意图不太了解,麻烦社区同学帮忙看看
Breaking Changes
org.apache.http.HttpStatusis removed now, replace it tojava.net.HttpURLConnection(JDK bundled)jakarta.ws.rs.core.MultivaluedHashMapis removed now, replace it toorg.apache.hugegraph.rest.RestHeadersjakarta.ws.rs.core.Responseis removed now, replace it tookhttp3.Response.org.glassfish.jersey.uri.UriComponentis removed, just not use it. There's no need to encode the query params manual, just remove the codeUriComponent.encode(raw, Type.QUERY_PARAM_SPACE_ENCODED).Other repo/users could refer the info to update/adapt the new version, and comment in this PR if anything missed