Skip to content

Conversation

@voonhous
Copy link
Member

@voonhous voonhous commented Dec 20, 2025

Describe the issue this Pull Request addresses

This PR refactors the hudi-common module to reduce boilerplate code by leveraging Project Lombok annotations. Specifically, it replaces explicit Logger instantiation, manual getter/setter methods, and empty constructors with their equivalent Lombok annotations (@Slf4j, @Getter, @Setter,@NoArgsConstructor, @AllArgsConstructor, @Data, @Value, @ToString).

This improves code readability and maintainability without altering the runtime logic.

To make the PR more manageable, adding Lombok to hudi-common will be split into multiple parts.

Summary and Changelog

This change introduces the Lombok dependency to the hudi-common module and refactors several classes to utilize Lombok annotations.

  • Added lombok annotations wherever possible to hudi-common module.

This PR covers:

  1. hudi-common/src/main/java/org/apache/hudi/internal/schema
  2. hudi-common/src/main/java/org/apache/hudi/io/storage
  3. hudi-common/src/main/java/org/apache/hudi/keygen
  4. hudi-common/src/main/java/org/apache/hudi/metadata
  5. hudi-common/src/main/java/org/apache/hudi/metrics
  6. hudi-common/src/main/java/org/apache/hudi/stats
  7. hudi-common/src/main/java/org/apache/hudi/timeline

Impact

  • Public API: None.
  • User Experience: No visible change for end-users.
  • Performance: No impact (compile-time code generation).
  • Code Health: Reduces lines of code and standardizes logging/accessor patterns.

Risk Level

none

(This is a pure refactoring change involving standard library annotations; no business logic was modified.)

Documentation Update

none

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

@voonhous voonhous requested a review from yihua December 20, 2025 07:18
@voonhous
Copy link
Member Author

Subsequent PRs that will be raised after this will cover hudi/hudi-common/src/main/java/org/apache/hudi/common/*.

The refactoring will touch 100++ files, I'll be splitting the changes within this directory into smaller PRs to make reviewing manageable.

Comment on lines 146 to 147
return this.versionId;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We could change this field to schemaId, and rename this function to getSchemaId (which will be generated by @Getter), but I'm afraid of exploding this PR. So am gonna retain this for now. We can circle back later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. We can leave it alone for now.

@github-actions github-actions bot added the size:XL PR with lines of changes > 1000 label Dec 20, 2025
@voonhous voonhous force-pushed the lombokify-hudi-common-p2 branch 2 times, most recently from 625d9e5 to d11777e Compare December 25, 2025 22:51
@voonhous voonhous force-pushed the lombokify-hudi-common-p2 branch from d5aace1 to 11d8ef7 Compare December 26, 2025 18:19
Copy link
Contributor

@CTTY CTTY left a comment

Choose a reason for hiding this comment

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

LGTM in general! Just some minor improvements on logging can be added

@apache apache deleted a comment from hudi-bot Jan 8, 2026
@hudi-bot
Copy link
Collaborator

hudi-bot commented Jan 9, 2026

CI report:

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

@CTTY CTTY merged commit 3dfe2cd into apache:master Jan 9, 2026
72 checks passed
Copy link
Contributor

@yihua yihua left a comment

Choose a reason for hiding this comment

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

LGTM

@voonhous voonhous deleted the lombokify-hudi-common-p2 branch January 10, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL PR with lines of changes > 1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants