Commit 1d2aad52 by Madhan Neethiraj

ATLAS-3297: cache added/update entities in request-context, for use in entity-change listeners

parent 4ce1e370
......@@ -196,6 +196,7 @@ public class EntityGraphMapper {
MetricRecorder metric = RequestContext.get().startMetricRecord("mapAttributesAndClassifications");
EntityMutationResponse resp = new EntityMutationResponse();
RequestContext reqContext = RequestContext.get();
Collection<AtlasEntity> createdEntities = context.getCreatedEntities();
Collection<AtlasEntity> updatedEntities = context.getUpdatedEntities();
......@@ -212,6 +213,8 @@ public class EntityGraphMapper {
resp.addEntity(CREATE, constructHeader(createdEntity, entityType, vertex));
addClassifications(context, guid, createdEntity.getClassifications());
reqContext.cache(createdEntity);
}
}
......@@ -231,10 +234,12 @@ public class EntityGraphMapper {
resp.addEntity(UPDATE, constructHeader(updatedEntity, entityType, vertex));
}
if ( replaceClassifications ) {
if (replaceClassifications) {
deleteClassifications(guid);
addClassifications(context, guid, updatedEntity.getClassifications());
}
reqContext.cache(updatedEntity);
}
}
......
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