voonhous opened a new pull request, #20766:
URL: https://github.com/apache/hudi/pull/20766
### Describe the issue this Pull Request addresses
Some classes in `hudi-client` still declare their logger by hand (`static
final Logger LOG = LoggerFactory.getLogger(...)`) instead of the Lombok
`@Slf4j` annotation the codebase has standardized on. This PR migrates them.
Continues #19190 (flink) of the logging cleanup.
### Summary and Changelog
- Per file: add `@Slf4j`, delete the `LOG` field and the `org.slf4j.Logger`
/ `org.slf4j.LoggerFactory` imports, and rename `LOG` -> `log` (Lombok
generates a lowercase `log`).
- Migrated 26 classes across `hudi-client-common`, `hudi-spark-client`,
`hudi-flink-client` and `hudi-java-client` (main and test).
- `FlinkSizeBasedClusteringPlanStrategyRecently` logged under its parent
class, so it uses `@Slf4j(topic = ...)` to keep the category.
- Subclasses that used an inherited `LOG` (`DirectMarkerTransactionManager`,
`HoodieBackedTableMetadataWriterTableVersionSix`, and three
`HoodieClientTestBase` tests in `hudi-spark`) get their own `@Slf4j`.
- One string-concatenated `warn` in `OneToTwoUpgradeHandler` now uses `{}`.
- Left hand-declared: `RunsTableService` (interface, `@Slf4j` is class-only).
<details><summary>Logger category changes</summary>
Five loggers were copied from an unrelated class and now log under their own
name:
- `RegexRuleEngine` (was `PartitionBucketIndexCalculator`)
- `SparkHoodieBackedTableMetadataWriterTableVersionSix` (was
`SparkHoodieBackedTableMetadataWriter`)
- `BaseBootstrapMetadataHandler` (was its subclass
`ParquetBootstrapMetadataHandler`)
- `SparkPartitionTTLActionExecutor` (was
`ConsistentBucketBulkInsertDataInternalWriterHelper`)
- `TestHoodieSparkEngineDynamicRepartition` (was
`HoodieBackedTestDelayedTableMetadata`)
The subclasses listed above also log under their own name instead of the
parent's.
</details>
### Impact
Log messages are unchanged. A few classes now log under their own class name
instead of a copied or parent one (see the dropdown).
### Risk Level
low - mechanical rename, no logic change.
### Documentation Update
none
### Contributor's checklist
- [x] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [x] Enough context is provided in the sections above
- [x] Adequate tests were added if applicable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]