[#11748] feat(catalog-hadoop): support Tencent Cloud COS as fileset storage backend (Java side)#11713
Conversation
Code Coverage Report
Files
|
There was a problem hiding this comment.
Pull request overview
Adds Tencent Cloud Object Storage (COS) support to the Fileset catalog/GVFS stack, following the existing cloud-provider bundle pattern (AWS/GCP/Aliyun/Azure). This introduces COS-specific filesystem + credential vending integration, a shaded “tencent-bundle” artifact, and accompanying docs/tests.
Changes:
- Introduce new COS bundle modules (
:bundles:tencent,:bundles:tencent-bundle) and wire them into build/runtime packaging. - Add COS credential type + server/client-side credential provider plumbing for static SecretId/SecretKey vending.
- Document COS setup and add COS integration/unit tests.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Includes new Tencent bundle modules in the Gradle build. |
| gradle/libs.versions.toml | Adds hadoop-cos version and hadoop3-cos dependency coordinate. |
| docs/fileset-catalog.md | Mentions COS support and bundle jar name. |
| docs/fileset-catalog-with-cos.md | New end-to-end documentation for COS-backed Fileset catalogs (incl. credential vending). |
| clients/filesystem-hadoop3-runtime/build.gradle.kts | Pulls :bundles:tencent into the Hadoop3 runtime client jar. |
| catalogs/hadoop-common/src/main/java/org/apache/gravitino/catalog/hadoop/fs/Constants.java | Adds COS-specific Hadoop configuration keys. |
| catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/FilesetCOSCatalogIT.java | Adds COS integration test (gated by env vars). |
| catalogs/catalog-fileset/build.gradle.kts | Adds tencent-bundle shadow jar to test classpath and task deps. |
| catalogs/catalog-common/src/main/java/org/apache/gravitino/storage/COSProperties.java | Defines COS catalog property keys (region/endpoint/AK/SK). |
| catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/config/COSCredentialConfig.java | Adds COS credential config wrapper for static AK/SK. |
| bundles/tencent/src/test/java/org/apache/gravitino/cos/fs/TestCOSFileSystemProvider.java | Unit tests for COS FS provider mapping and credential conf injection. |
| bundles/tencent/src/test/java/org/apache/gravitino/cos/credential/TestCOSCredentialProvider.java | Unit tests for COS credential provider behavior. |
| bundles/tencent/src/main/resources/META-INF/services/org.apache.gravitino.credential.CredentialProvider | Registers COS credential provider via ServiceLoader. |
| bundles/tencent/src/main/resources/META-INF/services/org.apache.gravitino.catalog.hadoop.fs.FileSystemProvider | Registers COS filesystem provider via ServiceLoader. |
| bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSUtils.java | Helper for selecting a suitable COS credential from vended credentials. |
| bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSFileSystemProvider.java | Implements COS cosn:// filesystem provider + default tuning. |
| bundles/tencent/src/main/java/org/apache/gravitino/cos/fs/COSCredentialsProvider.java | Bridges Gravitino vended COS credentials into hadoop-cos auth. |
| bundles/tencent/src/main/java/org/apache/gravitino/cos/credential/COSSecretKeyProvider.java | Server-side credential provider for static COS AK/SK. |
| bundles/tencent/build.gradle.kts | Build config for the thin COS integration module. |
| bundles/tencent-bundle/build.gradle.kts | Shaded fat-jar bundling hadoop-cos + dependencies with relocations. |
| api/src/main/java/org/apache/gravitino/credential/COSSecretKeyCredential.java | New credential type for COS static SecretId/SecretKey. |
yuqi1129
left a comment
There was a problem hiding this comment.
Thanks for the COS support — the layout cleanly mirrors the existing OSS/S3/GCS bundles, and the ServiceLoader registration, relocation rules and credential-vending wiring all look correct. A few inline comments below.
One general note (not tied to a line): the PR description mentions "wire cosn:// into FilesetCatalogPropertiesMetadata" and "register the cosn scheme in hadoop-common", but neither file is actually changed that way — providers are auto-loaded via META-INF/services, and hadoop-common only got the two timeout/retry constants. The change itself is fine; just the description is slightly off.
86af744 to
451a93d
Compare
|
Pushed an updated commit addressing all review comments. |
|
I suggest you to create subtasks for this epic issue #6490 . And each PR should have a related issue for that dedicated thing. Not tracking all the PRs in one issue. |
Add Tencent Cloud Object Storage (COS) support for the fileset catalog, following the same layout as the existing OSS / S3 / GCS / Azure modules. This is the first PR in a chain that together addresses apache#6490. Subsequent PRs will add server-side STS credential vending, Python GVFS support, and Python-side STS wiring. The issue will remain open until the final PR in the chain is merged. Modules added or changed: - bundles/tencent: FileSystemProvider for the cosn:// scheme and a CredentialProvider that returns long-lived COS Secret Key credentials. - bundles/tencent-bundle: shaded fat-jar that bundles hadoop-cos and the COS Java SDK with relocated packages. - api: COSSecretKeyCredential type, registered via META-INF/services so that the GVFS client can deserialize credentials returned by the server. - catalogs/catalog-common: COSProperties and COSCredentialConfig. - catalogs/catalog-fileset: make cosn a recognized filesystem provider for the fileset catalog (loaded via the FilesystemProvider SPI). - clients/filesystem-hadoop3-runtime: include bundles/tencent in the GVFS runtime jar so cosn:// works out of the box. - clients/filesystem-hadoop3: add tencent-bundle as a test dependency for the new GVFS COS integration test below. - docs: new fileset-catalog-with-cos.md, plus a cross-link from fileset-catalog.md. Tests: - TestCOSFileSystemProvider and TestCOSCredentialProvider as unit tests. - FilesetCOSCatalogIT as an integration test for the catalog layer. - GravitinoVirtualFileSystemCOSIT as an integration test for the GVFS client-side path against a real COS bucket. All ITs are skipped when COS_* environment variables are not provided, following the same pattern as FilesetOSSCatalogIT / GravitinoVirtualFileSystemOSSIT. Part of apache#6490
451a93d to
ffce209
Compare
|
Additionally, I encountered a problem in the testing phase, so I created an independent PR(#11814) to fix it. |
Good catch, thanks for your hard work! |
…p-catalog # Conflicts: # common/src/main/java/org/apache/gravitino/config/ConfigConstants.java
yuqi1129
left a comment
There was a problem hiding this comment.
A minor one, others LGTM
done~ |
b974a89 to
15460ef
Compare
|
@whua3 |
Yes, Python GVFS does not support COS yet in this PR. I will implement this in PR-C. |
I see. Please correct your PR title and modify the issue link. #6490 is the EPIC link, we may seldom use it in the PR. |
…ersion to 2.0.0 Two review-feedback follow-ups on the COS fileset catalog work: 1. docs: pad each row of the three property tables in docs/fileset-catalog-with-cos.md to the width of the longest cell (`cos-endpoint`) so that the pipe characters line up in a raw editor. Rendered output is unchanged. 2. version: bump the "Since version" of all newly introduced COS entry points from 1.4.0 to 2.0.0 to match the current release train (main is on 2.0.0-SNAPSHOT): - ConfigConstants.java: replace VERSION_1_4_0 with VERSION_2_0_0 (the constant is only referenced from the new COS credential config) - COSCredentialConfig.java: switch three .version(...) declarations to VERSION_2_0_0 - fileset-catalog-with-cos.md: update every "Since version" table cell and the credential-vending prose to 2.0.0 - fileset-catalog.md: update the "Since 2.0.0" note referencing COS support Part of apache#6490
15460ef to
9c75eab
Compare
done |
|
@diqiu50 |
|
I'm going to merge this PR, @whua3. Thanks for your hard work. I'm looking forward to more PRs |





What changes were proposed in this pull request?
Add Tencent Cloud Object Storage (COS) support for the fileset catalog. The layout follows the existing OSS / S3 / GCS / Azure modules.
bundles/tencent: source module containingCOSFileSystemProvider: builds a HadoopCosNFileSystemfor thecosn://scheme.COSCredentialsProvider: Hadoop-side provider that bridges Gravitino-vendedCOSSecretKeycredentials tohadoop-cos.COSSecretKeyProvider: server-sideCredentialProviderthat returns long-lived COS Secret Key credentials.COSUtils: helper that maps Gravitino properties to HadoopConfiguration.bundles/tencent-bundle: shaded fat-jar (gravitino-tencent-bundle-<version>.jar) that bundleshadoop-cosandcos_api-bundlewith relocated packages.api: newCOSSecretKeyCredentialtype.catalogs/catalog-common:COSPropertiesandCOSCredentialConfig.clients/filesystem-hadoop3-runtime: includebundles/tencentin the GVFS runtime jar.docs: newfileset-catalog-with-cos.mdand a cross-link fromfileset-catalog.md.TestCOSFileSystemProvider,TestCOSCredentialProvider, andFilesetCOSCatalogIT. The IT is skipped on CI when no real COS credentials are provided, the same wayFilesetOSSCatalogITis.Why are the changes needed?
#6490 tracks adding Tencent COS support. Without it, users on Tencent Cloud have to either rely on S3-compatible workarounds, which do not work with Gravitino's credential vending, or maintain their own fork.
This PR is the first of a chain of PRs against
main:cos-secret-keycredential.cos-token).COSStorageHandlerand Python-sideCOSSecretKeyCredential).COSTokenCredentialwiring. Can be folded into PR-C if reviewers prefer fewer PRs.Part of #6490
Fix: #11748
Does this PR introduce any user-facing change?
Yes, additive only. Existing fileset / catalog behavior is unchanged. New surface:
cosn://<bucket>/<path>.cos-region,cos-endpoint(optional, defaults tocos.${region}.myqcloud.com),cos-access-key-id,cos-secret-access-key.credential-providers=cos-secret-key(static AK/SK; STS will follow in PR-B).gravitino-tencent-bundle-<version>.jar.How was this patch tested?
:bundles:tencent:test,:catalogs:catalog-common:test,:catalogs:catalog-fileset:test,:api:testall pass locally.:bundles:tencent-bundle:shadowJar,:clients:filesystem-hadoop3-runtime:shadowJar, andassemblefor all touched modules pass locally.FilesetCOSCatalogITpasses locally against a real COS bucket inap-guangzhou. It is skipped on CI when no credentials are provided.cosn://, then exercisedhadoop fs -ls,-put,-get,-cat,-rmovergvfs://fileset/..., plus schema/fileset CRUD via the REST API and directcosn://...access.