Repository: atlas Updated Branches: refs/heads/master c2d927e0b -> 8f9813307
ATLAS-2697: audit log shows 'Propagated classification added' for directly associatied classification Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/8f981330 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/8f981330 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/8f981330 Branch: refs/heads/master Commit: 8f9813307c79ff27113dca6adb3bf47c51a23fc1 Parents: c2d927e Author: Sarath Subramanian <ssubraman...@hortonworks.com> Authored: Wed May 16 23:19:08 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu May 17 07:30:11 2018 -0700 ---------------------------------------------------------------------- .../atlas/repository/store/graph/v1/EntityGraphMapper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/8f981330/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java index 8344b70..debb441 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java @@ -1280,6 +1280,7 @@ public class EntityGraphMapper { final AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entityTypeName); List<AtlasVertex> entitiesToPropagateTo = null; Map<AtlasVertex, List<AtlasClassification>> propagations = null; + List<AtlasClassification> addClassifications = new ArrayList<>(classifications.size()); for (AtlasClassification c : classifications) { AtlasClassification classification = new AtlasClassification(c); @@ -1360,6 +1361,8 @@ public class EntityGraphMapper { LOG.debug(" --> Not propagating classification: [{}][{}] - propagation is disabled.", getTypeName(classificationVertex), entityTypeName); } } + + addClassifications.add(classification); } // notify listeners on classification addition @@ -1373,7 +1376,7 @@ public class EntityGraphMapper { String entityGuid = GraphHelper.getGuid(vertex); AtlasEntityWithExtInfo entityWithExtInfo = instanceConverter.getAndCacheEntity(entityGuid); AtlasEntity entity = (entityWithExtInfo != null) ? entityWithExtInfo.getEntity() : null; - List<AtlasClassification> addedClassifications = StringUtils.equals(entityGuid, guid) ? classifications : propagations.get(vertex); + List<AtlasClassification> addedClassifications = StringUtils.equals(entityGuid, guid) ? addClassifications : propagations.get(vertex); if (CollectionUtils.isNotEmpty(addedClassifications)) { entityChangeNotifier.onClassificationAddedToEntity(entity, addedClassifications);