> On July 23, 2020, 10:50 p.m., Sarath Subramanian wrote: > > repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java > > Line 607 (original), 616 (patched) > > <https://reviews.apache.org/r/72646/diff/2/?file=2235580#file2235580line618> > > > > what if out/in edges size is a lot, do you bring everything into memory > > just to get size? > > > > Do you need entire edges in the list or maybe we can maintain a counter > > and increment?
Yes Sarath you are right but, approximate count is count without limit/offset I brought it to inmemory to filter out 'ACTIVE' edges incase of excludeDeleted flag Other way is to fire another query with 'ACTIVE'filter > On July 23, 2020, 10:50 p.m., Sarath Subramanian wrote: > > repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java > > Lines 682 (patched) > > <https://reviews.apache.org/r/72646/diff/2/?file=2235580#file2235580line703> > > > > Constants.GUID_PROPERTY_KEY).value() can be null (mostly not, but some > > bad vertices). Consider checking for null value of guid. > > > > Also, since you already have vertex, do we need additional > > 'endVerticesGuid' list? Can we extract 'guid' from Vertex 'v' and add it to > > 'resultList' is same loop. > > > > resultList.add(entityRetriever.toAtlasEntityHeader(endVertexGuid, > > attributes)); > > > > (or) > > > > Maybe map Vertex to AtlasVertex and directly call: > > > > resultList.add(entityRetriever.toAtlasEntityHeader(atlasVertex, > > attributes)); I have added (v != null && v.property(Constants.GUID_PROPERTY_KEY).isPresent()) for the null check Correct, we dont need extra list, will address it - Pinal ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/72646/#review221343 ----------------------------------------------------------- On July 6, 2020, 9:14 a.m., Pinal Shah wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/72646/ > ----------------------------------------------------------- > > (Updated July 6, 2020, 9:14 a.m.) > > > Review request for atlas, Jayendra Parab, Madhan Neethiraj, Nixon Rodrigues, > and Sarath Subramanian. > > > Bugs: ATLAS-3876 > https://issues.apache.org/jira/browse/ATLAS-3876 > > > Repository: atlas > > > Description > ------- > > **Issue:** > Relationship api doesn't provide approximate count of the related entities in > the response. > > **Workaround:** > Get the total count of related given entity , irrespective of the > offset/limit. > > > Also this patch includes **improvement in the time taken to fetch related > entities** . > Average time taken for the Api to search relationship entities having **5000 > end vertices** with limit **500**: > Before : 9seconds > After applying this patch : 3seconds > > > Diffs > ----- > > > repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java > 4b9564295 > > repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java > 863a00350 > repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java > 5069d78c8 > > > Diff: https://reviews.apache.org/r/72646/diff/2/ > > > Testing > ------- > > Manually tested > Precommit : https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/2011 > (Failed in Impala build) > > > Thanks, > > Pinal Shah > >