nada-attia opened a new pull request, #18239: URL: https://github.com/apache/hudi/pull/18239
### Describe the issue this Pull Request addresses This PR introduces a pluggable pre-write validation framework that allows custom validators to run before write operations begin. This enables validation of conditions like schema compatibility, permissions, resource availability, and service onboarding status before proceeding with writes. Currently, Hudi only supports pre-commit validators that run after data has been written but before commit. This PR adds an earlier validation hook at the pre-write stage, allowing failures to be detected before any write work begins. ### Summary and Changelog **Summary**: Users can now configure custom validators that run before write operations via the `hoodie.prewrite.validators` configuration property. **Changelog**: - Added `PreWriteValidator` interface for implementing custom pre-write validators - Added `PreWriteValidatorUtils` utility class to load and run configured validators - Added `HoodiePreWriteValidatorConfig` configuration class with `hoodie.prewrite.validators` property - Modified `BaseHoodieWriteClient.preWrite()` to invoke configured validators - Added `getPreWriteValidators()` method to `HoodieWriteConfig` - Added unit tests for `PreWriteValidatorUtils` ### Impact - **New public API**: `PreWriteValidator` interface that users can implement for custom validators - **New configuration**: `hoodie.prewrite.validators` - comma-separated list of validator class names - No breaking changes to existing functionality - No performance impact when no validators are configured ### Risk Level low - This is an additive feature with no changes to existing write paths when no validators are configured. The feature is opt-in via configuration. ### Documentation Update The following documentation updates are needed: - Config description for `hoodie.prewrite.validators` is included in the code - Website documentation for the new pre-write validator feature should be added ### 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]
