Skip to content

refactor: Add Lombok annotations to hudi-java-client module#17588

Merged
yihua merged 2 commits intoapache:masterfrom
voonhous:hudi-java-client-lomokify
Dec 16, 2025
Merged

refactor: Add Lombok annotations to hudi-java-client module#17588
yihua merged 2 commits intoapache:masterfrom
voonhous:hudi-java-client-lomokify

Conversation

@voonhous
Copy link
Member

Describe the issue this Pull Request addresses

This PR refactors the hudi-java-client 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.

Summary and Changelog

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

  • Added lombok annotations wherever possible to hudi-java-client 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:M PR with lines of changes in (100, 300] label Dec 13, 2025
@yihua
Copy link
Contributor

yihua commented Dec 13, 2025

@CTTY Could you review this PR?

@voonhous
Copy link
Member Author

Nothing much to change in this, they are mainly just @Slf4j annotated.

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! Only some minor comments

import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove the LoggerFactory as well?

Copy link
Member Author

@voonhous voonhous Dec 15, 2025

Choose a reason for hiding this comment

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

Good catch! Thought i removed all of them T.T.
Addressed!

final String instantTime, final Map<String, String> strategyParams, final Schema schema,
final List<HoodieFileGroupId> fileGroupIdList, final boolean preserveHoodieMetadata) {
LOG.info("Starting clustering for a group, parallelism:" + numOutputGroups + " commit:" + instantTime);
log.info("Starting clustering for a group, parallelism:" + numOutputGroups + " commit:" + instantTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it would be better if we just go with parameterized logging:

log.info("Starting clustering for a group, parallelism:{} commit:{}", numOutputGroups, instantTime);

Copy link
Member Author

@voonhous voonhous Dec 15, 2025

Choose a reason for hiding this comment

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

Yeap, definitely!
Addressed!

@voonhous voonhous requested a review from CTTY December 15, 2025 04:16
@voonhous voonhous force-pushed the hudi-java-client-lomokify branch from a7cb6e1 to fddad56 Compare December 15, 2025 05:54
@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

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! There are many other loggings that can be parameterized, but I don't think they should block this PR

@yihua yihua merged commit 175fb79 into apache:master Dec 16, 2025
262 of 271 checks passed
@voonhous voonhous deleted the hudi-java-client-lomokify branch December 16, 2025 05:18
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.

4 participants