Commit 66c2964e by Sarath Subramanian Committed by Madhan Neethiraj

ATLAS-3036: Improve FullTextMapper performance during entity retrieval

(cherry picked from commit a08a5a39a83fcfee0965471a3a1b1c29279feea3) (cherry picked from commit 7ff396af047c8ff829dbe5b8a4094177fb3e9686) (cherry picked from commit 2fdbc851db06f7ebe96cc3fde4d8507d088e7ec6)
parent 9f71b529
...@@ -131,7 +131,7 @@ public class FullTextMapperV2 { ...@@ -131,7 +131,7 @@ public class FullTextMapperV2 {
entity = entityWithExtInfo != null ? entityWithExtInfo.getEntity() : null; entity = entityWithExtInfo != null ? entityWithExtInfo.getEntity() : null;
entityExtInfo = entityWithExtInfo; entityExtInfo = entityWithExtInfo;
} else { } else {
entity = getAndCacheEntity(guid); entity = getAndCacheEntity(guid, false);
entityExtInfo = null; entityExtInfo = null;
} }
...@@ -272,11 +272,15 @@ public class FullTextMapperV2 { ...@@ -272,11 +272,15 @@ public class FullTextMapperV2 {
} }
private AtlasEntity getAndCacheEntity(String guid) throws AtlasBaseException { private AtlasEntity getAndCacheEntity(String guid) throws AtlasBaseException {
return getAndCacheEntity(guid, true);
}
private AtlasEntity getAndCacheEntity(String guid, boolean includeReferences) throws AtlasBaseException {
RequestContext context = RequestContext.get(); RequestContext context = RequestContext.get();
AtlasEntity entity = context.getEntity(guid); AtlasEntity entity = context.getEntity(guid);
if (entity == null) { if (entity == null) {
entity = entityGraphRetriever.toAtlasEntity(guid); entity = entityGraphRetriever.toAtlasEntity(guid, includeReferences);
if (entity != null) { if (entity != null) {
context.cache(entity); context.cache(entity);
......
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