Repository navigation
HADOOP-20021. hadoop-bos: fix hierarchy bucket rename/create and slim shaded jar. - #8823
Conversation
… 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>
|
💔 -1 overall
This message was automatically generated. |
slfan1989
left a comment
There was a problem hiding this comment.
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>
|
💔 -1 overall
This message was automatically generated. |
slfan1989
left a comment
There was a problem hiding this comment.
LGTM. Thanks for adding the tests and addressing the feedback. We can follow up on the built-distribution validation separately.
|
@yangdong2398 Thanks for the contribution! Merged into trunk. cc: @LuciferYang |
|
Thank you @slfan1989 and @yangdong2398 |
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 fsCLI and the contract suite on JDK 17.bce-java-sdk0.10.330 -> 0.10.332. 0.10.330 throwsNullPointerExceptiononhadoop fs -ls bos://bucket/because the list response has noowner; 0.10.332 guards it.rename: follow the FileSystem contract when the destination is an existing directory, and refuse to rename into its own descendant.create: throwParentNotDirectoryExceptionwhen an ancestor is a file.InvalidSessionToken(e.g.InvalidArgument) now map toBosExceptioninstead ofSessionTokenExpireException; the latter was retried by the retry policy as an expired session token and caused ~150s timeouts.httpcore-nioandhttpasyncclientare still bundled: the SDK'sBceHttpClientneeds them at class load time even with async put disabled, and Hadoop does not ship them.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):hadoop fsCLI on both buckets:mkdir -p,put,cat,mv,ls(including bucket root),rm -r,-checksum.TestBosClientProxyImplExceptions(HTTP error to exception mapping) andTestBaiduBosFileSystemHierarchy(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:javadocandspotbugs:check(0 bugs) onhadoop-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 onlyhadoop-client-api) on the classpath.For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?AI Tooling
where Claude Code is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html
Contains content generated by Claude Code.