You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by David Radley <da...@uk.ibm.com> on 2017/06/25 11:41:55 UTC

Review Request 60272: i

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

Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


Repository: atlas


Description
-------

ATLAS-1891
Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 

- for create check reserved words are not used on the endpoints and type name and relationship attribute names
- for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
- for not allow deletion of an entityDef that has a relatiionshipDef


Diffs
-----

  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
  repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
  repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
  webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 


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


Testing
-------

run junits
create reltionshipDef
get relationshipDef
get relationshipDef/headers
delete relationshipDef
update relationshipDef
create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
Delete an entityDef that has a relationshipdef - this fails
Create a relationship with an endpoint name as a reserved word - this fails


Thanks,

David Radley


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

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

(Updated June 26, 2017, 4:18 p.m.)


Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


Changes
-------

I fixed the typo


Repository: atlas


Description
-------

ATLAS-1891
Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 

- for create check reserved words are not used on the endpoints and type name and relationship attribute names
- for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
- for not allow deletion of an entityDef that has a relatiionshipDef


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
  repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
  repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
  webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 


Diff: https://reviews.apache.org/r/60272/diff/3/

Changes: https://reviews.apache.org/r/60272/diff/2-3/


Testing
-------

run junits
create reltionshipDef
get relationshipDef
get relationshipDef/headers
delete relationshipDef
update relationshipDef
create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
Delete an entityDef that has a relationshipdef - this fails
Create a relationship with an endpoint name as a reserved word - this fails


Thanks,

David Radley


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60272/#review178890
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On June 26, 2017, 12:29 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 26, 2017, 12:29 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/2/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60272/#review178889
-----------------------------------------------------------




repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Lines 99 (patched)
<https://reviews.apache.org/r/60272/#comment253226>

    Is it necessary to create the second edge between  a pair of relationshipDefVertex and entityTypeVertex when the endpoint names are different? I think it is not necessary; the condition in line #99 should be:
      "if (!type1.equals(type2)) {".  
    Please review.


- Madhan Neethiraj


On June 26, 2017, 12:29 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 26, 2017, 12:29 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/2/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

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

(Updated June 26, 2017, 12:29 p.m.)


Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


Repository: atlas


Description
-------

ATLAS-1891
Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 

- for create check reserved words are not used on the endpoints and type name and relationship attribute names
- for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
- for not allow deletion of an entityDef that has a relatiionshipDef


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
  repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
  repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
  webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 


Diff: https://reviews.apache.org/r/60272/diff/2/

Changes: https://reviews.apache.org/r/60272/diff/1-2/


Testing
-------

run junits
create reltionshipDef
get relationshipDef
get relationshipDef/headers
delete relationshipDef
update relationshipDef
create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
Delete an entityDef that has a relationshipdef - this fails
Create a relationship with an endpoint name as a reserved word - this fails


Thanks,

David Radley


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by Sarath Subramanian <sa...@apache.org>.

> On June 25, 2017, 11:24 p.m., Sarath Subramanian wrote:
> > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
> > Lines 413 (patched)
> > <https://reviews.apache.org/r/60272/diff/1/?file=1762491#file1762491line421>
> >
> >     should we add checks for PropagateTags?
> 
> David Radley wrote:
>     I am wondering what additional validation you are thinking of. as long as the enum is policed as a valid value by Atlas normal procssing there is no additional valition we need to do for propagaeTags

I meant validate propagateTags for update? Is it okay to update the enum value of propagateTags or should we restrict it?


- Sarath


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


On June 26, 2017, 9:18 a.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 26, 2017, 9:18 a.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/3/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by David Radley <da...@uk.ibm.com>.

> On June 26, 2017, 6:24 a.m., Sarath Subramanian wrote:
> > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
> > Lines 413 (patched)
> > <https://reviews.apache.org/r/60272/diff/1/?file=1762491#file1762491line421>
> >
> >     should we add checks for PropagateTags?
> 
> David Radley wrote:
>     I am wondering what additional validation you are thinking of. as long as the enum is policed as a valid value by Atlas normal procssing there is no additional valition we need to do for propagaeTags
> 
> Sarath Subramanian wrote:
>     I meant validate propagateTags for update? Is it okay to update the enum value of propagateTags or should we restrict it?

It is a good question. I couldn't think of any reason not to allow this. It will be be effective at query time - so there should be no derived resources. I suggest we allow update of propagate tags. If I am missing something, let me know .


- David


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


On June 26, 2017, 4:18 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 26, 2017, 4:18 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/3/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by David Radley <da...@uk.ibm.com>.

> On June 26, 2017, 6:24 a.m., Sarath Subramanian wrote:
> > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
> > Lines 84 (patched)
> > <https://reviews.apache.org/r/60272/diff/1/?file=1762491#file1762491line84>
> >
> >     line 84 and 86 creates edges from relationDefs:
> >     relationDef -> endDef1, relationDef -> endDef2. Should the edges be created like: endDef1 -> relationDef, relationDef -> endDef2?

I purposely did it like endDef1 <- relationDef, relationDef -> endDef2. So the relationshipDef only has out edges to manage. this allows us to just ddlete out edges for the Vertex during relationshipDef delete.


> On June 26, 2017, 6:24 a.m., Sarath Subramanian wrote:
> > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
> > Lines 413 (patched)
> > <https://reviews.apache.org/r/60272/diff/1/?file=1762491#file1762491line421>
> >
> >     should we add checks for PropagateTags?

I am wondering what additional validation you are thinking of. as long as the enum is policed as a valid value by Atlas normal procssing there is no additional valition we need to do for propagaeTags


