You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Sarath Subramanian <sa...@apache.org> on 2017/09/06 05:59:27 UTC

Review Request 62109: [ATLAS-2116] : Implement tag propagation using relationships

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

Review request for atlas.


Bugs: ATLAS-2116
    https://issues.apache.org/jira/browse/ATLAS-2116


Repository: atlas


Description
-------

Implement propagation of classifications using relationships. When a classification is associated with an entity the tag is propagated to all its associated entities using the tagPropagation property in the edges. Also propagate tags, if tag is deleted or updated.
tagPropagation properties can be NONE, BOTH, ONE_TO_TWO or TWO_TO_ONE
propagate tags only if relationships tagPropagation property is BOTH, ONE_TO_TWO or TWO_TO_ONE.


Diffs
-----

  client/src/main/java/org/apache/atlas/EntityAuditEvent.java 904674d9 
  dashboardv2/public/js/utils/Enums.js db2c46cf 
  intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java 365e548d 
  intg/src/main/java/org/apache/atlas/model/instance/AtlasPropagatedClassification.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/instance/AtlasRelationship.java ec6161c0 
  notification/src/main/java/org/apache/atlas/notification/entity/EntityNotification.java 379e8155 
  repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListener.java 2a1881b0 
  repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java 020dd457 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1.java 9b273193 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 9700917e 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java f6aa7bbf 
  repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java 33f9b7ab 
  repository/src/main/java/org/apache/atlas/util/AtlasGremlinQueryProvider.java a6025293 
  repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java d8d8d91b 
  server-api/src/main/java/org/apache/atlas/listener/EntityChangeListener.java e05a7755 
  webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967 


Diff: https://reviews.apache.org/r/62109/diff/1/


Testing
-------

Tested using UI and POSTMAN REST client.

Unit Tests/Integration tests - In progress


Thanks,

Sarath Subramanian


Re: Review Request 62109: [ATLAS-2116] : Implement tag propagation using relationships

Posted by David Radley <da...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62109/#review185402
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/model/instance/AtlasPropagatedClassification.java
Lines 45 (patched)
<https://reviews.apache.org/r/62109/#comment261716>

    I suggest we add some comments around the intent of this class.



repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListener.java
Lines 118 (patched)
<https://reviews.apache.org/r/62109/#comment261725>

    maybe refactor this repeated logic to a method and pass in the AuditAction and message for each of the cases.



repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListener.java
Lines 333 (patched)
<https://reviews.apache.org/r/62109/#comment261718>

    Can we use PROPAGATED_TAG_ADD here. It seems to be pretty much the same text. Same for UPDATE and DELETE.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
Lines 411 (patched)
<https://reviews.apache.org/r/62109/#comment261720>

    I suggest we do not use inherit here - as it has otehr meanings (like is-a). Maybe change "inheritted" to "acquired".



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
Lines 447 (patched)
<https://reviews.apache.org/r/62109/#comment261724>

    I am not sure how the first element would not be a vertex? Presumably it will be an empty list or a list of vertices.



repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java
Lines 104 (patched)
<https://reviews.apache.org/r/62109/#comment261719>

    Cool Gremlin :-). I assume we need equivalent in TP3 for Titan 1 / Janus.



repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java
Lines 105 (patched)
<https://reviews.apache.org/r/62109/#comment261726>

    I assue that classification and entity inheritance needs to be accounted for in this query.



repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java
Lines 106 (patched)
<https://reviews.apache.org/r/62109/#comment261727>

    Once ATLAS-2029 goes in - we will need to account for the fact that tags should not be propagated to an entity that does not support that tag.



server-api/src/main/java/org/apache/atlas/listener/EntityChangeListener.java
Lines 85 (patched)
<https://reviews.apache.org/r/62109/#comment261721>

    Is this correct? Is it not : "traits that have been added to the entity"



server-api/src/main/java/org/apache/atlas/listener/EntityChangeListener.java
Lines 95 (patched)
<https://reviews.apache.org/r/62109/#comment261722>

    same



server-api/src/main/java/org/apache/atlas/listener/EntityChangeListener.java
Lines 105 (patched)
<https://reviews.apache.org/r/62109/#comment261723>

    added => updated 
    
    same concern as above


