-
Notifications
You must be signed in to change notification settings - Fork 191
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] Restore support for Java 8 #156
Comments
Almost every action from the |
I recommend moving to https://github.com/opensearch-project/opensearch-java and restoring support for Java 8 there. Moved the issue here to say that. This may be challenging because it uses the low-level opensearch-rest-client. Note that eventually we want to introduce a proper SDK in https://github.com/opensearch-project/opensearch-sdk that can mitigate this and similar differences. |
@reta , @dblock , I'll try to move the discussion in here rather than opensearch-project/OpenSearch#3181. It is reasonable to have OpenSearch on Java 11, but a client on Java 8. Thus, I think OpenSearch should support this, and created this issue for it. Right now:
In the long-term, I think the project should encourage users to use the opensearch-java client. Per this comment, the opensearch-java client will be the one to attempt to support multiple versions. This client can also remain compatible with Java 8. The opensearch-java client could support compiling on Java 8 and running tests on Java 11. The new Gradle toolchains should support this. That will remove the barrier of using the test framework which you pointed out @reta . The opensearch-java client currently relies on the low-level client. There might be a few options here:
|
…ompile and run using JDK 11. Uses OpenSearch low-level client 1.3.2 since this supports Java 8. opensearch-project#156
…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 <dlv@amazon.com> temp Signed-off-by: David Venable <dlv@amazon.com>
…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 <dlv@amazon.com>
I have created a draft PR which restores support for Java 8 in #157. I have also pushed some changes to opensearch-project/OpenSearch#3181 which builds the opensearch-rest-client (low-level) using JDK 8. These two PRs demonstrate a path forward for support JDK 8 for clients (low-level REST client and opensearch-java). |
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 |
I don't understand how that deprecation step blocks movement on creating a working java 8 client. Maybe a special build for java 8 that doesn't impact anything else? I think I'm missing something. |
And a) was attempted in opensearch-project/OpenSearch#3181 that we decided not to merge. Someone (wink wink) could create a branch that does b) in a hurry, but seems like we should do it properly. |
@VachaShah we did that with Apache HttpClient 5 already: the |
I think we should 1) remove the dependency and downgrade JDK in a major version of this client and release 2) maintain the 2.x branch that has HLRC |
Thanks @reta and @dblock! @dblock By remove the dependency, do you mean removing both optional To restore JDK 8 though, I think we need to remove both the dependencies even though rest-client is optional for this client's next major version. @reta LMK if I am missing something here. |
I think test framework may stay since this won't be brought to users (but we would need to build with JDK-11 keeping source/binary JDK-8).
To the previous point, getting rid of dependency on test framework would be just awesome from the decoupling perspective, but if user wants to use rest-client transport, they would need to use JDK-11, pretty messy to be fair. |
Is providing a Java 8 client for OpenSearch 2.x in the plans any more? Meanwhile for those interested of it, I patched it here:
Tests discarded / fail, but the Java client compiled and seems to work so far. The REST client project was integrated from the OpenSearch into the opensearch-java. |
@peerkar If you can make a PR that passes tests into this repo on Java 8, we'd gladly take it! |
i know that i'm a bit late to the party, but: i think adding back support for a language version which was released nearly 10 years ago and superseded 5 years ago is the wrong way to go. there are so many newer language features in java 11 & newer which can help in making both the APIs and the code cleaner & nicer to work with that the trade-off is too big. and others are also moving away from supporting java 8 (as shown e.g. with the issues in #767) and this will just get worse over time. for how long do you plan to support java 8? another 1-2 years (in which case i don't think that it's worth it)? or until 2030 (in which case i don't think that anyone will still want to work with this code base in a few years)? i think the main reason why people are still stuck on java 8 is pure laziness (not even necessarily of the developers but sometimes also of the management which will say "oh, they still support it, so don't waste time on updates"). we shouldn't support that. |
@rursprung not at all, thank you for jumping in
Personally, I would prefer to forget about Java 8 and move on, the sad part is that many projects still claim support for Java 8 even if only some small percent of the users benefit from it. And for these projects the only way to deal with 2.x OpenSearch servers is to use 1.x clients (surely if JDK-11 not the runtime).
1-2 years sound reasonable, the question is obviously - is it worth it? We are listening to the community (even if it takes long time to be heard), but community asks for this option. That is the motivation. |
i think it's a shame that we have to be stuck on such an old language version (and with no CI support as well; i guarantee you that this will break as nobody will test against JDK8 anymore - why would you? you also don't test against Windows XP anymore 😉). since you now merged it: can you please clearly specify the targeted support timeline for JDK8 to know by when you'll drop JDK8 support? will this happen with the next major release? in one year? in two? by 2030? |
I am with you @rursprung. I added #778 to get some integration test working. If you have an idea of the best way to do it, please contribute! I don't have any strong opinion of when to drop JDK8 support. There should be a reason other than "because it's old". I am always amazed how many customers are still using JDK8, it's not easy to upgrade some enterprise applications or they don't want to because it's too expensive. Speaking of Windows 98, I maintain https://github.com/dotnetinstaller/dotnetinstaller which only dropped support for Windows 98 in 2016. I tried to do it around 2012, but found a non-profit in Africa that was relying on the tool supporting Windows 98 and decided it was worth the effort to continue supporting that. |
@rursprung so we have it restored in 3.x and plan to have it restored in 2.x (once 2.12.0 is out), so I believe targeting 4.0 as the target for dropping JDK-8 would be it. |
Backport to 2.x is pending #798 |
What kind of business use case are you trying to solve? What are your requirements?
Many users still need Java 8 for their clients for maximum Java compatibility.
What is the problem? What is preventing you from meeting the requirements?
With the introduction of OpenSearch 2.0.0, the OpenSearch 2.0.0 build has updated to Java 11. This also includes the
opensearch-rest-client
andopensearch-rest-high-level-client
clients.Users of clients who wish to update their client version must now update to Java 11.
Additionally, the opensearch-java client relies on the
opensearch-rest-client
. Per opensearch-project/opensearch-clients#17, this is the client which is meant to have the most compatibility.Here is an example of updating Data Prepper (which currently supports Java 8):
What are you proposing? What do you suggest we do to solve the problem or improve the existing situation?
I propose that the OpenSearch Core's
opensearch-rest-client
andopensearch-rest-high-level-client
projects be made to use Java 8. The Gradle build can setup thesourceCompatibility
andtargetCompatibility
to ensure that it uses only Java 8 language features.An alternative solution would be to remove the dependency that
opensearch-java
has onopensearch-rest-client
.What are your assumptions or prerequisites?
None.
What are remaining open questions?
Can Gradle toolchains or another mechanism help ensure that the client projects do not use any Java 11 APIs?
The text was updated successfully, but these errors were encountered: