Skip to content

Conversation

@voonhous
Copy link
Member

@voonhous voonhous commented Jan 12, 2026

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.

The scope here mainly covers changes in:

  1. hudi-common/src/main/java/org/apache/hudi/common/model/BaseFile.java
  2. hudi-common/src/main/java/org/apache/hudi/common/model/HoodieBaseFile.java

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.

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

@github-actions github-actions bot added the size:XL PR with lines of changes > 1000 label Jan 12, 2026
@voonhous voonhous changed the title refactor: Add Lombok annotations to hudi-common module (part 4) refactor: Add Lombok annotations to hudi-common module (part 5) Jan 14, 2026
@voonhous voonhous changed the title refactor: Add Lombok annotations to hudi-common module (part 5) refactor: Add Lombok annotations to hudi-common module (part 4) Jan 14, 2026
@voonhous voonhous force-pushed the lombokify-hudi-common-p4 branch from c9934a1 to 2864ffa Compare January 14, 2026 18:59
@github-actions github-actions bot added size:L PR with lines of changes in (300, 1000] and removed size:XL PR with lines of changes > 1000 labels Jan 14, 2026
this.fileName = fileName;
}

public String getPath() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we keep this getter as getPath instead of getFullPath to minimize the diff?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, I've change the attribute/field to path from fullPath so that the getter generated by Lombok is getPath.

On top of that, i've added a comment. This will reduce scope of the changes.


@Override
public int hashCode() {
return Objects.hash(baseInstantTime, id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know if this is intentional or a bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me check on this. We did experience something similar here too:
#17655 (comment)

Copy link
Member Author

@voonhous voonhous Jan 15, 2026

Choose a reason for hiding this comment

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

Seems to be a dev error from the getgo in the commit below way before Hudi was opensourced.

Specifically:
64fec64#diff-144d143726704055a5b8f62e80a881967611d9b0585cd268ec9ddc34add7d098R130-R161

@github-actions github-actions bot added size:M PR with lines of changes in (100, 300] and removed size:L PR with lines of changes in (300, 1000] labels Jan 15, 2026
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants