vinothchandar opened a new pull request, #19192:
URL: https://github.com/apache/hudi/pull/19192
### Describe the issue this Pull Request addresses
hudi-client-common's package layout has grown organically: single-class
packages (optimize, nested callback/client/http), grab-bag util packages
(client.utils vs util in the same module), 1–2-file version subpackages, and
classes homed away from their consumers. This PR reorganizes the module's
internal packages for coherent, feature-based grouping, as part of the pre-2.0
cleanup effort. Marked ! for one deliberate compatibility break (record
size estimator, detailed under Impact).
### Summary and Changelog
Plain English: no behavior changes — classes are relocated to packages that
match what they do, dead code is removed, and pointless nesting is flattened.
Class names never change; only package paths do, and only for internal
classes. Every class that is user-pluggable by FQN (lock providers,
conflict strategies, bootstrap selectors/translators, commit callbacks, merge
handles, WriteStatus, validators) was audited and deliberately left untouched
— with the single exception called out below.
- Delete dead code: util.HttpRequestClient, client.utils.MergingIterator,
client.utils.ClosableMergingIterator (zero usages repo-wide)
- optimize.HilbertCurveUtils → hudi-spark-client o.a.h.sort (sole
consumer); the hilbert-curve dependency moves with it and is dropped from the
flink/kafka-connect bundle shade lists (no longer in their dependency tree)
- util.DistributedRegistryUtil → hudi-spark-client o.a.h.metrics;
util.ExecutorFactory → o.a.h.execution
- Dissolve client.utils: archival classes → client.timeline;
TransactionUtils → client.transaction; PreWriteValidatorUtils →
client.validator; DeletePartitionUtils → table.action.commit;
FileSliceMetricUtils → table.action;
generic iterators + OperationConverter → o.a.h.util
- Flatten client/timeline/versioning/{v1,v2} (3 files) into client.timeline
- Flatten client/transaction/lock/{models,metrics} (7 files) into
client.transaction.lock; fold callback/util into callback and
callback/client/http into callback.impl
- Fold index/{inmemory,simple} (3 classes, enum-instantiated) into index;
client.HoodieColumnStatsIndexUtils → o.a.h.metadata
- Carve o.a.h.io.cdc for the 7 internal CDC log-writing classes
(HoodieCDCLogWriterFactory widens to public)
- o.a.h.estimator.* (3 classes) → o.a.h.execution.estimator (breaking, see
below)
- Tidy o.a.h.client root: BaseCompactor/BaseClusterer → o.a.h.async;
CommitMetadataResolver family → table.action.commit;
StreamingMetadataWriteHandler → o.a.h.metadata (getMetadataWriter widens to
protected for
cross-package engine subclasses)
Tests move with their subjects. No code was copied.
### Impact
No config keys, semantics, storage formats, or runtime behavior change. Two
API surfaces are affected:
1. Breaking (the !): RecordSizeEstimator (@PublicAPIClass) and its impls
move to o.a.h.execution.estimator. Users who explicitly set
hoodie.record.size.estimator.class=org.apache.hudi.estimator.AverageRecordSizeEstimator
get
a loud ClassNotFoundException (fix: update the value); externally compiled
custom estimators need an import change + recompile. The config default tracks
the move automatically; expected user impact is minimal since few
users override this advanced config. No compat stub: the whole hierarchy
moves together, so every failure is a loud class-load error — silent
misbehavior is not possible.
2. All other moved classes are internal (no @PublicAPIClass, no config-FQN
references, no reflection/Kryo exposure — grep-audited): external code
deep-importing them breaks loudly at compile/link.
No performance impact.
### Risk Level
Low. Verification: full reactor build under -Dspark4.1 and -Dflink2.1
including all bundles; ~200 targeted tests across the relocated suites
(iterators, validators, transactions, archival, lock, callback, index,
estimator,
merge-handle factory, write/table-service clients); checkstyle +
scalastyle on all touched modules; bundle-content audit confirming relocated
classes and the hilbert library land in the correct jars (spark bundle) and
dropped where unused (flink bundle).
### Documentation Update
The hoodie.record.size.estimator.class config description is updated
in-code to the new FQNs (docs-site config pages regenerate from it). Release
notes for the next release should mention the estimator package move; no other
user-facing docs change.
### 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]