Skip to content

HADOOP-20021. hadoop-bos: fix hierarchy bucket rename/create and slim shaded jar. - #8823

Merged
slfan1989 merged 2 commits into
apache:trunkfrom
yangdong2398:HADOOP-20021-hadoop-bos-followup
Oct 18, 2026
Merged

slfan1989 merged 2 commits into
apache:trunkfrom
yangdong2398:HADOOP-20021-hadoop-bos-followup

Conversation

@yangdong2398

@yangdong2398 yangdong2398 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Description of PR

JIRA: https://issues.apache.org/jira/browse/HADOOP-20021

Follow-up to HDFS-11161 (hadoop-bos), found while verifying the module with the hadoop fs CLI and the contract suite on JDK 17.

  • Upgrade bce-java-sdk 0.10.330 -> 0.10.332. 0.10.330 throws NullPointerException on hadoop fs -ls bos://bucket/ because the list response has no owner; 0.10.332 guards it.
  • Hierarchy (namespace) buckets:
    • rename: follow the FileSystem contract when the destination is an existing directory, and refuse to rename into its own descendant.
    • create: throw ParentNotDirectoryException when an ancestor is a file.
    • HTTP 400 responses other than an empty error code or InvalidSessionToken (e.g. InvalidArgument) now map to BosException instead of SessionTokenExpireException; the latter was retried by the retry policy as an expired session token and caused ~150s timeouts.
  • Packaging: stop bundling guava, httpclient, httpcore and commons-codec in the shaded jar and use the ones shipped with Hadoop (jar ~14MB -> ~9.4MB). httpcore-nio and httpasyncclient are still bundled: the SDK's BceHttpClient needs them at class load time even with async put disabled, and Hadoop does not ship them.
  • Update LICENSE-binary (SDK version, httpcore-nio, httpasyncclient).

How was this patch tested?

JDK 17, endpoint http://bj.bcebos.com, run against real BOS with credentials from environment variables (EnvironmentVariableCredentialsProvider):

  • Contract suite on both a flat bucket and a hierarchy bucket: 140 tests, 0 failures, 0 errors, 31 skipped (append, concat, unbuffer, setTimes, rootdir, and 2 in create).
  • hadoop fs CLI on both buckets: mkdir -p, put, cat, mv, ls (including bucket root), rm -r, -checksum.
  • New unit tests that need no BOS endpoint or credentials (mocked SDK client / object store): TestBosClientProxyImplExceptions (HTTP error to exception mapping) and TestBaiduBosFileSystemHierarchy (hierarchy rename/create). 24 cases pass; with the pre-change sources 10 of them fail, so they do exercise the fix. The module now runs 164 tests (139 contract tests are skipped without credentials).
  • mvn checkstyle:check (0 violations), javadoc:javadoc and spotbugs:check (0 bugs) on hadoop-bos.

Limitations: the CLI check used a Maven-resolved classpath, not a built distribution tarball. Since guava/httpclient now come from Hadoop, hadoop-bos needs hadoop-common (not only hadoop-client-api) on the classpath.

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

Contains content generated by Claude Code.

… shaded jar.

- Upgrade bce-java-sdk to 0.10.332 to fix the NullPointerException when
  listing a bucket root (missing "owner" in the list response).
- Hierarchy buckets: honour the rename contract (rename into an existing
  directory, rename into own descendant) and throw
  ParentNotDirectoryException when creating a file under a file.
- Map 400 InvalidArgument to BosException instead of
  SessionTokenExpireException so the retry policy does not retry it.
- Stop bundling guava, httpclient, httpcore and commons-codec in the
  shaded jar and rely on the ones shipped by Hadoop. Keep bundling
  httpcore-nio and httpasyncclient, which the SDK needs at class load
  time and Hadoop does not ship.
