Skip to content

Upgrade minimum JDK to 17 and migrate JavaX to Jakarta#17859

Open
HTHou wants to merge 6 commits into
masterfrom
codex/jdk17-jakarta-migration
Open

Upgrade minimum JDK to 17 and migrate JavaX to Jakarta#17859
HTHou wants to merge 6 commits into
masterfrom
codex/jdk17-jakarta-migration

Conversation

@HTHou
Copy link
Copy Markdown
Contributor

@HTHou HTHou commented Jun 8, 2026

Summary

  • Raise the minimum Java version and build/runtime checks to JDK 17.
  • Upgrade JDK/Jakarta-locked dependencies, including Jetty 12 EE10, Jersey 3, Logback 1.5, ANTLR 4.13, OpenAPI Generator 7, Swagger Jakarta artifacts, and the Jackson Jakarta RS provider.
  • Migrate the REST service/OpenAPI generated surface and Jakarta EE runtime APIs to Jakarta namespaces.
  • Suppress Thrift generated @Generated annotations because the current bundled Thrift 0.14.1 generator does not support jakarta.annotation.Generated.

Notes

  • Apache HttpClient usage in REST examples and integration tests is intentionally left unchanged.
  • JSR-305 annotations such as javax.annotation.Nonnull, javax.annotation.Nullable, and javax.annotation.concurrent remain where used because they are static annotations and do not block the Jakarta runtime migration.
  • The TsFile snapshot bump also adapts the pipe TsFile page readers to use the decoder accessors exposed by the upgraded TsFile reader APIs. This is not part of the Jakarta namespace migration and should be reviewed as a behavior-sensitive TsFile parsing change.

Validation

  • mvn clean package -pl distribution -am -DskipTests
  • mvn compile -pl external-service-impl/rest-openapi,external-service-impl/rest -DskipTests
  • mvn clean compile -pl iotdb-protocol/thrift-commons,iotdb-protocol/thrift-datanode,iotdb-protocol/thrift-confignode,iotdb-protocol/thrift-ainode,iotdb-protocol/thrift-consensus -am -DskipTests
  • mvn compile -pl iotdb-core/node-commons,iotdb-core/calc-commons,iotdb-core/confignode -DskipTests
  • mvn spotless:apply -pl iotdb-core/calc-commons,iotdb-core/node-commons,iotdb-core/confignode,iotdb-core/datanode,external-service-impl/rest -DskipTests
  • mvn spotless:apply -pl integration-test -P with-integration-tests -DskipTests

@HTHou HTHou force-pushed the codex/jdk17-jakarta-migration branch from 09cc234 to ba97eb7 Compare June 8, 2026 04:29
@HTHou HTHou marked this pull request as ready for review June 8, 2026 04:32
@HTHou HTHou force-pushed the codex/jdk17-jakarta-migration branch 2 times, most recently from 76b6645 to 6bc0035 Compare June 8, 2026 04:40
@Caideyipi
Copy link
Copy Markdown
Collaborator

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
est-openapi dependency tree now contains coordinates that are not in the reference list, for example:

  • com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations (while the old jackson-module-jaxb-annotations entry remains)
  • io.github.classgraph:classgraph
  • io.swagger.core.v3:swagger-integration-jakarta
  • jakarta.inject:jakarta.inject-api
  • com.sun.activation:jakarta.activation

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.

@HTHou HTHou force-pushed the codex/jdk17-jakarta-migration branch from 6bc0035 to c7b9bf3 Compare June 8, 2026 07:01
@HTHou HTHou force-pushed the codex/jdk17-jakarta-migration branch from c7b9bf3 to ca3df0a Compare June 8, 2026 07:04
@HTHou HTHou force-pushed the codex/jdk17-jakarta-migration branch from 323a1b1 to f80618e Compare June 8, 2026 07:30
@HTHou HTHou changed the title Upgrade minimum JDK to 17 and migrate REST to Jakarta Upgrade minimum JDK to 17 and migrate JavaX to Jakarta Jun 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.82%. Comparing base (eb4409d) to head (f590473).

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17859      +/-   ##
============================================
- Coverage     40.83%   40.82%   -0.02%     
  Complexity     2611     2611              
============================================
  Files          5201     5201              
  Lines        353904   353654     -250     
  Branches      45284    45268      -16     
============================================
- Hits         144508   144366     -142     
+ Misses       209396   209288     -108     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@CritasWang CritasWang left a comment

Choose a reason for hiding this comment

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

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

  1. if it must stay, call it out explicitly in the PR description and add/point to tests that exercise the changed decoding path.

@HTHou
Copy link
Copy Markdown
Contributor Author

HTHou commented Jun 8, 2026

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.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 8, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

3 participants