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
Make Pinot JDK 11 Compilable #6424
Conversation
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginClassLoader.java
Outdated
Show resolved
Hide resolved
delete this gc.log.*? |
What are we trying to achieve here? Should we provide multiple docker files for different java versions? |
f319079
to
7814776
Compare
It seems that java11+ should be used. Let me know if there is any usecase where java10 should be added back (I removed java 1.8 and 10 from the versions to be tested). |
9d5c69b
to
01ddd82
Compare
Codecov Report
@@ Coverage Diff @@
## master #6424 +/- ##
============================================
+ Coverage 73.38% 73.62% +0.23%
- Complexity 12 91 +79
============================================
Files 1453 1476 +23
Lines 72032 72680 +648
Branches 10427 10449 +22
============================================
+ Hits 52863 53508 +645
- Misses 15643 15712 +69
+ Partials 3526 3460 -66
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I think it's ok to bypass JDK 9 and 10. |
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.
+100 for this change!
Can you also try to remove this |
The application classloader does not extend URLClassLoader in java9+. See https://community.oracle.com/tech/developers/discussion/4011800/base-classloader-no-longer-from-urlclassloader. By invoking addURL directly, if the class is not found in the delegate classLoader it will be found via findClass().
Add _complexFieldSpecs to equals and hashCode. Update MetadataEqualsHashCodeTest to ignore _virtualColumnProvider in equality/hashcode tests.
IOException is no longer a checked exception of ZkClient.readData. ZkClient.readData throws an unchecked ZkNoNodeException which extends RuntimeException.
The test works locally but in ci it fails sporadically.
This test passes locally but fails sporadically in ci.
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.
Do we want to consider running one test suite with java 8 and another one with java 11 to ensure both work as expected?
...-clients/pinot-java-client/src/test/java/org/apache/pinot/client/ExternalViewReaderTest.java
Show resolved
Hide resolved
@@ -105,6 +105,7 @@ public void testBytes() { | |||
@Test | |||
public void testTimestamp() { | |||
Timestamp timestamp = Timestamp.valueOf(LocalDateTime.now()); | |||
timestamp.setNanos(0); |
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.
Is this related?
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.
yes, java11 uses nano by default, Pinot converter doesn't keep the nano part.
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.
In that case, maybe cleaner if directly initialize with millis
timestamp.setNanos(0); | |
Timestamp timestamp = new Timestamp(System.currentTimeMillis()); |
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginClassLoader.java
Outdated
Show resolved
Hide resolved
for (URL url : urls) { | ||
try { | ||
method.invoke(classLoader, url); | ||
/** | ||
* ClassLoader in java9+ does not extend URLClassLoader. |
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.
Don't quite understand the comment here. Do you mean URLClassLoader
does not extend ClassLoader
in java 9? But it should still have the method addURL()
right?
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.
URLClassLoader
still extend ClassLoader
and this addURL
method is there.
Actually, this part also works for java 8.
@kishoreg @elonazoulay thoughts?
@@ -105,6 +105,7 @@ public void testBytes() { | |||
@Test | |||
public void testTimestamp() { | |||
Timestamp timestamp = Timestamp.valueOf(LocalDateTime.now()); | |||
timestamp.setNanos(0); |
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.
In that case, maybe cleaner if directly initialize with millis
timestamp.setNanos(0); | |
Timestamp timestamp = new Timestamp(System.currentTimeMillis()); |
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.
LGTM. My only concern is how do we ensure the tests can pass in java 8? We still want to keep java 8 supported
We want to keep java 8 support, so we keep the quickstart test for java 8, but no unit tests or integration tests. Also, this setup blocks using the code feature of java 11. |
If we use the code feature of java 11, we can no longer support compiling in java 8 right? |
@Jackie-Jiang @xiangfu0 As Jackie pointed out, we cannot compile the code with Java 8 once we start to use java 11 features. Let's announce that we will officially deprecate the java 8 support from |
@chenboat the most recently released version is |
Discussed with @mcvsubbu @siddharthteotia @jackjlli offline, we will keep the JDK 8 support longer for LinkedIn to test and validate their deployment and data ingestion workflow. The concrete date of dropping support for JDK8 is still TBD. @snleee |
* Fix PluginClassLoader when using JRE9+ The application classloader does not extend URLClassLoader in java9+. See https://community.oracle.com/tech/developers/discussion/4011800/base-classloader-no-longer-from-urlclassloader. By invoking addURL directly, if the class is not found in the delegate classLoader it will be found via findClass(). * Fix Schema.equals Add _complexFieldSpecs to equals and hashCode. Update MetadataEqualsHashCodeTest to ignore _virtualColumnProvider in equality/hashcode tests. * Fix ExternalViewReaderTest IOException is no longer a checked exception of ZkClient.readData. ZkClient.readData throws an unchecked ZkNoNodeException which extends RuntimeException. * Update maven compiler to use java11 * Remove internal jdk apis from appAssemblerScriptTemplate * use different jdk.version in quickstart * Make SegmentDeletionManagerTest single threaded The test works locally but in ci it fails sporadically. * Increase wait for scheduled tasks in BasicAuthRealtimeIntegrationTest This test passes locally but fails sporadically in ci. * fixup! Fix Schema.equals * fixing tests Co-authored-by: Xiang Fu <xiangfu.1024@gmail.com>
Description
As part of effort to upgrade Pinot to use JAVA 11(#6689), this PR will:
This involves updating dependencies, tests and minor modifications to some classes:
equality methods for Schema and ColumnMetadata.
-Djdk.version=8
Upgrade Notes
Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
backward-incompat
, and complete the section below on Release Notes)Does this PR fix a zero-downtime upgrade introduced earlier?
backward-incompat
, and complete the section below on Release Notes)Does this PR otherwise need attention when creating release notes? Things to consider:
release-notes
and complete the section on Release Notes)Release Notes
Upgrade to Java 11 and drop support for Java 8
If you have tagged this as either backward-incompat or release-notes,
you MUST add text here that you would like to see appear in release notes of the
next release.
If you have a series of commits adding or enabling a feature, then
add this section only in final commit that marks the feature completed.
Refer to earlier release notes to see examples of text
Documentation
If you have introduced a new feature or configuration, please add it to the documentation as well.
See https://docs.pinot.apache.org/developers/developers-and-contributors/update-document