Commit 8f981330 by Sarath Subramanian Committed by Madhan Neethiraj

ATLAS-2697: audit log shows 'Propagated classification added' for directly…

ATLAS-2697: audit log shows 'Propagated classification added' for directly associatied classification Signed-off-by: 's avatarMadhan Neethiraj <madhan@apache.org>
parent c2d927e0
...@@ -1280,6 +1280,7 @@ public class EntityGraphMapper { ...@@ -1280,6 +1280,7 @@ public class EntityGraphMapper {
final AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entityTypeName); final AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entityTypeName);
List<AtlasVertex> entitiesToPropagateTo = null; List<AtlasVertex> entitiesToPropagateTo = null;
Map<AtlasVertex, List<AtlasClassification>> propagations = null; Map<AtlasVertex, List<AtlasClassification>> propagations = null;
List<AtlasClassification> addClassifications = new ArrayList<>(classifications.size());
for (AtlasClassification c : classifications) { for (AtlasClassification c : classifications) {
AtlasClassification classification = new AtlasClassification(c); AtlasClassification classification = new AtlasClassification(c);
...@@ -1360,6 +1361,8 @@ public class EntityGraphMapper { ...@@ -1360,6 +1361,8 @@ public class EntityGraphMapper {
LOG.debug(" --> Not propagating classification: [{}][{}] - propagation is disabled.", getTypeName(classificationVertex), entityTypeName); LOG.debug(" --> Not propagating classification: [{}][{}] - propagation is disabled.", getTypeName(classificationVertex), entityTypeName);
} }
} }
addClassifications.add(classification);
} }
// notify listeners on classification addition // notify listeners on classification addition
...@@ -1373,7 +1376,7 @@ public class EntityGraphMapper { ...@@ -1373,7 +1376,7 @@ public class EntityGraphMapper {
String entityGuid = GraphHelper.getGuid(vertex); String entityGuid = GraphHelper.getGuid(vertex);
AtlasEntityWithExtInfo entityWithExtInfo = instanceConverter.getAndCacheEntity(entityGuid); AtlasEntityWithExtInfo entityWithExtInfo = instanceConverter.getAndCacheEntity(entityGuid);
AtlasEntity entity = (entityWithExtInfo != null) ? entityWithExtInfo.getEntity() : null; 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)) { if (CollectionUtils.isNotEmpty(addedClassifications)) {
entityChangeNotifier.onClassificationAddedToEntity(entity, addedClassifications); entityChangeNotifier.onClassificationAddedToEntity(entity, addedClassifications);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment