SaketaChalamchala opened a new pull request, #10778: URL: https://github.com/apache/ozone/pull/10778
## What changes were proposed in this pull request? Developed with the help of Cursor AI. This PR is intended as the foundation for a more efficient snapshot diff ([HDDS-9154](https://issues.apache.org/jira/browse/HDDS-9154)). Baseline snapshot diff reports order entries by diff type (`DELETE`s first, then `RENAME`/`CREATE`/`MODIFY`). That ordering is not always safe to replay. For example, if `A/B` is renamed to `C/B` and directory `A` is deleted, replaying the `DELETE` before the `RENAME` fails on because the rename source no longer exists. This PR adds isolated utilities for dependency-ordered snapshot diff report generation. **SnapDiffDependencyEntry** - Wraps a classified diff entry with objectId, parentObjectId, and the underlying DiffReportEntry - Provides the metadata needed to build hierarchy and path-conflict edges **SnapDiffDependencyGraph** - Accepts a list of SnapDiffDependencyEntry values and builds a directed dependency graph in the constructor - Applies these dependency rules defined via directed edges (u -> v means u must appear before v): - Parent CREATE/RENAME/MODIFY before child CREATE/RENAME/MODIFY - Child DELETE before parent DELETE - Non-delete entry before DELETE of its parent object - DELETE before CREATE/RENAME(target) that targets the same path - RENAME(source) before CREATE that targets the same path - Exposes getOrderedEntries() using Kahn's algorithm - Exposes static toOrderedReportEntries() to convert ordered dependency entries into DiffReportEntry payloads ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-15390 ## How was this patch tested? Unit Test. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
