refactor: Add Lombok Builder annotation to HoodieLogFormat #17785
+615
−502
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the issue this Pull Request addresses
The current implementation of
HoodieLogFormat.WriterBuilderis convoluted:HoodieLogFormatinterface.ReflectionUtilsto load the default writer implementation via a String class name, which is brittle and bypasses compile-time checks, a change introduced in #11207 to decouplehudi-commonwith hadoop dependenciesThis PR refactors the log writer to use Lombok's
@Builder, standardizing the fluent API and improving type safety across the codebase.Summary and Changelog
This refactor simplifies the construction of
HoodieLogFormatwriters by leveraging Lombok and improving the class hierarchy.Key Changes:
HoodieLogFormat.Writerfrom an interface to an abstract class to centralize shared fields and construction logic.Writerbase constructor. This ensures that all writer implementations follow the same versioning and path-generation logic.@Builderto theHoodieLogFormatWriterconstructor, replacing the manualWriterBuilder.withprefix).TestHoodieLogWriterBuildertoTestHoodieLogFormatWriterBuilderto reflect the new structure.Impact
onParentPathis nowwithParentPath).HoodieLogFormat.Risk Level
Low. This is a structural refactor. The core logic for log writing and versioning remains unchanged, just relocated to the base class constructor.
Documentation Update
None
Contributor's checklist