Upgrade minimum JDK to 17 and migrate JavaX to Jakarta#17859
Conversation
09cc234 to
ba97eb7
Compare
76b6645 to
6bc0035
Compare
|
I think this PR needs to regenerate dependencies.json after the REST/Jakarta dependency changes. dependencies.json is used by -Penable-sbom-check via src/main/groovy/checkDependencies.groovy, and the new
Because the check fails on any dependency added by the current build but missing from dependencies.json, release/SBOM validation can fail even if normal compilation passes. Please regenerate dependencies.json from the transformed SBOM and re-check LICENSE-binary for the newly bundled REST/Jakarta dependencies as well. |
6bc0035 to
c7b9bf3
Compare
c7b9bf3 to
ca3df0a
Compare
323a1b1 to
f80618e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17859 +/- ##
============================================
+ Coverage 40.68% 40.82% +0.14%
+ Complexity 2620 318 -2302
============================================
Files 5244 5245 +1
Lines 362374 362908 +534
Branches 46653 46760 +107
============================================
+ Hits 147419 148172 +753
+ Misses 214955 214736 -219 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CritasWang
left a comment
There was a problem hiding this comment.
This PR is described as a JDK 17 + JavaX→Jakarta migration, but it also carries a functional behavior change to TsFile time-column decoding that is unrelated to the migration:
- iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/AlignedSinglePageWholeChunkReader.java:184
defaultTimeDecoder → getTimeDecoder(timeChunkHeader.getEncodingType()) - iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/SinglePageWholeChunkReader.java:90
defaultTimeDecoder → getConfiguredTimeDecoder()
Both getTimeDecoder(...) and getConfiguredTimeDecoder() are new APIs that do not exist in the current IoTDB tree — they come from the upgraded TsFile parent class (AbstractChunkReader), which is why this change is coupled to the TsFile version bump in pom.xml:
- <tsfile.version>2.3.x-SNAPSHOT</tsfile.version>
- <tsfile.version>2.3.2-260608-SNAPSHOT</tsfile.version>
This looks like a genuine fix (the time decoder was previously hard-coded to the default instead of honoring the actual chunk encoding type), but it has real runtime behavior implications for the pipe TsFile-parsing path and deserves its own review, commit message, and test coverage rather than being hidden inside a 262-file migration diff.
Request: please either
- if it must stay, call it out explicitly in the PR description and add/point to tests that exercise the changed decoding path.
|
Thanks @CritasWang, good catch. You are right that this is not a pure namespace migration change. This adaptation is required by the TsFile snapshot bump that is part of the JDK 17 upgrade path: without updating these call sites to the decoder accessors exposed by the upgraded TsFile reader APIs, this branch cannot compile/pass CI after the TsFile upgrade. Splitting it out into a standalone PR would also be difficult because that standalone change depends on the same TsFile/JDK17 upgrade context. I have updated the PR description to call this out explicitly. I will keep this change in this PR, but will make sure it is reviewed as a behavior-sensitive TsFile parsing adaptation and add/point to dedicated coverage for the affected time-decoding path. |
There was a problem hiding this comment.
Pull request overview
This PR raises Apache IoTDB’s minimum runtime/build JDK baseline to Java 17 and migrates REST/OpenAPI and Jakarta EE runtime-facing APIs from javax.* to jakarta.*, including upgrading key dependencies (Jetty/Jersey/Swagger/OpenAPI generator/Jackson Jakarta providers). It also updates startup/health-check scripts and CI to enforce/assume JDK 17, and includes a TsFile snapshot bump that adjusts pipe TsFile page readers to newer decoder APIs.
Changes:
- Enforce JDK 17 across build tooling (Maven compiler/enforcer), CI (GitHub Actions/Jenkins), docs, and startup scripts.
- Migrate REST service + OpenAPI-generated surface to Jakarta (Jetty EE10, Jersey 3, Swagger Jakarta artifacts, Jackson Jakarta RS provider).
- Update TsFile snapshot and adapt pipe TsFile page reader construction to updated decoder accessors.
Reviewed changes
Copilot reviewed 76 out of 76 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/tools/windows/ops/health_check.bat | Updates displayed minimum JDK requirement to 17. |
| scripts/tools/ops/health_check.sh | Updates displayed minimum JDK requirement to 17. |
| scripts/sbin/windows/start-datanode.bat | Enforces JDK 17+ on Windows DataNode startup. |
| scripts/sbin/windows/start-confignode.bat | Enforces JDK 17+ on Windows ConfigNode startup. |
| scripts/sbin/start-cli.sh | Enforces Java 17+ for CLI and adjusts add-opens handling. |
| scripts/conf/datanode-env.sh | Enforces Java 17+ and simplifies GC logging/add-opens setup. |
| scripts/conf/confignode-env.sh | Enforces Java 17+ and simplifies GC logging/add-opens setup. |
| README.md | Updates Java badge and minimum Java requirement to 17. |
| README_ZH.md | Updates Java badge and minimum Java requirement to 17 (Chinese README). |
| pom.xml | Raises compiler/enforcer baseline to 17; upgrades Jakarta/Jetty/Jersey/Swagger/OpenAPI/ANTLR/etc; adjusts import order; updates Thrift generator args. |
| LICENSE-binary | Updates bundled dependency versions to match upgraded stack (Jetty/ANTLR/Logback/Jakarta APIs). |
| library-udf/pom.xml | Raises UDF module compiler level to 17. |
| Jenkinsfile | Switches Jenkins toolchain from JDK 11 to JDK 17. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/schedule/CompactionWorker.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/mnode/container/CachedMNodeContainer.java | Migrates validation annotations import to jakarta.validation while keeping JSR-305 annotations. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/mnode/container/MemMNodeContainer.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/logfile/SchemaLogReader.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/logfile/FakeCRC32Deserializer.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/PipeEnriched.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/metadata/read/TimeSeriesSchemaScanNode.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/metadata/read/TimeSeriesCountNode.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/metadata/read/LevelTimeSeriesCountNode.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/DataNodeTableOperatorGenerator.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/expression/unary/InExpression.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/ConfigExecution.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/schedule/task/DriverTaskId.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeDynamicMemoryBlock.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/SinglePageWholeChunkReader.java | Adapts TsFile page reader construction to updated time-decoder accessor. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/AlignedSinglePageWholeChunkReader.java | Adapts aligned page reader to updated time-decoder accessor. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/PipeInsertionEvent.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/audit/DNAuditLogger.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/datanode/pom.xml | Raises DataNode module compiler plugin level to 17. |
| iotdb-core/consensus/pom.xml | Raises consensus module compiler level to 17. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/mnode/container/ConfigMNodeContainer.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaQuotaStatistics.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/response/externalservice/ShowExternalServiceResp.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/response/cq/ShowCQResp.java | Migrates validation annotations import to jakarta.validation. |
| iotdb-client/jdbc/README.md | Updates JDBC client docs to require JDK 17+. |
| iotdb-client/client-cpp/README.md | Updates C++ client Spotless guidance to JDK 17+. |
| iotdb-client/client-cpp/pom.xml | Activates C++ Spotless profile only on JDK 17+. |
| integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBAlterColumnTypeIT.java | Migrates JAX-RS exception import to jakarta.ws.rs. |
| integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAlterTimeSeriesTypeIT.java | Migrates JAX-RS exception import to jakarta.ws.rs. |
| integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java | Updates expected parser error message after ANTLR upgrade. |
| integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java | Migrates validation annotations import to jakarta.validation. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/RestService.java | Migrates Jetty servlet integration to Jetty 12 EE10 + Jakarta servlet types; updates Swagger resource package. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/impl/RestApiServiceImpl.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/impl/GrafanaApiServiceImpl.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/handler/QueryDataSetHandler.java | Migrates JAX-RS imports; adds datatype propagation in certain response initializations. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/handler/FastLastHandler.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/handler/ExceptionHandler.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v1/impl/RestApiServiceImpl.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v1/impl/GrafanaApiServiceImpl.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v1/handler/QueryDataSetHandler.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v1/handler/ExceptionHandler.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/table/v1/impl/RestApiServiceImpl.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/table/v1/handler/QueryDataSetHandler.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/table/v1/handler/ExceptionHandler.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/impl/PingApiServiceImpl.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/handler/AuthorizationHandler.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/filter/BasicSecurityContext.java | Migrates JAX-RS imports to jakarta.ws.rs. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/filter/AuthorizationFilter.java | Migrates servlet/JAX-RS/filter imports to Jakarta namespaces. |
| external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/filter/ApiOriginFilter.java | Migrates servlet filter API to jakarta.servlet and simplifies interface usage. |
| external-service-impl/rest/pom.xml | Raises compiler level to 17; updates Jetty EE10 servlet dependency and JAXB/activation exclusions. |
| external-service-impl/rest-openapi/pom.xml | Switches to Swagger/Jackson Jakarta artifacts; configures OpenAPI generator for Jersey 3 + Jakarta EE. |
| external-service-impl/pom.xml | Raises external-service-impl reactor compiler level to 17. |
| external-service-impl/mqtt/pom.xml | Raises MQTT module compiler level to 17. |
| example/pom.xml | Raises examples compiler level to 17. |
| example/pipe-count-point-processor/pom.xml | Raises pipe example compiler level to 17. |
| example/jdbc/pom.xml | Raises JDBC example compiler level to 17. |
| dependencies.json | Updates tracked dependency coordinates for Jakarta/Jetty/Swagger/Jackson changes. |
| CONTRIBUTING.md | Updates Spotless/clang-format guidance to JDK 17 baseline. |
| CLAUDE.md | Updates documented Java compilation baseline to 17. |
| .github/workflows/multi-language-client.yml | Ensures JDK 17 is installed for multi-language client workflows. |
| .github/workflows/daily-ut.yml | Updates daily UT workflow to use JDK 17 baseline across OS matrix. |
| .github/workflows/daily-it.yml | Drops Java 8 from daily IT workflow matrix (JDK 17 only). |
| .github/workflows/compile-check.yml | Removes legacy JDK 8 compile-check workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @REM IoTDB requires JDK 17 or later. | ||
| IF %JAVA_VERSION% LSS 17 ( | ||
| echo IoTDB only supports jdk >= 17, please check your java version. | ||
| goto finally | ||
| ) |
There was a problem hiding this comment.
Addressed in be178c3. The DataNode Windows startup script now checks whether JAVA_VERSION is empty before the numeric LSS comparison and exits through finally with a clearer error message.
| @REM IoTDB requires JDK 17 or later. | ||
| IF %JAVA_VERSION% LSS 17 ( | ||
| echo IoTDB only supports jdk >= 17, please check your java version. | ||
| goto finally | ||
| ) |
There was a problem hiding this comment.
Addressed in be178c3. The ConfigNode Windows startup script now has the same empty JAVA_VERSION guard before the LSS comparison, so it fails gracefully if the Java version cannot be parsed.
| org.eclipse.jetty:jetty-http:12.0.36 | ||
| org.eclipse.jetty:jetty-io:12.0.36 | ||
| org.eclipse.jetty:jetty-security:12.0.36 | ||
| org.eclipse.jetty:jetty-server:12.0.36 | ||
| org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.36 | ||
| org.eclipse.jetty:jetty-util:12.0.36 |
There was a problem hiding this comment.
Addressed in be178c3. org.eclipse.jetty:jetty-session:12.0.36 has been added to LICENSE-binary alongside the other Jetty 12 artifacts.
JackieTien97
left a comment
There was a problem hiding this comment.
Thanks for the JDK 17/Jakarta migration work. I found two release/runtime issues that should be addressed before merging.
|
@Caideyipi Addressed in be178c3. I removed the duplicate |
|




Summary
@Generatedannotations because the current bundled Thrift 0.14.1 generator does not supportjakarta.annotation.Generated.Notes
javax.annotation.Nonnull,javax.annotation.Nullable, andjavax.annotation.concurrentremain where used because they are static annotations and do not block the Jakarta runtime migration.Validation
mvn clean package -pl distribution -am -DskipTestsmvn compile -pl external-service-impl/rest-openapi,external-service-impl/rest -DskipTestsmvn clean compile -pl iotdb-protocol/thrift-commons,iotdb-protocol/thrift-datanode,iotdb-protocol/thrift-confignode,iotdb-protocol/thrift-ainode,iotdb-protocol/thrift-consensus -am -DskipTestsmvn compile -pl iotdb-core/node-commons,iotdb-core/calc-commons,iotdb-core/confignode -DskipTestsmvn spotless:apply -pl iotdb-core/calc-commons,iotdb-core/node-commons,iotdb-core/confignode,iotdb-core/datanode,external-service-impl/rest -DskipTestsmvn spotless:apply -pl integration-test -P with-integration-tests -DskipTests