-
Notifications
You must be signed in to change notification settings - Fork 1.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
Support Java 8 for opensearch-rest-client #3181
Support Java 8 for opensearch-rest-client #3181
Conversation
…t to Java 8. This project uses a client test library which is now also supporting Java 8. Signed-off-by: David Venable <[email protected]>
ef81f58
to
ad6bd4a
Compare
✅ Gradle Check success ef81f58269e74cc18d7bb465ebf467e49252284f |
@dlvenable I don't think we should go forward with this change:
|
I agree with @reta. But if we decided to do this, for starters, we would need to also re-add Java 8 CI but only run tests for this part of the project on JDK8. What's the pull for that? |
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.
Let's leave this open for now until we have a path forward for clients that run on JDK8. Thanks for your help @dlvenable.
Signed-off-by: David Venable <[email protected]>
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 am not against this.
Try adding a JDK8 CI part of this? Without it we have no hope of ever preserving future compatibility.
@@ -57,7 +68,7 @@ dependencies { | |||
} | |||
|
|||
tasks.withType(CheckForbiddenApis).configureEach { | |||
//client does not depend on server, so only jdk and http signatures should be checked | |||
//client does not depend on shamcreerver, so only jdk and http signatures should be checked |
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.
bulk replace at work? :)
Any thoughts on the next steps on this? If someone's client has to be Java 8, what's the recommendation for them? Here's an example of someone who is stuck due to the java 11 requirement for opensearch-java: https://forum.opensearch.org/t/opensearch-1-3-x-gradle-build-problem-w-java-8/12400 |
@wbeckler I think, what we could here is:
@dblock @dlvenable what do you think folks? |
Is there a need to move this back to JDK 8? It seems work in opensearch-java can provide users with an option of using JDK 8. Of course, this does mean that users would need to use opensearch-java instead of rest-client.
If users are still blocked on JDK 8, then I think we should do this. The recent changes will allow opensearch-java to decouple from OpenSearch core and have its own JDK versions based on user needs. |
That's the question :D The consensus is that
Yes and no, we still have to support |
@reta Is there anyway to accelerate this decoupling? I know it's gross but could we copy the |
Hm ... let see, if we copy, we have to preserve the same packaging (so people won't see the difference) - this part is fine. But if there is an old
Oh, |
@reta Ah, got it, I think I'm up to speed now :)
If we do this, and then let's say |
Yes, we need to make sure that |
This can be considered a breaking change. I believe the last release of opensearch-java was 2.2.0 so there is still a 3.0.0 available. We can give clear guidance on how to remove the transitive dependency on the old rest-client as part of the instructions. Alternatively, we could use a different Java package name from the original. This would require that customers update all of their package names in their code. But, it would probably be safer. This is a hard change to be making, but I believe that this decoupling will be great for users! |
Is it feasible to remove the OpenSearch core dependency and |
@andrross the plan for deprecation + gradual removal is here opensearch-project/opensearch-java#326 |
I haven't heard anything from any new users about needing JDK8, has anyone? Decoupling brings a lot of other benefits. I propose we close this PR without merging and focus on opensearch-java decoupling (and restoring JDK8 support there with new code). |
To answer @dblock's question, we recently heard a need on the forum for Java 8: https://forum.opensearch.org/t/opensearch-1-3-x-gradle-build-problem-w-java-8/12400/5 The big need for this comes from the opensearch-hadoop situation. Today elasticsearch-hadoop is Java 8 compatible. If we want to integrate opensearch-java into opensearch-hadoop to reduce the overall java surface area, today it would be a breaking change in an environment with lots of legacy Java 8 stuff in the Hadoop and Spark applications that would consume the opensearch-hadoop client. |
Somewhat related story is on Apache Flink side apache/flink-connector-opensearch#4 |
This PR is stalled because it has been open for 30 days with no activity. Remove stalled label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Description
This PR sets the source and target compatibility to Java 8 for the
opensearch-rest-client
. Additionally, it sets the client-test project to use Java 8 sinceopensearch-rest-client
depends on it.This should ensure that only Java 8 language features compile for these projects. However, it cannot verify that only Java 8 APIs are in use. I believe OpenSearch would need to use Gradle toolkits and run on a machine with both Java 11 and Java 8 for this.
Issues Resolved
This addresses:
opensearch-project/opensearch-java#156
Verification
opensearch-rest-client
:Check List
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.