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

[DRAFT] Build this project and unit test using JDK 8. #157

Closed
wants to merge 1 commit into from

Conversation

dlvenable
Copy link
Member

Description

This PR shows initial work to support JDK 8 for this client, which will allow Java 8 applications to continue to use OpenSearch 2 and beyond.

This is a draft for a few reasons:

  • Continue the discussion of supporting JDK 8
  • It continues to use the opensearch-rest-client 1.3.2. See Support Java 8 for opensearch-rest-client OpenSearch#3181
  • There is an issue where the Gradle module for opensearch-rest-client, event with Java 8, reports it is Java 11. I'll look further into this if we get general agreement on the approach.

Issues Resolved

This draft demonstrates a possible solution for #156.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…ompile and run using JDK 11. Uses OpenSearch low-level client 1.3.2 since this supports Java 8. opensearch-project#156

Signed-off-by: David Venable <[email protected]>
@dblock
Copy link
Member

dblock commented May 10, 2022

Add JDK8 CI as part of this PR please.

@reta WDYT?

@reta
Copy link
Collaborator

reta commented May 10, 2022

@dblock I feel uneasy about this change: I have not seen any strong argument from the community that JDk-8 is needed at all, taking into account that large number of projects have switched to at least JDK-11, if not JDK-17.

implementation("org.opensearch.client", "opensearch-rest-client", opensearchVersion)
testImplementation("org.opensearch.test", "framework", opensearchVersion)
implementation("org.opensearch.client", "opensearch-rest-client", "1.3.2")
integrationTestImplementation("org.opensearch.test", "framework", opensearchVersion)
Copy link
Collaborator

@reta reta May 10, 2022

Choose a reason for hiding this comment

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

If anything, we should not take this path: opensearch-rest-client of one version, framework of another version, just my opinion. The clean solution would be to have: a) concise Opensearch version b) clean build under 8 and 11 toolchains.

Copy link
Member Author

Choose a reason for hiding this comment

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

@reta , I mentioned the 1.3.2 problem in the PR description. And I fully agree that this is not the right approach - it is temporary to have a working build. I aim to be able to remove with opensearch-project/OpenSearch#3181. But, without that merged in, this would not work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, thanks @dlvenable , I still don't understand how it is supposed to work with framework (the opensearch-rest-client will be fine): the JDK-8 toolchain will fail trying to use JDK-11 bytecode.

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR builds and runs unit tests against JDK 8. It runs the integration tests using JDK 11 to support the framework library.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Uh ... thanks @dlvenable , @dblock supporting this JDK-8/JDK-11 "split brain" across project would be quite tricky, we need a really compelling reason to go with this change (#156 has no evidence it is really needed, @dlvenable please correct me if I am wrong).

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, I do think this is a mess, and OpenSearch is exposing this mess to Java clients. I'd like to break that somehow.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

The low-level REST client provides very little value to this library. I suggest you just git rid of it and use its underlying HTTP transport instead. One less dependency to worry about.

Copy link
Member

Choose a reason for hiding this comment

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

I agree. Maybe you want to take a stab at that @mtimmerm? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe. I'll look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants