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

[PROPOSAL] Modularize/remove/make optional the dependency on opensearch-rest-client #182

Closed
dblock opened this issue Jul 20, 2022 · 7 comments
Labels
enhancement New feature or request v3.0.0 Issues and PRs related to version v3.0.0

Comments

@dblock
Copy link
Member

dblock commented Jul 20, 2022

What are you proposing?

Remove dependency on opensearch-rest-client, or anything else that may be imported from http://github.com/opensearch-project/OpenSearch.

How did you come up with this proposal?

The opensearch-java depends on code exported by the server, which creates a kind of undesirable tight coupling where the client needs to be released with newer versions of the server. Instead, the client should be independent, mostly generated from spec (opensearch-project/opensearch-clients#19), and supporting at least two major versions of the server (opensearch-project/opensearch-clients#17).

We had a similar discussion for AWS components, #177 (comment) and wanted #157 to build with JDK8, but OpenSearch dependences prevented us from doing so.

What is the user experience going to be?

The opensearch-java will become completely independent and live its own life.

Why should it be built? Any reason not to?

I don't see any.

What will it take to execute?

Start by changing this in https://github.com/opensearch-project/opensearch-java/blob/main/java-client/build.gradle.kts.

implementation("org.opensearch.client", "opensearch-rest-client", opensearchVersion)
testImplementation("org.opensearch.test", "framework", opensearchVersion)

What are remaining open questions?

Probably many.

@dblock
Copy link
Member Author

dblock commented Jul 20, 2022

Curious what @reta and @mtimmerm think about this?

@dblock dblock added the enhancement New feature or request label Jul 20, 2022
@dblock dblock changed the title [PROPOSAL] Remove dependency on opensearch-rest-client [PROPOSAL] Modularize/remove/make optional the dependency on opensearch-rest-client Jul 20, 2022
@mtimmerm
Copy link
Contributor

You should probably still provide the capability, which would mean moving the RestClient transport (and probably mine) into separate release packages, because people will want to mix-and-match versions.

I think it's a good idea. The most significant issue I can see is that it requires a major version bump no matter what you do, since the main java client will no longer work by itself in situations where it works currently. That means that your version numbers will no longer correspond to OpenSearch version numbers, which you may or may not consider to be a problem.

@reta
Copy link
Collaborator

reta commented Jul 25, 2022

+1 to move towards client generation from specs, it also would be easier (more straightforward) to catch any backward incompatible changes beforehand.

@dlvenable
Copy link
Member

It appears that this project just needs a new implementation of OpenSearchTransport which does not depend on opensearch-rest-client. An initial implementation could possibly just copy-and-paste the code from that project and abstract it appropriately (package protected).

The opensearch-java project could possibly retain the existing RestClientTransport and make opensearch-rest-client an optional dependency. This could help with migration.

@dblock
Copy link
Member Author

dblock commented Jul 26, 2022

@dlvenable Yes. Also note #177.

@VachaShah
Copy link
Collaborator

I believe this is done for the next major version where RestClientTransport is optional? @reta Please correct me if I am wrong.

@reta
Copy link
Collaborator

reta commented Oct 5, 2023

I believe this is done for the next major version where RestClientTransport is optional? @reta Please correct me if I am wrong.

Correct, thanks @VachaShah !

@reta reta added the v3.0.0 Issues and PRs related to version v3.0.0 label Oct 5, 2023
@reta reta closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v3.0.0 Issues and PRs related to version v3.0.0
Projects
None yet
Development

No branches or pull requests

5 participants