This is an automated email from the ASF dual-hosted git repository.

sarath pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new ec70a66  ATLAS-3568: Performance improvements in writing audit logs #2
ec70a66 is described below

commit ec70a669782e59457ed50b13e92497386d4e9a1c
Author: Saqeeb Shaikh <[email protected]>
AuthorDate: Sat Dec 21 02:46:28 2019 +0530

    ATLAS-3568: Performance improvements in writing audit logs #2
    
    Signed-off-by: Sarath Subramanian <[email protected]>
    (cherry picked from commit f5dcc7b7036414f3e382d172dbe10ed83be90bda)
---
 .../atlas/repository/store/graph/v2/EntityGraphMapper.java  | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
index 765ba36..e427a59 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
@@ -1755,6 +1755,11 @@ public class EntityGraphMapper {
                 // add the attributes for the trait instance
                 mapClassification(EntityOperation.CREATE, context, 
classification, entityType, entityVertex, classificationVertex);
                 updateModificationMetadata(entityVertex);
+                if(addedClassifications.get(classification) == null) {
+                    addedClassifications.put(classification, new HashSet<>());
+                }
+                //Add current Vertex to be notified
+                addedClassifications.get(classification).add(entityVertex);
 
                 if (propagateTags) {
                     // compute propagatedEntityVertices only once
@@ -1770,11 +1775,7 @@ public class EntityGraphMapper {
                         List<AtlasVertex> entitiesPropagatedTo = 
deleteDelegate.getHandler().addTagPropagation(classificationVertex, 
entitiesToPropagateTo);
 
                         if (CollectionUtils.isNotEmpty(entitiesPropagatedTo)) {
-                            if(addedClassifications.get(classification) == 
null) {
-                                addedClassifications.put(classification, new 
HashSet<>(entitiesPropagatedTo));
-                            } else {
-                                
addedClassifications.get(classification).addAll(entitiesPropagatedTo);
-                            }
+                            
addedClassifications.get(classification).addAll(entitiesPropagatedTo);
                         }
                     } else {
                         if (LOG.isDebugEnabled()) {
@@ -1801,7 +1802,7 @@ public class EntityGraphMapper {
                 Set<AtlasVertex>  vertices           = 
addedClassifications.get(classification);
                 List<AtlasEntity> propagatedEntities = 
updateClassificationText(classification, vertices);
 
-                
entityChangeNotifier.onClassificationsAddedToEntities(propagatedEntities, 
classifications);
+                
entityChangeNotifier.onClassificationsAddedToEntities(propagatedEntities, 
Collections.singletonList(classification));
             }
 
             RequestContext.get().endMetricRecord(metric);

Reply via email to