Skip to content

Commit

Permalink
Merge pull request #3122 from atlanhq/DQ-38
Browse files Browse the repository at this point in the history
Add differential entity details for kafka event on DataContract Update
  • Loading branch information
bichitra95 authored Jun 11, 2024
2 parents 2e90c35 + ef2d14a commit 5ddb220
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ private void updateExistingVersion(EntityMutationContext context, AtlasEntity en
AtlasEntityType entityType = ensureEntityType(entity.getTypeName());

context.addUpdated(entity.getGuid(), entity, entityType, vertex);
recordEntityMutatedDetails(context, entity, vertex);

}

Expand Down Expand Up @@ -283,11 +284,14 @@ private void datasetAttributeSync(EntityMutationContext context, AtlasEntity ass

AtlasVertex vertex = AtlasGraphUtilsV2.findByGuid(entity.getGuid());
AtlasEntityType entityType = ensureEntityType(entity.getTypeName());
context.addUpdated(entity.getGuid(), entity, entityType, vertex);
recordEntityMutatedDetails(context, entity, vertex);
}

private void recordEntityMutatedDetails(EntityMutationContext context, AtlasEntity entity, AtlasVertex vertex) throws AtlasBaseException {
AtlasEntityComparator entityComparator = new AtlasEntityComparator(typeRegistry, entityRetriever, context.getGuidAssignments(), true, true);
AtlasEntityComparator.AtlasEntityDiffResult diffResult = entityComparator.getDiffResult(entity, vertex, !storeDifferentialAudits);
RequestContext reqContext = RequestContext.get();
context.addUpdated(entity.getGuid(), entity, entityType, vertex);

if (diffResult.hasDifference()) {
if (storeDifferentialAudits) {
diffResult.getDiffEntity().setGuid(entity.getGuid());
Expand Down

0 comments on commit 5ddb220

Please sign in to comment.