Skip to content
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

Merged
merged 8 commits into from
Dec 24, 2019
Merged

Add remote info to the HLRC #49657

merged 8 commits into from
Dec 24, 2019

Conversation

AntonShuvaev
Copy link
Contributor

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

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Java High Level REST Client)

@hub-cap
Copy link
Contributor

hub-cap commented Dec 3, 2019

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
https://github.com/elastic/elasticsearch/blob/master/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractRequestTestCase.java

@martijnvg
Copy link
Member

@J-Bean Thanks for adding this api to the HLRC! Can you copy the RemoteInfoRequest and RemoteInfoResponse to the hlrc module for the reasons @hub-cap mentioned? You can also remove any thing from these copies that the hlrc doesn't need (for example extending from ActionRequest and ActionResponse). Besides this this PR looks great!

@AntonShuvaev
Copy link
Contributor Author

@martijnvg Sure, I'll fix all comments ASAP.

# Conflicts:
#	server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java
@AntonShuvaev
Copy link
Contributor Author

@martijnvg I fixed all issues and updated the PR.

Copy link
Member

@martijnvg martijnvg left a 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.

# 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
@AntonShuvaev
Copy link
Contributor Author

Made changes as per review comments.

Copy link
Member

@martijnvg martijnvg left a 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) {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I missed that.

@martijnvg
Copy link
Member

@elasticmachine test this please

@martijnvg
Copy link
Member

@elasticmachine test this please

@martijnvg
Copy link
Member

@J-Bean Thank you for your contribution. I will backport this now to the 7.x branch.

martijnvg added a commit that referenced this pull request Dec 24, 2019
martijnvg added a commit that referenced this pull request Dec 24, 2019
@martijnvg
Copy link
Member

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

martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Dec 24, 2019
martijnvg added a commit that referenced this pull request Dec 24, 2019
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
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Dec 24, 2019
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>
@AntonShuvaev AntonShuvaev deleted the hlrc_remote_info branch December 24, 2019 13:28
martijnvg added a commit that referenced this pull request Dec 24, 2019
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>
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants