vinothchandar opened a new pull request, #19212: URL: https://github.com/apache/hudi/pull/19212
### Describe the issue this Pull Request addresses Consolidation sweep of `*Utils` classes across `hudi-io`, `hudi-common`, `hudi-hadoop-common`, `hudi-client-common`, and `hudi-hadoop-mr`. The utils layer had accumulated dead methods, byte-identical duplicates, tiny single-caller classes, same-name/different-purpose class collisions, and the same logic re-implemented per type (`Properties` vs Hadoop `Configuration`, `Path` vs `StoragePath`, Avro `Schema` vs `HoodieSchema`). This PR removes the accidental duplication while deliberately leaving semantically distinct near-twins in place (documented per commit). ### Summary and Changelog No user-facing behavior change; internal code consolidation (8 classes deleted, ~1,200 duplicated/dead lines removed) plus two small latent bug fixes surfaced by the refactor. One commit per concern, reviewable independently: - **Dead code + duplicate removal**: delete empty `ActiveTimelineUtils`, dead `HadoopFSUtils`/`HadoopConfigUtils`/`TableServiceUtils` methods; dedupe `IOUtils` vs `FileIOUtils` stream helpers, `convertBytesToBigDecimal`, `StringUtils` private null-check. - **Fold six single-use classes into natural homes**: `ArrayUtils`→`CollectionUtils`, `HadoopInLineFSUtils`→callers/`HadoopStorageConfiguration`/`InLineFileSystem`, `HoodieColumnStatsIndexUtils`→`HoodieMetadataWriteUtils`, `InputSplitUtils`→`RealtimeSplit`, `HoodieIncrSourceCheckpointValUtils`→`CheckpointUtils`, `ThreadUtils`→`PulsarSource`. - **Rename five colliding class names**: `KafkaCheckpointUtils`, `HFileByteUtils`, `MergeUtils`, `WriterHeartbeatUtils`, `SecondaryIndexDefinitionUtils` (pure renames). - **Cross-type dedup**: `HadoopConfigUtils` alt-key reader delegates to a new `Function`-based `ConfigUtils` overload; hadoop-mr table-path resolution delegates to `TablePathUtils`; `ShowInvalidParquetProcedure` moves to the `HoodieStorage` listing API; record reconstruction moves from `SpillableMapUtils` to `HoodieAvroUtils` (its only caller); `RepairUtils` uses `TimelineUtils#getCommitMetadata`; new `TimelineUtils#findLatestInCommitMetadata` absorbs two copies of the reverse-instant scan; two private `unwrapNullable` copies replaced by the canonical helpers; three byte-identical iterator methods pulled up from `ParquetUtils`/`OrcUtils`/`LanceUtils` into `FileFormatUtils`. - **Bug fixes**: `TablePathUtils` parent walk crashed (`IllegalStateException`) instead of returning empty for non-Hudi paths walked to the filesystem root (exposed by the delegation; unit test added); `ValidationUtils#checkState(boolean, Supplier)` threw `IllegalArgumentException` instead of `IllegalStateException` (copy-paste; zero callers today; contract test added). Also `RestoreUtils` now calls `getRestoreRequestedInstant` instead of the rollback variant (identical behavior in both `InstantGenerator` impls). No code copied from external projects (the `toPrimitive` javadoc retains its existing commons-lang3 attribution). ### Impact None on public APIs or user-facing behavior. Renamed/deleted classes are internal utils; all references across Java and Scala were migrated and verified (including reflection string-literal scans). ### Risk Level Low. Every commit was independently verified: full 52-module build plus a 41-class battery (~680 tests) across the touched modules, all green (one pre-existing timezone-sensitive failure in `TestHoodieActiveTimeline#testParseDateFromInstantTime`, unrelated). Two rebases onto the ongoing package-reorg commits were certified by comparing pre-/post-rebase diffs hunk-by-hunk. ### Documentation Update None (no configs or user-facing changes). ### 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]
