-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update respective index with the assets #13843
Conversation
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
@@ -114,10 +116,14 @@ private void updateAssets() { | |||
// Remove assets that were deleted | |||
for (EntityReference asset : deleted) { | |||
deleteRelationship(original.getId(), DATA_PRODUCT, asset.getId(), asset.getType(), Relationship.HAS); | |||
EntityInterface entityInterface = Entity.getEntity(asset, "*", Include.ALL); | |||
searchRepository.updateEntity(entityInterface); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you calling this inline, why can't we do this in post updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed the change, @karanh37 can you please verify from you end is it working as expected ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified on UI, changes are working fine for Data Product.
…com/open-metadata/OpenMetadata into updateAssetsRelationshipDataProduct
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/DataProductRepository.java
Outdated
Show resolved
Hide resolved
[open-metadata-ingestion] Kudos, SonarCloud Quality Gate passed! |
listOrEmpty(original.getAssets()).forEach(asset -> assetsMap.put(asset.getId().toString(), asset)); | ||
listOrEmpty(updated.getAssets()).forEach(asset -> assetsMap.put(asset.getId().toString(), asset)); | ||
for (EntityReference assetRef : assetsMap.values()) { | ||
EntityInterface asset = Entity.getEntity(assetRef, "*", Include.ALL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we making this call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to penalize the post/put operations on data product as we are making additional calls. Also it looks like this will be triggered on any update to the data product such as description updates , ownership cc @mohityadav766
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshach , beacuse of this i was thinking and added it to the only in entitySpicificUpdates while doing updateAssets to avoid unnecessary calls. in this as we need to update the indexes of assets which are added, removed or update.
* update respective index with the assets * checkstyle * addressing comments * add listorempty
I worked on ... because ... update respective index with the assets
Type of change: