You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2019/12/20 23:38:22 UTC

[atlas] branch master updated: ATLAS-3568: Performance improvements in writing audit logs #2

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

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


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

commit f5dcc7b7036414f3e382d172dbe10ed83be90bda
Author: Saqeeb Shaikh <sa...@cloudera.com>
AuthorDate: Sat Dec 21 02:46:28 2019 +0530

    ATLAS-3568: Performance improvements in writing audit logs #2
    
    Signed-off-by: Sarath Subramanian <sa...@apache.org>
---
 .../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);