- David Radley


On Sept. 6, 2017, 5:59 a.m., Sarath Subramanian wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62109/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2017, 5:59 a.m.)
> 
> 
> Review request for atlas.
> 
> 
> Bugs: ATLAS-2116
>     https://issues.apache.org/jira/browse/ATLAS-2116
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Implement propagation of classifications using relationships. When a classification is associated with an entity the tag is propagated to all its associated entities using the tagPropagation property in the edges. Also propagate tags, if tag is deleted or updated.
> tagPropagation properties can be NONE, BOTH, ONE_TO_TWO or TWO_TO_ONE
> propagate tags only if relationships tagPropagation property is BOTH, ONE_TO_TWO or TWO_TO_ONE.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/atlas/EntityAuditEvent.java 904674d9 
>   dashboardv2/public/js/utils/Enums.js db2c46cf 
>   intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java 365e548d 
>   intg/src/main/java/org/apache/atlas/model/instance/AtlasPropagatedClassification.java PRE-CREATION 
>   notification/src/main/java/org/apache/atlas/notification/entity/EntityNotification.java 379e8155 
>   repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListener.java 2a1881b0 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java f6aa7bbf 
>   repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java 33f9b7ab 
>   repository/src/main/java/org/apache/atlas/util/AtlasGremlinQueryProvider.java a6025293 
>   repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java d8d8d91b 
>   server-api/src/main/java/org/apache/atlas/listener/EntityChangeListener.java e05a7755 
>   webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967 
> 
> 
> Diff: https://reviews.apache.org/r/62109/diff/3/
> 
> 
> Testing
> -------
> 
> Tested using UI and POSTMAN REST client.
> 
> Unit Tests/Integration tests - In progress
> 
> 
> Thanks,
> 
> Sarath Subramanian
> 
>


Re: Review Request 62109: [ATLAS-2116] : Implement tag propagation using relationships

Posted by David Radley <da...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62109/#review185791
-----------------------------------------------------------




repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
Lines 429 (patched)
<https://reviews.apache.org/r/62109/#comment262137>

    I amnot sure why this method is in EntityGraphRetriever. The method appears to be nothing to do with entities. I suggest we put this method int oa stattic graph utils class and make is static - passing in the gremlinQueryProvider.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
Lines 454 (patched)
<https://reviews.apache.org/r/62109/#comment262138>

    I suggest we put out the exception message here


- David Radley


On Sept. 6, 2017, 5:59 a.m., Sarath Subramanian wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62109/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2017, 5:59 a.m.)
> 
> 
> Review request for atlas.
> 
> 
> Bugs: ATLAS-2116
>     https://issues.apache.org/jira/browse/ATLAS-2116
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Implement propagation of classifications using relationships. When a classification is associated with an entity the tag is propagated to all its associated entities using the tagPropagation property in the edges. Also propagate tags, if tag is deleted or updated.
> tagPropagation properties can be NONE, BOTH, ONE_TO_TWO or TWO_TO_ONE
> propagate tags only if relationships tagPropagation property is BOTH, ONE_TO_TWO or TWO_TO_ONE.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/atlas/EntityAuditEvent.java 904674d9 
>   dashboardv2/public/js/utils/Enums.js db2c46cf 
>   intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java 365e548d 
>   intg/src/main/java/org/apache/atlas/model/instance/AtlasPropagatedClassification.java PRE-CREATION 
>   notification/src/main/java/org/apache/atlas/notification/entity/EntityNotification.java 379e8155 
>   repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListener.java 2a1881b0 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java 6423aeab 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java f6aa7bbf 
>   repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java 33f9b7ab 
>   repository/src/main/java/org/apache/atlas/util/AtlasGremlinQueryProvider.java a6025293 
>   repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java d8d8d91b 
>   server-api/src/main/java/org/apache/atlas/listener/EntityChangeListener.java e05a7755 
>   webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java 6eadc967 
> 
> 
> Diff: https://reviews.apache.org/r/62109/diff/3/
> 
> 
> Testing
> -------
> 
> Tested using UI and POSTMAN REST client.
> 
> Unit Tests/Integration tests - In progress
> 
> 
> Thanks,
> 
> Sarath Subramanian
> 
>