-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71127/#review216815
-----------------------------------------------------------



Hello Merryle, the toplogical sort algo is very nice done. I just have some 
questions about the in/outvertex and the bimap. Is the mapping from attr to 
index and index to attr needed here? Instead, you can use Map<Attr, List<Atrr>> 
adjList, a queue<Attr> and a inDegree array/map, and a result list to help you 
finish the sort:

1. traverse the input the attr list, maintain a key-value (attr and list of 
outVertex), for every outVertex we've met, incrase the inDegree array/map.
2. Once the traverse of the input attr arry is done, initialize a queue to 
maintain the starting point of your graph, travese the inDegree map, add any 
attributs which 
have 0 as its inDegree.
3. while(!queue.isEmpty()), poll out the attr inside the queue, add it to the 
result list, 
4. traverse it outVertex lists, for every outVertex, decrease its inDegree, and 
at the same time, check if the ingree is zore, if so, offer that attr into the 
queue.
5. Once done while-loop the queue, your result list will be the desire list, no 
sorting is needed. 

If you have questions, i am happy to discuss.

Thanks,
Le

- Le Ma


On July 19, 2019, 6:49 p.m., Merryle Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71127/
> -----------------------------------------------------------
> 
> (Updated July 19, 2019, 6:49 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Aadarsh Jajodia, Sridhar K, Le Ma, 
> Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-3343: Ordering of dynAttr evaluation
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java 
> 23eaa0a2e88fd348d2347314170726ebb5cb4393 
> 
> 
> Diff: https://reviews.apache.org/r/71127/diff/1/
> 
> 
> Testing
> -------
> 
> Created dummy dynamic attributes to test the correct ordering.
> 
> 
> Thanks,
> 
> Merryle Wang
> 
>

Reply via email to