cshuo opened a new pull request, #19400:
URL: https://github.com/apache/hudi/pull/19400
### Describe the issue this Pull Request addresses
Closes #19398.
The Flink sink append buffer variants and dynamic bucket assignment paths
had substantial unit-test coverage gaps. The existing end-to-end drivers are
integration-test-only, so these paths need focused unit tests that run in the
regular Maven/Codecov workflow.
### Summary and Changelog
- Exercise continuous-sort, Disruptor, and bounded in-memory append buffers
through the Flink test harness.
- Verify buffer selection, checkpoint flushing, write statuses, partitioned
output, and cleanup.
- Add unit coverage for dynamic bucket assignment of existing and new record
keys and its checkpoint lifecycle.
- Extend record-level-index backend tests for lazy cache creation,
checkpoint-aware eviction, dictionary encoding, and cache-size inference.
- Cover `BulkInsertWriterHelper` constructor and error-wrapping paths.
- Initialize and close append-buffer resources in `InsertFunctionWrapper`.
Local JaCoCo line coverage from the targeted suite:
| Class | Before | After |
| --- | ---: | ---: |
| `AppendWriteFunctionWithContinuousSort` | 0% | 76.7% |
| `AppendWriteFunctionWithDisruptorBufferSort` | 0% | 79.4% |
| `AppendWriteFunctionWithBIMBufferSort` | 0% | 77.6% |
| `DynamicBucketAssignFunction` | 0% | 97.9% |
| `RecordLevelIndexBackend` | 56% | 75.2% |
| `BulkInsertWriterHelper` | 71% | 79.6% |
Validation:
```bash
mvn -Punit-tests -pl hudi-flink-datasource/hudi-flink -am \
-Dtest=TestAppendWriteFunction,TestAppendWriteFunctionWithBufferSort,TestAppendWriteFunctionWithBIMBufferSort,TestDynamicBucketAssignFunction,TestRecordLevelIndexBackend,TestBulkInsertWriteHelper
\
-Dsurefire.failIfNoSpecifiedTests=false \
-DskipITs -DskipSparkTests -DskipScalaTests test
```
Result: 42 tests run, 0 failures, 0 errors, 0 skipped.
### Impact
No public API or user-facing behavior changes. This PR only adds tests and
improves test-harness resource cleanup.
### Risk Level
Low. Production code is unchanged, and the targeted Maven reactor build,
Checkstyle, RAT, and JaCoCo report all completed successfully.
### Documentation Update
None.
### Contributor's checklist
- [ ] 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]