- Update LICENSE-binary accordingly.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 27s 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.
+0 🆗 shelldocs 0m 1s Shelldocs 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 2m 30s Maven dependency ordering for branch
+1 💚 mvninstall 28m 4s trunk passed
+1 💚 compile 8m 54s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 9m 3s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 3m 10s trunk passed
+1 💚 mvnsite 10m 6s trunk passed
+1 💚 javadoc 6m 1s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 6m 30s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
-1 ❌ spotbugs 21m 35s /branch-spotbugs-root-warnings.html root in trunk has 80 extant spotbugs warnings.
+1 💚 shadedclient 19m 40s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 26s Maven dependency ordering for patch
+1 💚 mvninstall 27m 12s the patch passed
+1 💚 compile 10m 58s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 10m 58s the patch passed
+1 💚 compile 11m 29s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 11m 29s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 3m 54s the patch passed
+1 💚 mvnsite 12m 49s the patch passed
+1 💚 shellcheck 0m 0s No new issues.
+1 💚 javadoc 6m 35s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 6m 40s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 24m 53s the patch passed
+1 💚 shadedclient 44m 25s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 640m 24s root in the patch passed.
+1 💚 asflicense 1m 6s The patch does not generate ASF License warnings.
887m 55s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8823/1/artifact/out/Dockerfile
GITHUB PR #8823
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux e1b44443772d 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / eaff1c3
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8823/1/testReport/
Max. process+thread count 4417 (vs. ulimit of 10000)
modules C: hadoop-cloud-storage-project/hadoop-bos . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8823/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7 shellcheck=0.9.0
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fixes and the validation against both bucket types.

Could you add focused unit tests for the new hierarchy-bucket rename/create behavior and the HTTP 400 exception mapping? The BOS contract tests were all skipped in Jenkins, so these paths currently have no automated CI coverage.

Could you also validate the packaging changes using a built Hadoop distribution with the normal BOS classpath setup? The Maven-resolved classpath check is useful, but it does not verify the distribution runtime dependencies. Please also investigate the two failing GitHub Actions build jobs before we proceed with merging.

cc: @LuciferYang

…ials.

Mock the BOS SDK client and the native file system store to cover the
hierarchy-bucket rename/create behaviour and the HTTP error to exception
mapping in BosClientProxyImpl, so these paths are exercised in CI where
the contract tests are skipped.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 26s 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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 3 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 2m 1s Maven dependency ordering for branch
+1 💚 mvninstall 27m 39s trunk passed
+1 💚 compile 9m 0s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 8m 53s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 3m 8s trunk passed
+1 💚 mvnsite 10m 7s trunk passed
+1 💚 javadoc 6m 13s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 6m 8s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
-1 ❌ spotbugs 19m 22s /branch-spotbugs-root-warnings.html root in trunk has 80 extant spotbugs warnings.
+1 💚 shadedclient 15m 46s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for patch
+1 💚 mvninstall 19m 52s the patch passed
+1 💚 compile 9m 2s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 9m 2s the patch passed
+1 💚 compile 9m 14s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 9m 14s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 3m 7s the patch passed
+1 💚 mvnsite 10m 7s the patch passed
+1 💚 shellcheck 0m 1s No new issues.
+1 💚 javadoc 6m 2s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 6m 8s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 20m 46s the patch passed
+1 💚 shadedclient 35m 23s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 630m 12s root in the patch passed.
+1 💚 asflicense 1m 18s The patch does not generate ASF License warnings.
845m 11s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8823/2/artifact/out/Dockerfile
GITHUB PR #8823
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 722d7a3787af 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 9c29dcf
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8823/2/testReport/
Max. process+thread count 4378 (vs. ulimit of 10000)
modules C: hadoop-cloud-storage-project/hadoop-bos . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8823/2/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7 shellcheck=0.9.0
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks for adding the tests and addressing the feedback. We can follow up on the built-distribution validation separately.

@slfan1989
slfan1989 merged commit 9ede2e9 into apache:trunk Oct 18, 2026
3 of 6 checks passed
@slfan1989

slfan1989 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

@yangdong2398 Thanks for the contribution! Merged into trunk.

cc: @LuciferYang

@LuciferYang

Copy link
Copy Markdown

Thank you @slfan1989 and @yangdong2398

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