Skip to content

HADOOP-19861. Migrate hadoop-cos from javax.annotation to jakarta.#8421

Open
slfan1989 wants to merge 1 commit intoapache:trunkfrom
slfan1989:HADOOP-19861
Open

HADOOP-19861. Migrate hadoop-cos from javax.annotation to jakarta.#8421
slfan1989 wants to merge 1 commit intoapache:trunkfrom
slfan1989:HADOOP-19861

Conversation

@slfan1989
Copy link
Copy Markdown
Contributor

@slfan1989 slfan1989 commented Apr 12, 2026

Description of PR

Background

The hadoop-cos module currently uses javax.annotation.Nullable from the legacy javax.annotation-api package. As part of the Jakarta EE transition, we should migrate to jakarta.annotation.Nullable.

Changes

This patch migrates the hadoop-cos module from javax.annotation to jakarta.annotation with minimal changes:

  1. Dependency Management
  • Added jakarta.annotation:jakarta.annotation-api:2.1.1 to parent POM (hadoop-project/pom.xml) dependency management
  • Added jakarta.annotation-api dependency in hadoop-cos module POM (version inherited from parent)
  • Kept javax.annotation-api in parent for other modules (coexistence is acceptable for now)
  1. Code Changes
  • Replaced javax.annotation.Nullable imports with jakarta.annotation.Nullable in 3 files:
    • AbstractCOSCredentialsProvider.java
    • EnvironmentVariableCredentialsProvider.java
    • SimpleCredentialsProvider.java

Compatibility

  • No API changes - only package name updates
  • jakarta.annotation-api 2.x uses jakarta.annotation.* namespace
  • Both javax.annotation-api and jakarta.annotation-api can coexist in classpath
  • No runtime behavior changes expected

How was this patch tested?

  • Existing unit tests pass

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

AI Tooling

If an AI tool was used:

@slfan1989
Copy link
Copy Markdown
Contributor Author

@steveloughran @pan3793 I will continue to push forward work related to future JDK compatibility. One area we need to pay attention to is the migration from javax.* to jakarta.*. This is a relatively straightforward PR that attempts to upgrade javax to jakarta.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the hadoop-cos connector from javax.annotation.Nullable to jakarta.annotation.Nullable as part of the Jakarta EE namespace transition.

Changes:

  • Add jakarta.annotation:jakarta.annotation-api:2.1.1 to hadoop-project dependency management.
  • Add jakarta.annotation-api as a dependency of hadoop-cos.
  • Update Nullable imports in the hadoop-cos credentials provider classes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
hadoop-project/pom.xml Adds managed version for jakarta.annotation-api so modules can inherit a consistent version.
hadoop-cloud-storage-project/hadoop-cos/pom.xml Declares the jakarta.annotation-api dependency needed by hadoop-cos sources.
.../AbstractCOSCredentialsProvider.java Switches @Nullable import to jakarta.annotation.Nullable.
.../EnvironmentVariableCredentialsProvider.java Switches @Nullable import to jakarta.annotation.Nullable.
.../SimpleCredentialsProvider.java Switches @Nullable import to jakarta.annotation.Nullable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +116 to +120
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>

Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

This PR introduces a new third-party dependency (jakarta.annotation:jakarta.annotation-api). It is not currently listed in LICENSE-binary, and there is no corresponding license text under licenses-binary/, so the binary licensing metadata will likely be out of date once this jar is bundled. Please add the dependency to LICENSE-binary under the appropriate license section and include the matching license file in licenses-binary/ (and NOTICE-binary if required by the dependency’s notice terms).

