Commit f5dcc7b7 by Saqeeb Shaikh Committed by Sarath Subramanian

ATLAS-3568: Performance improvements in writing audit logs #2

parent fb9f1e96
......@@ -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);
......
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