-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[refactor](credential) Refactor vended credentials system with unified architecture #55760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the vended credentials system with a unified architecture to support multiple data sources (Iceberg, Paimon) through better abstraction and extensibility.
- Introduces abstract base class
AbstractVendedCredentialsProviderwith unified credential handling workflow - Adds
VendedCredentialsFactoryusing factory pattern for creating appropriate credential providers - Replaces scattered credential handling logic with
CredentialUtilsfor consistent property filtering and backend property extraction - Updates existing providers to extend the abstract base and removes the old
CredentialExtractorinterface system
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
PaimonVendedCredentialsProviderTest.java |
Updates tests to work with new unified provider architecture and test methods |
IcebergVendedCredentialsProviderTest.java |
Updates tests for new provider pattern and removes old extractor tests |
IcebergTableSink.java |
Updates to use VendedCredentialsFactory and store properties map for consistency |
S3Properties.java |
Adds new property name mappings for credential keys to support vended credentials |
PaimonScanNode.java |
Updates to use factory pattern and CredentialUtils for backend properties |
PaimonVendedCredentialsProvider.java |
Refactored to extend AbstractVendedCredentialsProvider |
PaimonOssCredentialExtractor.java |
Removed as part of old extractor interface elimination |
IcebergScanNode.java |
Updates to use factory pattern and CredentialUtils for backend properties |
IcebergVendedCredentialsProvider.java |
Refactored to extend AbstractVendedCredentialsProvider |
IcebergS3CredentialExtractor.java |
Removed as part of old extractor interface elimination |
VendedCredentialsFactory.java |
New factory class for creating appropriate credential providers |
CredentialUtils.java |
New utility class for cloud storage property filtering and backend property extraction |
CredentialExtractor.java |
Removed interface as part of architecture refactoring |
AbstractVendedCredentialsProvider.java |
New abstract base class providing unified credential handling workflow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...src/main/java/org/apache/doris/datasource/credentials/AbstractVendedCredentialsProvider.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/doris/datasource/credentials/AbstractVendedCredentialsProvider.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/datasource/credentials/CredentialUtils.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/datasource/credentials/VendedCredentialsFactory.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/datasource/credentials/CredentialUtils.java
Show resolved
Hide resolved
c99eedc to
aca1148
Compare
|
run buildall |
TPC-H: Total hot run time: 34828 ms |
TPC-DS: Total hot run time: 189716 ms |
ClickBench: Total hot run time: 30.33 s |
FE UT Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
aca1148 to
9983041
Compare
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
TPC-H: Total hot run time: 34608 ms |
TPC-DS: Total hot run time: 188947 ms |
ClickBench: Total hot run time: 30.04 s |
FE Regression Coverage ReportIncrement line coverage |
…d architecture (apache#55760) This PR refactors the vended credentials system by introducing a unified architecture to support multiple data sources (Iceberg, Paimon) with better abstraction and extensibility. - **`AbstractVendedCredentialsProvider`**: Abstract base class providing unified credential handling workflow - **`VendedCredentialsFactory`**: Factory pattern for creating appropriate credential providers - **`CredentialUtils`**: Utility class for cloud storage property filtering and backend property extraction - `CredentialExtractor` interface and its implementations (`IcebergS3CredentialExtractor`, `PaimonOssCredentialExtractor`) - Scattered credential handling logic across different modules - Cloud storage property filtering with support for s3, oss, cos, obs, gs, azure prefixes - Unified use` StorageProperties.createAll()` integration for consistent format conversion - Improved error handling and graceful degradation - Thread-safe singleton pattern for credential providers ##### Updated Components: - `IcebergVendedCredentialsProvider`: Now extends AbstractVendedCredentialsProvider - `PaimonVendedCredentialsProvider`: Now extends AbstractVendedCredentialsProvider - `IcebergScanNode`、`IcebergTableSink`、`PaimonScanNode`: Updated to use unified credential system - Simplified credential management across data sources - Better code maintainability and extensibility - Consistent behavior and error handling - Reduced code duplication - Iceberg(Polaris): ``` Doris > CREATE CATALOG `polaris_vended_test` PROPERTIES ( -> "warehouse" = "doris_test", -> "type" = "iceberg", -> "iceberg.rest.vended-credentials-enabled" = "true", -> "iceberg.rest.uri" = "http://127.0.0.1:20181/api/catalog", -> "iceberg.rest.security.type" = "oauth2", -> "iceberg.rest.oauth2.server-uri" = "http://127.0.0.1:20181/api/catalog/v1/oauth/tokens", -> "iceberg.rest.oauth2.scope" = "PRINCIPAL_ROLE:ALL", -> "iceberg.rest.oauth2.credential" = "root:secret123", -> "iceberg.catalog.type" = "rest" -> ); Query OK, 0 rows affected (0.05 sec) Doris > use polaris_vended_test.test; Database changed Doris > select * from test; +------+------+ | id | name | +------+------+ | 1 | a | | 2 | b | +------+------+ 2 rows in set (0.92 sec) ``` - Glue Rest S3Table ``` Doris > CREATE CATALOG glue_s3_vended PROPERTIES ( -> 'type' = 'iceberg', -> 'warehouse' = '<account_id>:s3tablescatalog/s3-table-bucket-hk-glue-test', -> 'iceberg.catalog.type' = 'rest', -> 'iceberg.rest.uri' = 'https://glue.ap-east-1.amazonaws.com/iceberg', -> 'iceberg.rest.sigv4-enabled' = 'true', -> 'iceberg.rest.signing-name' = 'glue', -> 'iceberg.rest.access-key-id' = 'ak', -> 'iceberg.rest.secret-access-key' = 'sk', -> 'iceberg.rest.signing-region' = 'ap-east-1', -> "iceberg.rest.vended-credentials-enabled" = "true" -> ); Query OK, 0 rows affected (0.07 sec) Doris > use glue_s3_vended.athena_ns; Database changed Doris > select * from test; +------+------+ | id | name | +------+------+ | 1 | a | +------+------+ 1 row in set (0.20 sec) ``` - Paimon: ``` Doris > CREATE CATALOG paimon_dlf_test PROPERTIES ( -> 'type' = 'paimon', -> 'paimon.catalog.type' = 'rest', -> 'uri' = 'http://cn-beijing-vpc.dlf.aliyuncs.com', -> 'warehouse' = 'xxx', -> 'paimon.rest.token.provider' = 'dlf', -> 'paimon.rest.dlf.access-key-id' = 'xxx, -> 'paimon.rest.dlf.access-key-secret' = 'xxx' -> ); Query OK, 0 rows affected (0.02 sec) Doris > use paimon_dlf_test.new_dlf_paimon_db; Database changed Doris > select * from users_samples; +---------+-----------+-------------------+------+ | user_id | age_level | final_gender_code | clk | +---------+-----------+-------------------+------+ | 1 | 25-34 | M | 1 | | 5 | 25-34 | M | 1 | | 3 | 25-34 | M | 1 | | 2 | 18-24 | F | 0 | | 4 | 18-24 | F | 0 | | 6 | 18-24 | F | 0 | +---------+-----------+-------------------+------+ 6 rows in set (0.90 sec) ```
What problem does this PR solve?
related: #56004
Overview:
This PR refactors the vended credentials system by introducing a unified architecture to support multiple data sources (Iceberg, Paimon) with better abstraction and
extensibility.
Key Changes:
New Architecture:
AbstractVendedCredentialsProvider: Abstract base class providing unified credential handling workflowVendedCredentialsFactory: Factory pattern for creating appropriate credential providersCredentialUtils: Utility class for cloud storage property filtering and backend property extractionRemoved Components:
CredentialExtractorinterface and its implementations (IcebergS3CredentialExtractor,PaimonOssCredentialExtractor)Enhanced Features:
StorageProperties.createAll()integration for consistent format conversionUpdated Components:
IcebergVendedCredentialsProvider: Now extends AbstractVendedCredentialsProviderPaimonVendedCredentialsProvider: Now extends AbstractVendedCredentialsProviderIcebergScanNode、IcebergTableSink、PaimonScanNode: Updated to use unified credential systemBenefits:
Test:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)