Copilot uses AI. Check for mistakes.
@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 0s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 1m 58s Maven dependency ordering for branch
+1 💚 mvninstall 41m 50s trunk passed
+1 💚 compile 16m 5s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 16m 23s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 5m 28s trunk passed
+1 💚 mvnsite 1m 45s trunk passed
+1 💚 javadoc 1m 46s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 1m 42s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+0 🆗 spotbugs 0m 52s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 27m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 29s Maven dependency ordering for patch
+1 💚 mvninstall 0m 37s the patch passed
-1 ❌ compile 12m 45s /patch-compile-root-jdkUbuntu-21.0.10+7-Ubuntu-124.04.txt root in the patch failed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04.
-1 ❌ javac 12m 45s /patch-compile-root-jdkUbuntu-21.0.10+7-Ubuntu-124.04.txt root in the patch failed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04.
-1 ❌ compile 13m 56s /patch-compile-root-jdkUbuntu-17.0.18+8-Ubuntu-124.04.1.txt root in the patch failed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1.
-1 ❌ javac 13m 56s /patch-compile-root-jdkUbuntu-17.0.18+8-Ubuntu-124.04.1.txt root in the patch failed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1.
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 5m 22s the patch passed
+1 💚 mvnsite 1m 37s the patch passed
+1 💚 javadoc 1m 40s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 1m 39s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+0 🆗 spotbugs 0m 48s hadoop-project has no data from spotbugs
-1 ❌ shadedclient 28m 17s patch has errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 45s hadoop-project in the patch passed.
+1 💚 unit 0m 51s hadoop-cos in the patch passed.
+1 💚 asflicense 1m 10s The patch does not generate ASF License warnings.
197m 19s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/1/artifact/out/Dockerfile
GITHUB PR #8421
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle
uname Linux b22179cf1278 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 0e6bb24
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/1/testReport/
Max. process+thread count 635 (vs. ulimit of 10000)
modules C: hadoop-project hadoop-cloud-storage-project/hadoop-cos U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/1/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@github-actions github-actions Bot added the YARN label Apr 12, 2026
@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 0s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 1m 42s Maven dependency ordering for branch
+1 💚 mvninstall 41m 11s trunk passed
+1 💚 compile 16m 4s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 16m 35s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 5m 32s trunk passed
+1 💚 mvnsite 2m 45s trunk passed
+1 💚 javadoc 2m 31s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 2m 36s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+0 🆗 spotbugs 0m 53s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 28m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 31s Maven dependency ordering for patch
+1 💚 mvninstall 1m 6s the patch passed
+1 💚 compile 15m 8s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 15m 8s the patch passed
+1 💚 compile 16m 21s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 16m 21s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 5m 23s the patch passed
+1 💚 mvnsite 2m 46s the patch passed
+1 💚 javadoc 2m 37s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 2m 34s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+0 🆗 spotbugs 0m 48s hadoop-project has no data from spotbugs
-1 ❌ shadedclient 28m 25s patch has errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 43s hadoop-project in the patch passed.
+1 💚 unit 1m 5s hadoop-yarn-csi in the patch passed.
+1 💚 unit 0m 52s hadoop-cos in the patch passed.
+1 💚 asflicense 1m 14s The patch does not generate ASF License warnings.
213m 1s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/2/artifact/out/Dockerfile
GITHUB PR #8421
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle
uname Linux 1c58519b38a3 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 1e54edb
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/2/testReport/
Max. process+thread count 633 (vs. ulimit of 10000)
modules C: hadoop-project hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi hadoop-cloud-storage-project/hadoop-cos U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/2/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Apr 13, 2026

@slfan1989
Copy link
Copy Markdown
Contributor Author

@pan3793 I understand the suggestion to use JSpecify, and the direction makes sense. For HADOOP‑19861, the current scope is limited to the javax→jakarta migration in hadoop‑cos, so I prefer to keep the change minimal and low‑risk. Adopting JSpecify involves a broader decision on nullness annotations, dependency management, and tooling support, which should be discussed and driven as a separate proposal. I suggest we keep this change as a jakarta migration, and if needed I can open a separate JIRA or draft to plan JSpecify adoption. Does that sound reasonable?

cc: @steveloughran

@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 55s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 1m 53s Maven dependency ordering for branch
+1 💚 mvninstall 51m 39s trunk passed
+1 💚 compile 17m 26s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 18m 0s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 5m 54s trunk passed
+1 💚 mvnsite 2m 30s trunk passed
+1 💚 javadoc 2m 23s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 2m 14s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+0 🆗 spotbugs 0m 47s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 35m 44s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 1m 4s the patch passed
+1 💚 compile 16m 35s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 16m 35s the patch passed
+1 💚 compile 18m 2s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 18m 2s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 5m 49s the patch passed
+1 💚 mvnsite 2m 31s the patch passed
+1 💚 javadoc 2m 17s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 2m 20s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+0 🆗 spotbugs 0m 43s hadoop-project has no data from spotbugs
-1 ❌ shadedclient 35m 25s patch has errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 42s hadoop-project in the patch passed.
+1 💚 unit 1m 4s hadoop-yarn-csi in the patch passed.
+1 💚 unit 0m 48s hadoop-cos in the patch passed.
+1 💚 asflicense 1m 14s The patch does not generate ASF License warnings.
242m 4s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/4/artifact/out/Dockerfile
GITHUB PR #8421
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle
uname Linux 8d13c3fd183e 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / a1f2215
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/4/testReport/
Max. process+thread count 642 (vs. ulimit of 10000)
modules C: hadoop-project hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi hadoop-cloud-storage-project/hadoop-cos U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8421/4/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants