-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add remote info to the HLRC #49657
Add remote info to the HLRC #49657
Conversation
Pinging @elastic/es-core-features (:Core/Features/Java High Level REST Client) |
great work so far. Lets go one step further with it tho and copy out the request/response from server, and put it into the HLRC's module, so that we dont have to use/modify the server side code. This will all be generated one day so we want to keep any changes away from server. While it might be a bit tedious now, its something our team is working on doing (code generation, eventually). This will require you writing some new tests (you can look at some of the other PRs that have been recently merged) for the request and response. The request is generally easy, and teh response is more work. Below are the tests you can inherit from and use as examples. https://github.com/elastic/elasticsearch/blob/master/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java |
@J-Bean Thanks for adding this api to the HLRC! Can you copy the |
@martijnvg Sure, I'll fix all comments ASAP. |
# Conflicts: # server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java
@martijnvg I fixed all issues and updated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @J-Bean. I left another comment.
client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java
Outdated
Show resolved
Hide resolved
# Conflicts: # client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java # client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CCRDocumentationIT.java # server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java
Made changes as per review comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this pr! I left 2 small comments.
@@ -39,7 +39,7 @@ | |||
infos = in.readList(RemoteConnectionInfo::new); | |||
} | |||
|
|||
RemoteInfoResponse(Collection<RemoteConnectionInfo> infos) { | |||
public RemoteInfoResponse(Collection<RemoteConnectionInfo> infos) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all changes to the server gradle module can be undone now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in RemoteInfoResponseTests
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I missed that.
.../rest-high-level/src/test/java/org/elasticsearch/client/cluster/RemoteInfoResponseTests.java
Show resolved
Hide resolved
@elasticmachine test this please |
@elasticmachine test this please |
@J-Bean Thank you for your contribution. I will backport this now to the 7.x branch. |
This reverts commit fa1a7c5.
This reverts commit fa1a7c5.
@J-Bean I had to revert this PR due to a test failure. I will open a new pr that adds re-adds this API. |
This reverts commit b7ac732.
Unreverts the commit that added the remote info api to HLRC (#49657). The additional change to the original PR, is that `org.elasticsearch.client.cluster.RemoteConnectionInfo` now parses the initial_connect_timeout field as a string instead of a TimeValue instance. The reason that this is needed is because that the initial_connect_timeout field in the remote connection api is serialized for human consumption, but not for parsing purposes. Therefore the HLRC can't parse it correctly (which caused test failures in CI, but not in the PR CI :( ). The way this field is serialized needs to be changed in the remote connection api, but that is a breaking change. We should wait making this change until rest api versioning is introduced. Co-Authored-By: j-bean anton.shuvaev91@gmail.com
The additional change to the original PR (elastic#49657), is that `org.elasticsearch.client.cluster.RemoteConnectionInfo` now parses the initial_connect_timeout field as a string instead of a TimeValue instance. The reason that this is needed is because that the initial_connect_timeout field in the remote connection api is serialized for human consumption, but not for parsing purposes. Therefore the HLRC can't parse it correctly (which caused test failures in CI, but not in the PR CI :( ). The way this field is serialized needs to be changed in the remote connection api, but that is a breaking change. We should wait making this change until rest api versioning is introduced. Co-Authored-By: j-bean <anton.shuvaev91@gmail.com>
The additional change to the original PR (#49657), is that `org.elasticsearch.client.cluster.RemoteConnectionInfo` now parses the initial_connect_timeout field as a string instead of a TimeValue instance. The reason that this is needed is because that the initial_connect_timeout field in the remote connection api is serialized for human consumption, but not for parsing purposes. Therefore the HLRC can't parse it correctly (which caused test failures in CI, but not in the PR CI :( ). The way this field is serialized needs to be changed in the remote connection api, but that is a breaking change. We should wait making this change until rest api versioning is introduced. Co-Authored-By: j-bean <anton.shuvaev91@gmail.com> Co-authored-by: j-bean <anton.shuvaev91@gmail.com>
This reverts commit fa1a7c5.
Unreverts the commit that added the remote info api to HLRC (elastic#49657). The additional change to the original PR, is that `org.elasticsearch.client.cluster.RemoteConnectionInfo` now parses the initial_connect_timeout field as a string instead of a TimeValue instance. The reason that this is needed is because that the initial_connect_timeout field in the remote connection api is serialized for human consumption, but not for parsing purposes. Therefore the HLRC can't parse it correctly (which caused test failures in CI, but not in the PR CI :( ). The way this field is serialized needs to be changed in the remote connection api, but that is a breaking change. We should wait making this change until rest api versioning is introduced. Co-Authored-By: j-bean anton.shuvaev91@gmail.com
The remote info call is a rest only API call, but should still be added
to the rest client. This PR adds it as well as relevant tests.
Ref #47678