- David


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


On June 25, 2017, 1:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 25, 2017, 1:22 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/1/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by Sarath Subramanian <sa...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60272/#review178862
-----------------------------------------------------------




repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Lines 84 (patched)
<https://reviews.apache.org/r/60272/#comment253159>

    line 84 and 86 creates edges from relationDefs:
    relationDef -> endDef1, relationDef -> endDef2. Should the edges be created like: endDef1 -> relationDef, relationDef -> endDef2?



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Lines 413 (patched)
<https://reviews.apache.org/r/60272/#comment253158>

    should we add checks for PropagateTags?



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java
Lines 252 (patched)
<https://reviews.apache.org/r/60272/#comment253157>

    hasInEdgesWithLabel could be renamed with hasIncomingEdgesWithLabel


- Sarath Subramanian


On June 25, 2017, 6:22 a.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 25, 2017, 6:22 a.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/1/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by David Radley <da...@uk.ibm.com>.

> On June 25, 2017, 10:41 p.m., Madhan Neethiraj wrote:
> > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
> > Line 269 (original)
> > <https://reviews.apache.org/r/60272/diff/1/?file=1762491#file1762491line290>
> >
> >     When would the edges between relationship vertex and endType vertices be deleted? If not deleted, wouldn't it cause delete of the end-type to fail - while attempting to delete end-type?

The  typeDefStore.deleteTypeVertexOutEdges(ret); in the latest patch should get rid of the edges.


- David


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


On June 25, 2017, 1:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 25, 2017, 1:22 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/1/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60272/#review178857
-----------------------------------------------------------




repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java
Lines 53 (patched)
<https://reviews.apache.org/r/60272/#comment253131>

    ".relationshipType" ==> PROPERTY_PREFIX + ".relationshipType"



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Lines 86 (patched)
<https://reviews.apache.org/r/60272/#comment253130>

    for relationship having both ends as same type, there will only be single edge. That should be fine; please review that there is no assumption of 2 edges.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Lines 88 (patched)
<https://reviews.apache.org/r/60272/#comment253132>

    "LOG.isInfoEnabled()": perhaps you meant this to be debug level log?



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Line 265 (original), 286 (patched)
<https://reviews.apache.org/r/60272/#comment253136>

    Relationship instances would be edges, hence this should look for edges for the given type. Please review.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Line 269 (original)
<https://reviews.apache.org/r/60272/#comment253133>

    When would the edges between relationship vertex and endType vertices be deleted? If not deleted, wouldn't it cause delete of the end-type to fail - while attempting to delete end-type?



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
Lines 396 (patched)
<https://reviews.apache.org/r/60272/#comment253134>

    'vertex' has been updated in line #392 above, so existingRelationshipDef will have updated relationshipDef.



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

    Instead of compating json-ified endDefs, consider the following:
     if (!newRelationshipDef.getEnd1().equals(existingRelationshipDef.getEnd2()) {
     }


- Madhan Neethiraj


On June 25, 2017, 1:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60272/
> -----------------------------------------------------------
> 
> (Updated June 25, 2017, 1:22 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> ATLAS-1891
> Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 
> 
> - for create check reserved words are not used on the endpoints and type name and relationship attribute names
> - for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
> - for not allow deletion of an entityDef that has a relatiionshipDef
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
>   repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 
> 
> 
> Diff: https://reviews.apache.org/r/60272/diff/1/
> 
> 
> Testing
> -------
> 
> run junits
> create reltionshipDef
> get relationshipDef
> get relationshipDef/headers
> delete relationshipDef
> update relationshipDef
> create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
> Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
> Delete an entityDef that has a relationshipdef - this fails
> Create a relationship with an endpoint name as a reserved word - this fails
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 60272: ATLAS-1891 Additional Validation checks for RelationshipDefs

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

(Updated June 25, 2017, 1:22 p.m.)


Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


Summary (updated)
-----------------

ATLAS-1891 Additional Validation checks for RelationshipDefs 


Repository: atlas


Description
-------

ATLAS-1891
Additional validation checks for relationshipDefs and add edges between entityDefs and relationshipDef vertices 

- for create check reserved words are not used on the endpoints and type name and relationship attribute names
- for update do not allow updates to endpoints or the name or deletion of attributes or relationship category
- for not allow deletion of an entityDef that has a relatiionshipDef


Diffs
-----

  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 70480df113db36cb938a8817239fbeae441acdc0 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 31256683f4c1e3217ef4b2dba83f34c32e025435 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java aefd1684fe4a71cd0b45c4600cc5eca872ab0892 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java 8046234f17885cb6009edbcf3f9b80333932c358 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 00fe94b69d69d261e37766434b0cfd1e56117c52 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java 6992e221884db5382b89a29ea8a7efaad2cadcbc 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 2ba41443d7d5c51ec83848c5f9ca89720f74b63a 
  repository/src/test/java/org/apache/atlas/TestModules.java d28956deb349c65d11031dbfb3866b91d5fd37e4 
  repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStoreV1Test.java PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java 82d6f2e3ee3f6376b7830e11900fda4e7275375b 
  webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java 3b6770658298849cb70e69c373f97fb4d13d1148 


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


Testing
-------

run junits
create reltionshipDef
get relationshipDef
get relationshipDef/headers
delete relationshipDef
update relationshipDef
create a relationshipDef and then update it such that an attribute will be deleted. This should fail.
Set the config option and try to create a reltionshipDef with a reserversed word as an attribute name - this fails
Delete an entityDef that has a relationshipdef - this fails
Create a relationship with an endpoint name as a reserved word - this fails


Thanks,

David Radley