-
Notifications
You must be signed in to change notification settings - Fork 2.5k
refactor: Add Lombok annotations to hudi-common module (part 4) #17830
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
base: master
Are you sure you want to change the base?
Conversation
c9934a1 to
2864ffa
Compare
| this.fileName = fileName; | ||
| } | ||
|
|
||
| public String getPath() { |
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.
Can we keep this getter as getPath instead of getFullPath to minimize the diff?
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.
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); |
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.
Do you know if this is intentional or a bug?
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.
Let me check on this. We did experience something similar here too:
#17655 (comment)
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.
Seems to be a dev error from the getgo in the commit below way before Hudi was opensourced.
Specifically:
64fec64#diff-144d143726704055a5b8f62e80a881967611d9b0585cd268ec9ddc34add7d098R130-R161
Describe the issue this Pull Request addresses
This PR refactors the
hudi-commonmodule to reduce boilerplate code by leveraging Project Lombok annotations. Specifically, it replaces explicitLoggerinstantiation, 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-commonwill be split into multiple parts.The scope here mainly covers changes in:
hudi-common/src/main/java/org/apache/hudi/common/model/BaseFile.javahudi-common/src/main/java/org/apache/hudi/common/model/HoodieBaseFile.javaSummary and Changelog
This change introduces the Lombok dependency to the
hudi-commonmodule and refactors several classes to utilize Lombok annotations.hudi-commonmodule.Impact
Risk Level
none
(This is a pure refactoring change involving standard library annotations; no business logic was modified.)
Documentation Update
none
Contributor's checklist