[refactor] change IngestionParams to have better fields#561
Open
ybz1013 wants to merge 4 commits intolinkedin:masterfrom
Open
[refactor] change IngestionParams to have better fields#561ybz1013 wants to merge 4 commits intolinkedin:masterfrom
ybz1013 wants to merge 4 commits intolinkedin:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the ingestion parameter model to use a unified AspectMetadata wrapper for both request and response payloads, replacing the older IngestionAspectETag constructs.
- Replace
ingestionETagsarray with arequest_metadatafield of typeRequestMetadatainIngestionParams - Update
EbeanLocalDAOlogic and corresponding tests to extract optimistic locks fromAspectMetadatainstead ofIngestionAspectETag - Remove the old
IngestionAspectETagPDL schema and add new PDL records forAspectMetadata,RequestMetadata, andResponseMetadata
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dao-api/src/main/pegasus/com/linkedin/metadata/internal/IngestionParams.pdl | Replace ingestionETags with request_metadata: RequestMetadata |
| dao-api/src/main/pegasus/pegasus/com/linkedin/metadata/events/IngestionAspectETag.pdl | Remove deprecated IngestionAspectETag schema |
| dao-api/src/main/pegasus/pegasus/com/linkedin/metadata/aspect/AspectMetadata.pdl | Add new AspectMetadata schema |
| dao-api/src/main/pegasus/pegasus/com/linkedin/metadata/aspect/RequestMetadata.pdl | Add new RequestMetadata schema |
| dao-api/src/main/pegasus/pegasus/com/linkedin/metadata/aspect/ResponseMetadata.pdl | Add new ResponseMetadata schema |
| dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java | Refactor lock-extraction to iterate over RequestMetadata |
| dao-impl/ebean-dao/src/test/java/com/linkedin/metadata/dao/EbeanLocalDAOTest.java | Update tests to build and use RequestMetadata + AspectMetadata |
Comments suppressed due to low confidence (3)
dao-api/src/main/pegasus/com/linkedin/metadata/internal/IngestionParams.pdl:30
- [nitpick] Field 'request_metadata' mixes snake_case with other camelCase fields (e.g. testMode, trackingContext) in IngestionParams. Consider renaming to 'requestMetadata' for consistency.
request_metadata: optional RequestMetadata
dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java:622
- Consider adding a unit test for the case where
request_metadatais null or has an emptyaspect_metadataarray to verify that the method safely skips without errors.
final RequestMetadata requestMetadata = ingestionParams.getRequest_metadata();
dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanLocalDAO.java:625
- [nitpick] Consider adding a test with multiple
AspectMetadataentries inrequest_metadatato ensure the method correctly selects the matching alias among several items.
for (AspectMetadata aspectMetadata: requestMetadata.getAspect_metadata()) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The previous IngestionAspectETag was not uniform with the response type of AspectMetadata. Now, we are introducing AspectMetadata to wrap around metadata of aspects for both request and response payload.
Logic change needed in EbeanLocalDAO when extracting the etag.
Testing Done
./gradlw build
unit tests
Checklist