Skip to content

[HUDI-9323] Remove unnecessary config copying#13174

Merged
danny0405 merged 1 commit intoapache:masterfrom
yihua:HUDI-9323-fix-config-copy
Apr 19, 2025
Merged

[HUDI-9323] Remove unnecessary config copying#13174
danny0405 merged 1 commit intoapache:masterfrom
yihua:HUDI-9323-fix-config-copy

Conversation

@yihua
Copy link
Contributor

@yihua yihua commented Apr 19, 2025

Change Logs

This PR revisits all places using the constructors, TypedProperties(Properties defaults) and HoodieConfig(Properties props), that involve copying the config values. Unnecessary config copying is removed. Detailed changes include:

  • Makes TypedProperties(Properties defaults) and HoodieConfig(Properties props) protected and adds TypedProperties#copy and HoodieConfig#copy so that developers know these APIs can be costly;
  • Removes usages of config copying where there is only config fetching and no modification to the configs (e.g., HoodieAvroKeyGeneratorFactory.createKeyGenerator, using ConfigUtils on properties, new KeyGeneratorType#getKeyGeneratorClassName API taking TypedProperties, etc.)

Impact

Avoids unnecessary config copying and simplifies config passing.

Risk level

none

Documentation Update

N/A

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:M PR with lines of changes in (100, 300] label Apr 19, 2025
@yihua yihua force-pushed the HUDI-9323-fix-config-copy branch 7 times, most recently from f801d77 to dff7444 Compare April 19, 2025 06:23
@yihua yihua marked this pull request as ready for review April 19, 2025 06:33
@yihua yihua force-pushed the HUDI-9323-fix-config-copy branch from dff7444 to 6f9863e Compare April 19, 2025 06:34
@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@danny0405 danny0405 merged commit d847a76 into apache:master Apr 19, 2025
60 checks passed
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Hudi PR Support Apr 19, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.0.2 size:M PR with lines of changes in (100, 300]

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants