atlas git commit: ATLAS-2697: audit log shows 'Propagated classification added' for directly associatied classification
Repository: atlas Updated Branches: refs/heads/branch-1.0 7d3d2fc75 -> 9f443cb7f ATLAS-2697: audit log shows 'Propagated classification added' for directly associatied classification Signed-off-by: Madhan Neethiraj(cherry picked from commit 8f9813307c79ff27113dca6adb3bf47c51a23fc1) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9f443cb7 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9f443cb7 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9f443cb7 Branch: refs/heads/branch-1.0 Commit: 9f443cb7fbf6aeb04370537bf1c099a46501f9a9 Parents: 7d3d2fc Author: Sarath Subramanian Authored: Wed May 16 23:19:08 2018 -0700 Committer: Madhan Neethiraj Committed: Thu May 17 07:35:22 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/9f443cb7/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 entitiesToPropagateTo = null; Map propagations = null; +List 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 { StringentityGuid = GraphHelper.getGuid(vertex); AtlasEntityWithExtInfoentityWithExtInfo= instanceConverter.getAndCacheEntity(entityGuid); AtlasEntity entity = (entityWithExtInfo != null) ? entityWithExtInfo.getEntity() : null; -List addedClassifications = StringUtils.equals(entityGuid, guid) ? classifications : propagations.get(vertex); +List addedClassifications = StringUtils.equals(entityGuid, guid) ? addClassifications : propagations.get(vertex); if (CollectionUtils.isNotEmpty(addedClassifications)) { entityChangeNotifier.onClassificationAddedToEntity(entity, addedClassifications);
atlas git commit: ATLAS-2697: audit log shows 'Propagated classification added' for directly associatied classification
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 NeethirajProject: 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 Authored: Wed May 16 23:19:08 2018 -0700 Committer: Madhan Neethiraj 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 entitiesToPropagateTo = null; Map propagations = null; +List 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 { StringentityGuid = GraphHelper.getGuid(vertex); AtlasEntityWithExtInfoentityWithExtInfo= instanceConverter.getAndCacheEntity(entityGuid); AtlasEntity entity = (entityWithExtInfo != null) ? entityWithExtInfo.getEntity() : null; -List addedClassifications = StringUtils.equals(entityGuid, guid) ? classifications : propagations.get(vertex); +List addedClassifications = StringUtils.equals(entityGuid, guid) ? addClassifications : propagations.get(vertex); if (CollectionUtils.isNotEmpty(addedClassifications)) { entityChangeNotifier.onClassificationAddedToEntity(entity, addedClassifications);