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/02 10:26:02 UTC

Review Request 59719: ATLAS-1852 Create RelationshipDef

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

Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.


Repository: atlas


Description
-------

This patch introduces the relationshipDef as a new top level TypeDef, that is storted as a vertex in the graph. Other subtasks with complete the Relationshipdef work. 

Work that is not included in this patch:
1) get relationship by guid is not working
2) relationshipdef updates have not been tested
3) further constraints are required. I will update the design doc with a proposal
4) Tag propagation - I think there are still ongoing discussions we should come to consensus on this - it would be easy to add
5) Creation of edges between xxxDef vertexes. I will update the design with a proposal


Diffs
-----

  common/src/main/java/org/apache/atlas/ApplicationProperties.java a35bdfee72a460b3aa793a40c41618dba31e1fb9 
  common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 298df6b0171b9b5e0683cd0787c6cdfd2e714f5e 
  intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
  intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
  intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/type/AtlasType.java 28d0a0748e3357a275bfec5b88cb522f9edfd9c2 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 29ea60304826ab1c94b5f74614350732415da8a6 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
  intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
  intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasClassificationDef.java a1abc6e754ff5b45e3f2aabfcc94ff356ff16327 
  intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasEntityDef.java 46d4d065f6f0f89e98a7c6f56c6a261c575bbfc8 
  intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/converters/TypeConverterUtil.java 7902100e80a400a5097554800ac2d862b9148144 
  repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad068769dc72d90b18f7ae6ae84143792760 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 4a8e1de7942156f0888bacb03479e7f9b2055512 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStream.java eb860ff2a250d122881dd54eb3d2de2986f6f8e6 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 3bf318f025f1b1edc9c35be08083fc8f0ed2add3 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityStream.java 3444bfd6d8b972b6f2f652a6a8e49cb0619145b6 
  repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java ac135863e82a815a580a095d2942088f571e35a9 
  repository/src/main/java/org/apache/atlas/repository/typestore/ITypeStore.java 84779f409b47b29f21accb2b5a94e068801a740f 
  repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java 8573719c912cfac35759da96bf4bcf8a06a75ee1 
  repository/src/main/java/org/apache/atlas/repository/typestore/TypePersistenceVisitor.java bfb1bfc75c1c3ab5f80937d40c325e1b065265a3 
  repository/src/main/java/org/apache/atlas/repository/typestore/TypeVertexFinder.java 8b381524055aefcb0c7b0f07f773a6250fedb51d 
  repository/src/main/java/org/apache/atlas/repository/typestore/TypeVisitor.java a6e353c18d690201818c899666f4fecb63172e42 
  repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java fd85ef0f6d4859ae6da53e5cac49b577e225519a 
  repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java a7cb2e5b541db27bd19818ee5e3639ebca0a6389 
  repository/src/test/java/org/apache/atlas/TestUtils.java cf39d8d8130a97e5709036c1d406227f4f026027 
  repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryDeleteTestBase.java 4fd416c70bd307a9c2cc358d5a059bab1bb9d3f9 
  repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateTestBase.java c08fbc99908f2a4c4be2eee337e6ef0c7151033d 
  repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasDeleteHandlerV1Test.java 9a11e087515909e271301f85786f1bdfbdad789a 
  repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 1dd727661ca8a8d59caaee0f3aa9854fb4b631ea 
  repository/src/test/java/org/apache/atlas/repository/typestore/GraphBackedTypeStoreTest.java 65cd9386ada156e5fa975433a5c5fa89698e49e0 
  repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalTypeDefinition.java ab63fea3c6695065943a7b11fdb71cec8f79565d 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipType.java PRE-CREATION 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java c853ec655676eed99d93ced9f0f0de18c77bc27a 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
  typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
  typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
  typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
  typesystem/src/test/java/org/apache/atlas/typesystem/json/SerializationJavaTest.java 5ee019cba021e3e372c555558ad46690ffe73ea7 
  typesystem/src/test/java/org/apache/atlas/typesystem/types/BaseTest.java 95c99e4f6c112d71fafd11bda4c41e9dd5ce71dd 
  typesystem/src/test/java/org/apache/atlas/typesystem/types/ClassTest.java daecdd78c952747964885d4cb8cdfb59727ffee5 
  typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java 23071922a4b59b690f8c670a043203a031523c28 
  typesystem/src/test/java/org/apache/atlas/typesystem/types/FieldMappingTest.java 0259ade905929aa021c11dba795f252ee07e27d8 
  typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java 3a1675e1a34683fc9645e3ad7a4b13a9da924aae 
  typesystem/src/test/java/org/apache/atlas/typesystem/types/TraitTest.java 7c3921386c8ad582a594504b9b0f82c513cabd40 
  typesystem/src/test/java/org/apache/atlas/typesystem/types/TypeSystemTest.java 0ef5d10d9dccae64f644470070ed5a345d191ebd 
  typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala 931773dd2b184181743f56971d38a09be8b96e26 
  typesystem/src/test/scala/org/apache/atlas/typesystem/json/TypesSerializationTest.scala cfd4bdb26482c187c4e80f110b7349df8b524e6e 
  webapp/src/main/java/org/apache/atlas/examples/QuickStart.java 91ba1113b706415d236a3319291500c32322d83e 
  webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java a95fac37546867cfe6c43b72804c0384b091e195 
  webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c652d961931ed9b3dac598a5d27c30b5 
  webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java 5d846cf317ae46fa88ef7877baad129638e38e03 
  webapp/src/test/java/org/apache/atlas/util/RestUtilsTest.java 87259df2443d858dd305e71be00cee2c7e7c0815 
  webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java cadf0ffffc387cf60ded99945cb90d13c86cf3d9 
  webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java 457dc394680ae8e6a44fcb7619e6df7c746deff8 
  webapp/src/test/java/org/apache/atlas/web/resources/DataSetLineageJerseyResourceIT.java ee4057d41174765e666eff0e3aaaf00ffc780e92 
  webapp/src/test/java/org/apache/atlas/web/resources/EntityDiscoveryJerseyResourceIT.java a51f3716d66485941c29d57f5aafdf44753176b7 
  webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java f2af20825cd04f07cf1a50f453f82dfed7880a79 
  webapp/src/test/java/org/apache/atlas/web/resources/EntityResourceTest.java 21060d14ac82e037466d8a3490aac9ba721ac611 
  webapp/src/test/java/org/apache/atlas/web/resources/EntityV2JerseyResourceIT.java 9d5ff5a829241299df84fa429d6199fc3ea16302 
  webapp/src/test/java/org/apache/atlas/web/resources/MetadataDiscoveryJerseyResourceIT.java 87d8719fda4072ef84072a7ab931fe010f9fb8cb 
  webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java 2ef33c3ff0c25a179bc7f5ca1b89c7ac12e94b7c 


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


Testing
-------

Junits run successfuly. 
1) Using the sample json, issued a Rest call to create the relationshipDef
2) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/typedefs/ retuens the relationshipdef
3) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/relationshipdef/name/Testrel4 returns the relationshipdef


Sample json
"{
    "enumDefs": [],
    "structDefs": [],
    "classificationDefs": [],
    "entityDefs": [
      {
              "name": "TestEnt11",
              "superTypes": [],
              "typeVersion": "1.0",
              "attributeDefs": [
                  {
                      "name": "name",
                      "typeName": "string",
                      "cardinality": "SINGLE",
                      "isIndexable": true,
                      "isOptional": false,
                      "isUnique": false
                  }
                ]
    },
    {
        "name": "TestEnt12",
        "superTypes": [],
        "typeVersion": "1.0",
        "attributeDefs": [
            {
                "name": "name",
                "typeName": "string",
                "cardinality": "SINGLE",
                "isIndexable": true,
                "isOptional": false,
                "isUnique": false
            }
          ]

    }
    ],
    "relationshipDefs" :[
        {
            "name": "Testrel4",
            "typeVersion": "1.0",

            "endPointDef1": {
              "name": "aaa",
              "type": "TestEnt11",
              "cardinality":"SINGLE"
            },
            "endPointDef2": {
              "name": "bbb",
              "type": "TestEnt12",
              "cardinality":"SINGLE"
            },
            "relationshipCategory":"ASSOCIATION",
            "attributeDefs": [
                {
                    "name": "testattr1",
                    "typeName": "string",
                    "cardinality": "SINGLE",
                    "isIndexable": true,
                    "isOptional": true,
                    "isUnique": false
                }
              ]
        }
    ]
}
"


Thanks,

David Radley


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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




intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java
Lines 82 (patched)
<https://reviews.apache.org/r/59719/#comment250294>

    we need to add delete operations(delete by guid/name) for relationshipDef?



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 50 (patched)
<https://reviews.apache.org/r/59719/#comment250295>

    Relationships cannot have supertypes or subtypes based on our discussion and design doc. Consider removing all invalid supertype/subtype references here.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 310 (patched)
<https://reviews.apache.org/r/59719/#comment250296>

    remove this comment block if not needed.


- Sarath Subramanian


On June 2, 2017, 3:25 a.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 2, 2017, 3:25 a.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is storted as a vertex in the graph. Other subtasks with complete the Relationshipdef work. 
> 
> Work that is not included in this patch:
> 1) get relationship by guid is not working
> 2) relationshipdef updates have not been tested
> 3) further constraints are required. I will update the design doc with a proposal
> 4) Tag propagation - I think there are still ongoing discussions we should come to consensus on this - it would be easy to add
> 5) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/ApplicationProperties.java a35bdfee72a460b3aa793a40c41618dba31e1fb9 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 298df6b0171b9b5e0683cd0787c6cdfd2e714f5e 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasType.java 28d0a0748e3357a275bfec5b88cb522f9edfd9c2 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 29ea60304826ab1c94b5f74614350732415da8a6 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasClassificationDef.java a1abc6e754ff5b45e3f2aabfcc94ff356ff16327 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasEntityDef.java 46d4d065f6f0f89e98a7c6f56c6a261c575bbfc8 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/converters/TypeConverterUtil.java 7902100e80a400a5097554800ac2d862b9148144 
>   repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad068769dc72d90b18f7ae6ae84143792760 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 4a8e1de7942156f0888bacb03479e7f9b2055512 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStream.java eb860ff2a250d122881dd54eb3d2de2986f6f8e6 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 3bf318f025f1b1edc9c35be08083fc8f0ed2add3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityStream.java 3444bfd6d8b972b6f2f652a6a8e49cb0619145b6 
>   repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java ac135863e82a815a580a095d2942088f571e35a9 
>   repository/src/main/java/org/apache/atlas/repository/typestore/ITypeStore.java 84779f409b47b29f21accb2b5a94e068801a740f 
>   repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java 8573719c912cfac35759da96bf4bcf8a06a75ee1 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypePersistenceVisitor.java bfb1bfc75c1c3ab5f80937d40c325e1b065265a3 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVertexFinder.java 8b381524055aefcb0c7b0f07f773a6250fedb51d 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVisitor.java a6e353c18d690201818c899666f4fecb63172e42 
>   repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java fd85ef0f6d4859ae6da53e5cac49b577e225519a 
>   repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java a7cb2e5b541db27bd19818ee5e3639ebca0a6389 
>   repository/src/test/java/org/apache/atlas/TestUtils.java cf39d8d8130a97e5709036c1d406227f4f026027 
>   repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryDeleteTestBase.java 4fd416c70bd307a9c2cc358d5a059bab1bb9d3f9 
>   repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateTestBase.java c08fbc99908f2a4c4be2eee337e6ef0c7151033d 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasDeleteHandlerV1Test.java 9a11e087515909e271301f85786f1bdfbdad789a 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 1dd727661ca8a8d59caaee0f3aa9854fb4b631ea 
>   repository/src/test/java/org/apache/atlas/repository/typestore/GraphBackedTypeStoreTest.java 65cd9386ada156e5fa975433a5c5fa89698e49e0 
>   repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalTypeDefinition.java ab63fea3c6695065943a7b11fdb71cec8f79565d 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipType.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java c853ec655676eed99d93ced9f0f0de18c77bc27a 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
>   typesystem/src/test/java/org/apache/atlas/typesystem/json/SerializationJavaTest.java 5ee019cba021e3e372c555558ad46690ffe73ea7 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/BaseTest.java 95c99e4f6c112d71fafd11bda4c41e9dd5ce71dd 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/ClassTest.java daecdd78c952747964885d4cb8cdfb59727ffee5 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java 23071922a4b59b690f8c670a043203a031523c28 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/FieldMappingTest.java 0259ade905929aa021c11dba795f252ee07e27d8 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java 3a1675e1a34683fc9645e3ad7a4b13a9da924aae 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TraitTest.java 7c3921386c8ad582a594504b9b0f82c513cabd40 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TypeSystemTest.java 0ef5d10d9dccae64f644470070ed5a345d191ebd 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala 931773dd2b184181743f56971d38a09be8b96e26 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/TypesSerializationTest.scala cfd4bdb26482c187c4e80f110b7349df8b524e6e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStart.java 91ba1113b706415d236a3319291500c32322d83e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java a95fac37546867cfe6c43b72804c0384b091e195 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c652d961931ed9b3dac598a5d27c30b5 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java 5d846cf317ae46fa88ef7877baad129638e38e03 
>   webapp/src/test/java/org/apache/atlas/util/RestUtilsTest.java 87259df2443d858dd305e71be00cee2c7e7c0815 
>   webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java cadf0ffffc387cf60ded99945cb90d13c86cf3d9 
>   webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java 457dc394680ae8e6a44fcb7619e6df7c746deff8 
>   webapp/src/test/java/org/apache/atlas/web/resources/DataSetLineageJerseyResourceIT.java ee4057d41174765e666eff0e3aaaf00ffc780e92 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityDiscoveryJerseyResourceIT.java a51f3716d66485941c29d57f5aafdf44753176b7 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java f2af20825cd04f07cf1a50f453f82dfed7880a79 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityResourceTest.java 21060d14ac82e037466d8a3490aac9ba721ac611 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityV2JerseyResourceIT.java 9d5ff5a829241299df84fa429d6199fc3ea16302 
>   webapp/src/test/java/org/apache/atlas/web/resources/MetadataDiscoveryJerseyResourceIT.java 87d8719fda4072ef84072a7ab931fe010f9fb8cb 
>   webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java 2ef33c3ff0c25a179bc7f5ca1b89c7ac12e94b7c 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/1/
> 
> 
> Testing
> -------
> 
> Junits run successfuly. 
> 1) Using the sample json, issued a Rest call to create the relationshipDef
> 2) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/typedefs/ retuens the relationshipdef
> 3) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/relationshipdef/name/Testrel4 returns the relationshipdef
> 
> 
> Sample json
> "{
>     "enumDefs": [],
>     "structDefs": [],
>     "classificationDefs": [],
>     "entityDefs": [
>       {
>               "name": "TestEnt11",
>               "superTypes": [],
>               "typeVersion": "1.0",
>               "attributeDefs": [
>                   {
>                       "name": "name",
>                       "typeName": "string",
>                       "cardinality": "SINGLE",
>                       "isIndexable": true,
>                       "isOptional": false,
>                       "isUnique": false
>                   }
>                 ]
>     },
>     {
>         "name": "TestEnt12",
>         "superTypes": [],
>         "typeVersion": "1.0",
>         "attributeDefs": [
>             {
>                 "name": "name",
>                 "typeName": "string",
>                 "cardinality": "SINGLE",
>                 "isIndexable": true,
>                 "isOptional": false,
>                 "isUnique": false
>             }
>           ]
> 
>     }
>     ],
>     "relationshipDefs" :[
>         {
>             "name": "Testrel4",
>             "typeVersion": "1.0",
> 
>             "endPointDef1": {
>               "name": "aaa",
>               "type": "TestEnt11",
>               "cardinality":"SINGLE"
>             },
>             "endPointDef2": {
>               "name": "bbb",
>               "type": "TestEnt12",
>               "cardinality":"SINGLE"
>             },
>             "relationshipCategory":"ASSOCIATION",
>             "attributeDefs": [
>                 {
>                     "name": "testattr1",
>                     "typeName": "string",
>                     "cardinality": "SINGLE",
>                     "isIndexable": true,
>                     "isOptional": true,
>                     "isUnique": false
>                 }
>               ]
>         }
>     ]
> }
> "
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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

> On June 4, 2017, 6:21 a.m., Madhan Neethiraj wrote:
> > @David - the patch fails to apply on master. Can you please rebase and update the review? Thanks.

I have redone the patch on master.


- David


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


On June 10, 2017, 10:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 10, 2017, 10:22 p.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
> This functions works
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> This is yet to do:
> 1) create after a delete 
> 2) updates do not work
> 2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
> 3) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/3/
> 
> 
> Testing
> -------
> 
> Junits complete successfully
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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



@David - the patch fails to apply on master. Can you please rebase and update the review? Thanks.

- Madhan Neethiraj


On June 2, 2017, 10:25 a.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 2, 2017, 10:25 a.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is storted as a vertex in the graph. Other subtasks with complete the Relationshipdef work. 
> 
> Work that is not included in this patch:
> 1) get relationship by guid is not working
> 2) relationshipdef updates have not been tested
> 3) further constraints are required. I will update the design doc with a proposal
> 4) Tag propagation - I think there are still ongoing discussions we should come to consensus on this - it would be easy to add
> 5) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/ApplicationProperties.java a35bdfee72a460b3aa793a40c41618dba31e1fb9 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 298df6b0171b9b5e0683cd0787c6cdfd2e714f5e 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasType.java 28d0a0748e3357a275bfec5b88cb522f9edfd9c2 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 29ea60304826ab1c94b5f74614350732415da8a6 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasClassificationDef.java a1abc6e754ff5b45e3f2aabfcc94ff356ff16327 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasEntityDef.java 46d4d065f6f0f89e98a7c6f56c6a261c575bbfc8 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/converters/TypeConverterUtil.java 7902100e80a400a5097554800ac2d862b9148144 
>   repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad068769dc72d90b18f7ae6ae84143792760 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 4a8e1de7942156f0888bacb03479e7f9b2055512 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStream.java eb860ff2a250d122881dd54eb3d2de2986f6f8e6 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 3bf318f025f1b1edc9c35be08083fc8f0ed2add3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityStream.java 3444bfd6d8b972b6f2f652a6a8e49cb0619145b6 
>   repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java ac135863e82a815a580a095d2942088f571e35a9 
>   repository/src/main/java/org/apache/atlas/repository/typestore/ITypeStore.java 84779f409b47b29f21accb2b5a94e068801a740f 
>   repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java 8573719c912cfac35759da96bf4bcf8a06a75ee1 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypePersistenceVisitor.java bfb1bfc75c1c3ab5f80937d40c325e1b065265a3 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVertexFinder.java 8b381524055aefcb0c7b0f07f773a6250fedb51d 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVisitor.java a6e353c18d690201818c899666f4fecb63172e42 
>   repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java fd85ef0f6d4859ae6da53e5cac49b577e225519a 
>   repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java a7cb2e5b541db27bd19818ee5e3639ebca0a6389 
>   repository/src/test/java/org/apache/atlas/TestUtils.java cf39d8d8130a97e5709036c1d406227f4f026027 
>   repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryDeleteTestBase.java 4fd416c70bd307a9c2cc358d5a059bab1bb9d3f9 
>   repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateTestBase.java c08fbc99908f2a4c4be2eee337e6ef0c7151033d 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasDeleteHandlerV1Test.java 9a11e087515909e271301f85786f1bdfbdad789a 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 1dd727661ca8a8d59caaee0f3aa9854fb4b631ea 
>   repository/src/test/java/org/apache/atlas/repository/typestore/GraphBackedTypeStoreTest.java 65cd9386ada156e5fa975433a5c5fa89698e49e0 
>   repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalTypeDefinition.java ab63fea3c6695065943a7b11fdb71cec8f79565d 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipType.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java c853ec655676eed99d93ced9f0f0de18c77bc27a 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
>   typesystem/src/test/java/org/apache/atlas/typesystem/json/SerializationJavaTest.java 5ee019cba021e3e372c555558ad46690ffe73ea7 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/BaseTest.java 95c99e4f6c112d71fafd11bda4c41e9dd5ce71dd 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/ClassTest.java daecdd78c952747964885d4cb8cdfb59727ffee5 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java 23071922a4b59b690f8c670a043203a031523c28 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/FieldMappingTest.java 0259ade905929aa021c11dba795f252ee07e27d8 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java 3a1675e1a34683fc9645e3ad7a4b13a9da924aae 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TraitTest.java 7c3921386c8ad582a594504b9b0f82c513cabd40 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TypeSystemTest.java 0ef5d10d9dccae64f644470070ed5a345d191ebd 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala 931773dd2b184181743f56971d38a09be8b96e26 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/TypesSerializationTest.scala cfd4bdb26482c187c4e80f110b7349df8b524e6e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStart.java 91ba1113b706415d236a3319291500c32322d83e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java a95fac37546867cfe6c43b72804c0384b091e195 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c652d961931ed9b3dac598a5d27c30b5 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java 5d846cf317ae46fa88ef7877baad129638e38e03 
>   webapp/src/test/java/org/apache/atlas/util/RestUtilsTest.java 87259df2443d858dd305e71be00cee2c7e7c0815 
>   webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java cadf0ffffc387cf60ded99945cb90d13c86cf3d9 
>   webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java 457dc394680ae8e6a44fcb7619e6df7c746deff8 
>   webapp/src/test/java/org/apache/atlas/web/resources/DataSetLineageJerseyResourceIT.java ee4057d41174765e666eff0e3aaaf00ffc780e92 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityDiscoveryJerseyResourceIT.java a51f3716d66485941c29d57f5aafdf44753176b7 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java f2af20825cd04f07cf1a50f453f82dfed7880a79 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityResourceTest.java 21060d14ac82e037466d8a3490aac9ba721ac611 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityV2JerseyResourceIT.java 9d5ff5a829241299df84fa429d6199fc3ea16302 
>   webapp/src/test/java/org/apache/atlas/web/resources/MetadataDiscoveryJerseyResourceIT.java 87d8719fda4072ef84072a7ab931fe010f9fb8cb 
>   webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java 2ef33c3ff0c25a179bc7f5ca1b89c7ac12e94b7c 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/1/
> 
> 
> Testing
> -------
> 
> Junits run successfuly. 
> 1) Using the sample json, issued a Rest call to create the relationshipDef
> 2) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/typedefs/ retuens the relationshipdef
> 3) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/relationshipdef/name/Testrel4 returns the relationshipdef
> 
> 
> Sample json
> "{
>     "enumDefs": [],
>     "structDefs": [],
>     "classificationDefs": [],
>     "entityDefs": [
>       {
>               "name": "TestEnt11",
>               "superTypes": [],
>               "typeVersion": "1.0",
>               "attributeDefs": [
>                   {
>                       "name": "name",
>                       "typeName": "string",
>                       "cardinality": "SINGLE",
>                       "isIndexable": true,
>                       "isOptional": false,
>                       "isUnique": false
>                   }
>                 ]
>     },
>     {
>         "name": "TestEnt12",
>         "superTypes": [],
>         "typeVersion": "1.0",
>         "attributeDefs": [
>             {
>                 "name": "name",
>                 "typeName": "string",
>                 "cardinality": "SINGLE",
>                 "isIndexable": true,
>                 "isOptional": false,
>                 "isUnique": false
>             }
>           ]
> 
>     }
>     ],
>     "relationshipDefs" :[
>         {
>             "name": "Testrel4",
>             "typeVersion": "1.0",
> 
>             "endPointDef1": {
>               "name": "aaa",
>               "type": "TestEnt11",
>               "cardinality":"SINGLE"
>             },
>             "endPointDef2": {
>               "name": "bbb",
>               "type": "TestEnt12",
>               "cardinality":"SINGLE"
>             },
>             "relationshipCategory":"ASSOCIATION",
>             "attributeDefs": [
>                 {
>                     "name": "testattr1",
>                     "typeName": "string",
>                     "cardinality": "SINGLE",
>                     "isIndexable": true,
>                     "isOptional": true,
>                     "isUnique": false
>                 }
>               ]
>         }
>     ]
> }
> "
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

Posted by Graham Wallis <gr...@uk.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59719/#review177048
-----------------------------------------------------------



I think you also need to augment the init() method of AtlasTypeDefGraphStore.java where the transient stores are being created, i.e.

  AtlasTypesDef typesDef = new AtlasTypesDef(
      getEnumDefStore(ttr).getAll(),
      getStructDefStore(ttr).getAll(),
      getClassificationDefStore(ttr).getAll(),
      getEntityDefStore(ttr).getAll());
CHANGE add a call to getRelationshipDefStore()

- Graham Wallis


On June 2, 2017, 10:25 a.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 2, 2017, 10:25 a.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is storted as a vertex in the graph. Other subtasks with complete the Relationshipdef work. 
> 
> Work that is not included in this patch:
> 1) get relationship by guid is not working
> 2) relationshipdef updates have not been tested
> 3) further constraints are required. I will update the design doc with a proposal
> 4) Tag propagation - I think there are still ongoing discussions we should come to consensus on this - it would be easy to add
> 5) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/ApplicationProperties.java a35bdfee72a460b3aa793a40c41618dba31e1fb9 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 298df6b0171b9b5e0683cd0787c6cdfd2e714f5e 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasType.java 28d0a0748e3357a275bfec5b88cb522f9edfd9c2 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 29ea60304826ab1c94b5f74614350732415da8a6 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasClassificationDef.java a1abc6e754ff5b45e3f2aabfcc94ff356ff16327 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasEntityDef.java 46d4d065f6f0f89e98a7c6f56c6a261c575bbfc8 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/converters/TypeConverterUtil.java 7902100e80a400a5097554800ac2d862b9148144 
>   repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad068769dc72d90b18f7ae6ae84143792760 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 4a8e1de7942156f0888bacb03479e7f9b2055512 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStream.java eb860ff2a250d122881dd54eb3d2de2986f6f8e6 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 3bf318f025f1b1edc9c35be08083fc8f0ed2add3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityStream.java 3444bfd6d8b972b6f2f652a6a8e49cb0619145b6 
>   repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java ac135863e82a815a580a095d2942088f571e35a9 
>   repository/src/main/java/org/apache/atlas/repository/typestore/ITypeStore.java 84779f409b47b29f21accb2b5a94e068801a740f 
>   repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java 8573719c912cfac35759da96bf4bcf8a06a75ee1 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypePersistenceVisitor.java bfb1bfc75c1c3ab5f80937d40c325e1b065265a3 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVertexFinder.java 8b381524055aefcb0c7b0f07f773a6250fedb51d 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVisitor.java a6e353c18d690201818c899666f4fecb63172e42 
>   repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java fd85ef0f6d4859ae6da53e5cac49b577e225519a 
>   repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java a7cb2e5b541db27bd19818ee5e3639ebca0a6389 
>   repository/src/test/java/org/apache/atlas/TestUtils.java cf39d8d8130a97e5709036c1d406227f4f026027 
>   repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryDeleteTestBase.java 4fd416c70bd307a9c2cc358d5a059bab1bb9d3f9 
>   repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateTestBase.java c08fbc99908f2a4c4be2eee337e6ef0c7151033d 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasDeleteHandlerV1Test.java 9a11e087515909e271301f85786f1bdfbdad789a 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 1dd727661ca8a8d59caaee0f3aa9854fb4b631ea 
>   repository/src/test/java/org/apache/atlas/repository/typestore/GraphBackedTypeStoreTest.java 65cd9386ada156e5fa975433a5c5fa89698e49e0 
>   repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalTypeDefinition.java ab63fea3c6695065943a7b11fdb71cec8f79565d 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipType.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java c853ec655676eed99d93ced9f0f0de18c77bc27a 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
>   typesystem/src/test/java/org/apache/atlas/typesystem/json/SerializationJavaTest.java 5ee019cba021e3e372c555558ad46690ffe73ea7 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/BaseTest.java 95c99e4f6c112d71fafd11bda4c41e9dd5ce71dd 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/ClassTest.java daecdd78c952747964885d4cb8cdfb59727ffee5 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java 23071922a4b59b690f8c670a043203a031523c28 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/FieldMappingTest.java 0259ade905929aa021c11dba795f252ee07e27d8 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java 3a1675e1a34683fc9645e3ad7a4b13a9da924aae 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TraitTest.java 7c3921386c8ad582a594504b9b0f82c513cabd40 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TypeSystemTest.java 0ef5d10d9dccae64f644470070ed5a345d191ebd 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala 931773dd2b184181743f56971d38a09be8b96e26 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/TypesSerializationTest.scala cfd4bdb26482c187c4e80f110b7349df8b524e6e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStart.java 91ba1113b706415d236a3319291500c32322d83e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java a95fac37546867cfe6c43b72804c0384b091e195 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c652d961931ed9b3dac598a5d27c30b5 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java 5d846cf317ae46fa88ef7877baad129638e38e03 
>   webapp/src/test/java/org/apache/atlas/util/RestUtilsTest.java 87259df2443d858dd305e71be00cee2c7e7c0815 
>   webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java cadf0ffffc387cf60ded99945cb90d13c86cf3d9 
>   webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java 457dc394680ae8e6a44fcb7619e6df7c746deff8 
>   webapp/src/test/java/org/apache/atlas/web/resources/DataSetLineageJerseyResourceIT.java ee4057d41174765e666eff0e3aaaf00ffc780e92 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityDiscoveryJerseyResourceIT.java a51f3716d66485941c29d57f5aafdf44753176b7 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java f2af20825cd04f07cf1a50f453f82dfed7880a79 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityResourceTest.java 21060d14ac82e037466d8a3490aac9ba721ac611 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityV2JerseyResourceIT.java 9d5ff5a829241299df84fa429d6199fc3ea16302 
>   webapp/src/test/java/org/apache/atlas/web/resources/MetadataDiscoveryJerseyResourceIT.java 87d8719fda4072ef84072a7ab931fe010f9fb8cb 
>   webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java 2ef33c3ff0c25a179bc7f5ca1b89c7ac12e94b7c 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/1/
> 
> 
> Testing
> -------
> 
> Junits run successfuly. 
> 1) Using the sample json, issued a Rest call to create the relationshipDef
> 2) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/typedefs/ retuens the relationshipdef
> 3) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/relationshipdef/name/Testrel4 returns the relationshipdef
> 
> 
> Sample json
> "{
>     "enumDefs": [],
>     "structDefs": [],
>     "classificationDefs": [],
>     "entityDefs": [
>       {
>               "name": "TestEnt11",
>               "superTypes": [],
>               "typeVersion": "1.0",
>               "attributeDefs": [
>                   {
>                       "name": "name",
>                       "typeName": "string",
>                       "cardinality": "SINGLE",
>                       "isIndexable": true,
>                       "isOptional": false,
>                       "isUnique": false
>                   }
>                 ]
>     },
>     {
>         "name": "TestEnt12",
>         "superTypes": [],
>         "typeVersion": "1.0",
>         "attributeDefs": [
>             {
>                 "name": "name",
>                 "typeName": "string",
>                 "cardinality": "SINGLE",
>                 "isIndexable": true,
>                 "isOptional": false,
>                 "isUnique": false
>             }
>           ]
> 
>     }
>     ],
>     "relationshipDefs" :[
>         {
>             "name": "Testrel4",
>             "typeVersion": "1.0",
> 
>             "endPointDef1": {
>               "name": "aaa",
>               "type": "TestEnt11",
>               "cardinality":"SINGLE"
>             },
>             "endPointDef2": {
>               "name": "bbb",
>               "type": "TestEnt12",
>               "cardinality":"SINGLE"
>             },
>             "relationshipCategory":"ASSOCIATION",
>             "attributeDefs": [
>                 {
>                     "name": "testattr1",
>                     "typeName": "string",
>                     "cardinality": "SINGLE",
>                     "isIndexable": true,
>                     "isOptional": true,
>                     "isUnique": false
>                 }
>               ]
>         }
>     ]
> }
> "
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

Posted by Apoorv Naik <na...@gmail.com>.

> On June 11, 2017, 4:50 a.m., Madhan Neethiraj wrote:
> > intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java
> > Lines 140 (patched)
> > <https://reviews.apache.org/r/59719/diff/3/?file=1747603#file1747603line140>
> >
> >     I think it will be good to rename "isContainer()" to "getIsContainer()" - JSON serialization/deserialization might look for method names that start with get/set.

I think here @JsonProperty("isContainer") on the getter should help.


- Apoorv


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


On June 10, 2017, 10:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 10, 2017, 10:22 p.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
> This functions works
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> This is yet to do:
> 1) create after a delete 
> 2) updates do not work
> 2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
> 3) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/3/
> 
> 
> Testing
> -------
> 
> Junits complete successfully
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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



Updates look good. Please review few minor comments.


intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 187 (patched)
<https://reviews.apache.org/r/59719/#comment251239>

    isContainer1 and isContainer2 are not used (anymore); can be removed.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 235 (patched)
<https://reviews.apache.org/r/59719/#comment251244>

    setAttributeDefs() ==> setPropagateTags()



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 247 (patched)
<https://reviews.apache.org/r/59719/#comment251240>

    endPointDef1 and endPointDef2 can be null; please update to handle this case.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java
Lines 140 (patched)
<https://reviews.apache.org/r/59719/#comment251241>

    I think it will be good to rename "isContainer()" to "getIsContainer()" - JSON serialization/deserialization might look for method names that start with get/set.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 69 (patched)
<https://reviews.apache.org/r/59719/#comment251242>

    getAllAttributes() doesn't seem to be necessary. Simply calling super.resolveReferences() should be enough.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 169 (patched)
<https://reviews.apache.org/r/59719/#comment251243>

    Given no attribute will have datatype as a relationship-type, getTypeForAttribute() method is not necessary.


- Madhan Neethiraj


On June 10, 2017, 10:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 10, 2017, 10:22 p.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
> This functions works
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> This is yet to do:
> 1) create after a delete 
> 2) updates do not work
> 2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
> 3) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/3/
> 
> 
> Testing
> -------
> 
> Junits complete successfully
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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

(Updated June 12, 2017, 9:44 a.m.)


Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.


Changes
-------

I removed the call and the dependant methods


Repository: atlas


Description
-------

This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
This functions works
1) create relationshipDef
2) get typedefs
3) get typedef headers
4) get relationshgipdef by name
5) get relationshipDef by guid.
6) delete relationshipDef

This is yet to do:
1) create after a delete 
2) updates do not work
2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
3) Creation of edges between xxxDef vertexes. I will update the design with a proposal


Diffs (updated)
-----

  common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
  intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
  intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
  intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
  intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
  intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
  intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
  webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
  webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 


Diff: https://reviews.apache.org/r/59719/diff/5/

Changes: https://reviews.apache.org/r/59719/diff/4-5/


Testing
-------

Junits complete successfully
1) create relationshipDef
2) get typedefs
3) get typedef headers
4) get relationshgipdef by name
5) get relationshipDef by guid.
6) delete relationshipDef

Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.


Thanks,

David Radley


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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


Fix it, then Ship it!





intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 69 (patched)
<https://reviews.apache.org/r/59719/#comment251267>

    Is recomputing of allAttributes and uniqAttributes necessary here? As I mentioned in my earlier review, this should be handled in the call to super.resolveReferences() above.


- Madhan Neethiraj


On June 11, 2017, 11:24 a.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 11, 2017, 11:24 a.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
> This functions works
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> This is yet to do:
> 1) create after a delete 
> 2) updates do not work
> 2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
> 3) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java PRE-CREATION 
>   webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/4/
> 
> 
> Testing
> -------
> 
> Junits complete successfully
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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

(Updated June 11, 2017, 11:24 a.m.)


Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.


Changes
-------

Addressed the latest issues that have been raised


Repository: atlas


Description
-------

This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
This functions works
1) create relationshipDef
2) get typedefs
3) get typedef headers
4) get relationshgipdef by name
5) get relationshipDef by guid.
6) delete relationshipDef

This is yet to do:
1) create after a delete 
2) updates do not work
2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
3) Creation of edges between xxxDef vertexes. I will update the design with a proposal


Diffs (updated)
-----

  common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
  intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
  intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
  intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
  intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
  intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
  intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
  webapp/src/main/java/org/apache/atlas/examples/CreateTypesFromJsonFileUtil.java PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/examples/UpdateTypesFromJsonFileUtil.java PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
  webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 


Diff: https://reviews.apache.org/r/59719/diff/4/

Changes: https://reviews.apache.org/r/59719/diff/3-4/


Testing
-------

Junits complete successfully
1) create relationshipDef
2) get typedefs
3) get typedef headers
4) get relationshgipdef by name
5) get relationshipDef by guid.
6) delete relationshipDef

Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.


Thanks,

David Radley


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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

(Updated June 10, 2017, 10:22 p.m.)


Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.


Changes
-------

Making changes in response to review comments


Repository: atlas


Description (updated)
-------

This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
This functions works
1) create relationshipDef
2) get typedefs
3) get typedef headers
4) get relationshgipdef by name
5) get relationshipDef by guid.
6) delete relationshipDef

This is yet to do:
1) create after a delete 
2) updates do not work
2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
3) Creation of edges between xxxDef vertexes. I will update the design with a proposal


Diffs (updated)
-----

  common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
  intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
  intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
  intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
  intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
  intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
  intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
  webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
  webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 


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

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


Testing (updated)
-------

Junits complete successfully
1) create relationshipDef
2) get typedefs
3) get typedef headers
4) get relationshgipdef by name
5) get relationshipDef by guid.
6) delete relationshipDef

Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.


Thanks,

David Radley


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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

> On June 9, 2017, 4:06 p.m., Madhan Neethiraj wrote:
> > intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
> > Lines 182 (patched)
> > <https://reviews.apache.org/r/59719/diff/2/?file=1746756#file1746756line182>
> >
> >     I think it will help to keep classes in model package (i.e. the ones used in REST inteface) simple, with no validation, etc. There is not enough context here to perform validatation here - like whether the types referenced by endPoints are valid or not. And, given these validations can fail during deserialization of  REST call parameters, the call might not make to Atlas application code - hence the error message will not be in logs.
> >     
> >     The validations should move to AtlasRelationshipType.resolveReferences(), where other validations like references to other types can be validated.

makes sense - I have moved the validations


> On June 9, 2017, 4:06 p.m., Madhan Neethiraj wrote:
> > repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
> > Lines 273 (patched)
> > <https://reviews.apache.org/r/59719/diff/2/?file=1746770#file1746770line279>
> >
> >     'typesystem' is for legacy support and I think there shouldn't be a need to keep it updated for core model changes like introduction of relationships. It will save a lot of time if we keep these features accessible only via new V2 API. Consider reverting these changes.
> >     
> >     typesystem is currently used by DSL and notification libraries. These need to be reviewed and updated to use V2 equivalents (AtlasTypeRegistry).

removed all of these files  - apart for the typeCategory RELATIONSHIP enum.


> On June 9, 2017, 4:06 p.m., Madhan Neethiraj wrote:
> > webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java
> > Line 22 (original), 22 (patched)
> > <https://reviews.apache.org/r/59719/diff/2/?file=1746780#file1746780line22>
> >
> >     Avoiding changes like 'collape of imports', 'whitespace only changes' will make reviewing a little easier and importantly will not distract from focusing on important changes.

reverting this line gives import errors. So I think is needs more than the original imports.


- David


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


On June 10, 2017, 10:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 10, 2017, 10:22 p.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
> This functions works
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> This is yet to do:
> 1) create after a delete 
> 2) updates do not work
> 2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
> 3) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasRelationshipType.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java 08121d8d9c0ed34f62a9e4d49c4be87a98639907 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/3/
> 
> 
> Testing
> -------
> 
> Junits complete successfully
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 6) delete relationshipDef
> 
> Delete is successful in as far as the get typedefs does not show the relationshipDef. But a subsequent create fails as it thinks the vertex exists. Investigating.
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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




intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 182 (patched)
<https://reviews.apache.org/r/59719/#comment251054>

    I think it will help to keep classes in model package (i.e. the ones used in REST inteface) simple, with no validation, etc. There is not enough context here to perform validatation here - like whether the types referenced by endPoints are valid or not. And, given these validations can fail during deserialization of  REST call parameters, the call might not make to Atlas application code - hence the error message will not be in logs.
    
    The validations should move to AtlasRelationshipType.resolveReferences(), where other validations like references to other types can be validated.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 273 (patched)
<https://reviews.apache.org/r/59719/#comment251055>

    - propagateTags needs to be copied as well
    - copy of attributeDefs should already be handled in super(other) above



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 279 (patched)
<https://reviews.apache.org/r/59719/#comment251056>

    addAttribute() and setAttributeDefs() method overrides here seem unnecessary. Please review.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 299 (patched)
<https://reviews.apache.org/r/59719/#comment251057>

    relationshipCategory and propagateTags are missed here. Please review.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 313 (patched)
<https://reviews.apache.org/r/59719/#comment251058>

    propagateTags is not being handled here. Please review.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 322 (patched)
<https://reviews.apache.org/r/59719/#comment251059>

    relationshipCategory and propagateTags are missed here. Please review.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java
Lines 159 (patched)
<https://reviews.apache.org/r/59719/#comment251060>

    "attribute" ==> "name"



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 68 (patched)
<https://reviews.apache.org/r/59719/#comment251061>

    It seems lines #68 - #72 are not needed; these should be handled in the above call to super.resolveReferences(typeRegistry). This override may not be necessary. Please review.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 76 (patched)
<https://reviews.apache.org/r/59719/#comment251069>

    Given this override simply calls base class implementation, consider removing this method.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 82 (patched)
<https://reviews.apache.org/r/59719/#comment251071>

    This override should:
    - take AtlasRelationship as parameter type; if this type is not defined yet, Sarath can update this method later once his instance-API adds the type
    - call super.populateDefaultValues(obj) to handle struct attribute default values



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 100 (patched)
<https://reviews.apache.org/r/59719/#comment251072>

    This method is already present in the base class, AtlasStructType. Unless this override has a different implementation, consider removing this method.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 122 (patched)
<https://reviews.apache.org/r/59719/#comment251073>

    "AtlasEntity" ==> "AtlasRelationship"



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 141 (patched)
<https://reviews.apache.org/r/59719/#comment251074>

    "AtlasEntity" ==> "AtlasRelationship"



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 154 (patched)
<https://reviews.apache.org/r/59719/#comment251077>

    This override should not be necessary, as base class implementation should suffice. Please review.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 161 (patched)
<https://reviews.apache.org/r/59719/#comment251076>

    This method should not be overridden for AtlasRelationType. This is needed only for array/map/entity types.



repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
Lines 273 (patched)
<https://reviews.apache.org/r/59719/#comment251086>

    'typesystem' is for legacy support and I think there shouldn't be a need to keep it updated for core model changes like introduction of relationships. It will save a lot of time if we keep these features accessible only via new V2 API. Consider reverting these changes.
    
    typesystem is currently used by DSL and notification libraries. These need to be reviewed and updated to use V2 equivalents (AtlasTypeRegistry).



webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java
Line 22 (original), 22 (patched)
<https://reviews.apache.org/r/59719/#comment251082>

    Avoiding changes like 'collape of imports', 'whitespace only changes' will make reviewing a little easier and importantly will not distract from focusing on important changes.


- Madhan Neethiraj


On June 9, 2017, 1:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 9, 2017, 1:22 p.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
> 
> 1) relationshipdef updates and deletes have not been sueccessfully tested
> 2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
> 3) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipType.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
>   repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java 7a064b600cb6b3e02a814f45370fcc9041ebcd7e 
>   repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java 262f784f50805c8fccde77cfe739e8538b49ab8d 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/2/
> 
> 
> Testing
> -------
> 
> Junits show an error. I am publishing this patch - now at master, for more feedback. I will investigate. 
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 
> There is code in for delete - but it does not appear to be effective. I am continuing to invesigate
> There is code in for update - but this is failing as the delete is not working I am continuing to invesigate
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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




intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
Lines 76 (patched)
<https://reviews.apache.org/r/59719/#comment251099>

    Consider renaming "RELATIONSHIPDEF_NON_PRIMITIVE_ATTRIBUTE" to "RELATIONSHIPDEF_UNSUPPORTED_ATTRIBUTE_TYPE"



intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
Lines 121 (patched)
<https://reviews.apache.org/r/59719/#comment251100>

    INVALID_RELATIONSHIP_ISCONTAINER_TWICE seems to duplicate RELATIONSHIPDEF_DOUBLE_CONTAINERS. Please review.



intg/src/main/java/org/apache/atlas/model/TypeCategory.java
Line 21 (original), 21 (patched)
<https://reviews.apache.org/r/59719/#comment251101>

    It is a good practice to add enum lements at the end of existing ones.



intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 68 (patched)
<https://reviews.apache.org/r/59719/#comment251107>

    AtlasRelationshipType.resolveReferences() should: 
    - validate that endPointDef1.type and endPointDef2.type refer to known entity-types
    - validate that endPointDef1.name and endPointDef2.name don't conflict with existing attributes/relationship-attributes in the entity-types
    - perform validations currently being done in AtlasRelationshipDef



repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipType.java
Lines 45 (patched)
<https://reviews.apache.org/r/59719/#comment251111>

    AtlasRelationshipType is already defined in intg module. This version in repository module should be removed.



repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
Line 447 (original), 493 (patched)
<https://reviews.apache.org/r/59719/#comment251112>

    preDeleteRelationshipDefs is not populated before referencing in line #501, #503. Add a block to populate preDeleteRelationshipDefs - similar to the one for preDeleteEntityDefs in lines #484 - #492.



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

    Is 'modelCategory' member necessary? The value will always be TypeCategory.RELATIONSHIP for all instance of this class.



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

    Create edges to types referenced by attributes (like enumDefs) with the following call:
      - AtlasStructDefStoreV1.updateVertexAddReferences(structDef, vertex, typeDefStore);
    
    In addition, create edges to types referenced by endPointDef1.type and endPointDef1.type.



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

    TypeCategory.CLASS ==> TypeCategory.RELATIONSHIP



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

    TypeCategory.CLASS ==> TypeCategory.RELATIONSHIP



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

    TypeCategory.CLASS ==> TypeCategory.RELATIONSHIP



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

    TypeCategory.CLASS ==> TypeCategory.RELATIONSHIP



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

    update references to other types:
    - for addition of new attributes 
    - changes in endPointDef1.type, endPointDef2.type



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

    TypeCategory.CLASS ==> TypeCategory.RELATIONSHIP



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

    update references to other types:
    - for addition of new attributes 
    - changes in endPointDef1.type, endPointDef2.type



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

    Isn't enough to look for TypeCategory.RELATIONSHIP -  why look for TypeCategory.CLASS, then fall back to look for TypeCategory.RELATIONSHIP.



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

    >> AtlasGraphUtilsV1.typeHasInstanceVertex()
    For relationships, we should look for presence fo any edges, not vertex, with typeName == name. Please review.



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

    Isn't enough to look for TypeCategory.RELATIONSHIP -  why look for TypeCategory.CLASS, then fall back to look for TypeCategory.RELATIONSHIP.



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

    >> AtlasGraphUtilsV1.typeHasInstanceVertex()
    For relationships, we should look for presence fo any edges, not vertex, with typeName == name. Please review.



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

    Haven't seen use of setJsonProperty()/getJsonProperty() before. I think we might have better control with one of the following approaches:
    - save Json-ified string (of endPointDef1, endPointDef2) in string typed vertex property
    - save fields of endPointDef1, endPointDef2 in individual vertex properties, like: endPointDef1.type, endPointDef1.name, endPointDef1.isContainer, endPointDef1.cardinality, endPointDef2.type, ..


- Madhan Neethiraj


On June 9, 2017, 1:22 p.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 9, 2017, 1:22 p.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 
> 
> 1) relationshipdef updates and deletes have not been sueccessfully tested
> 2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
> 3) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipType.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
>   repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java 7a064b600cb6b3e02a814f45370fcc9041ebcd7e 
>   repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java 262f784f50805c8fccde77cfe739e8538b49ab8d 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/2/
> 
> 
> Testing
> -------
> 
> Junits show an error. I am publishing this patch - now at master, for more feedback. I will investigate. 
> 1) create relationshipDef
> 2) get typedefs
> 3) get typedef headers
> 4) get relationshgipdef by name
> 5) get relationshipDef by guid.
> 
> There is code in for delete - but it does not appear to be effective. I am continuing to invesigate
> There is code in for update - but this is failing as the delete is not working I am continuing to invesigate
> 
> 
> Thanks,
> 
> David Radley
> 
>


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

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

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


Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.


Changes
-------

updated the patch to master.


Repository: atlas


Description (updated)
-------

This patch introduces the relationshipDef as a new top level TypeDef, that is stored as a vertex in the graph. Other subtasks are required to complete the Relationshipdef work. 

1) relationshipdef updates and deletes have not been sueccessfully tested
2) further constraints are required - around checking exising EntityDefs and RelationshipDefs for consistancy. This piece will not be handled in this subtask 
3) Creation of edges between xxxDef vertexes. I will update the design with a proposal


Diffs (updated)
-----

  common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java d723b2a9fe03245f78bf9af53058aaa801e62aff 
  intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
  intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
  intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 1b3526bfcc7d13aa397844c5dec55e34dbc8ed7e 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
  intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
  intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipType.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 17b7e17742de97bb9de2a4b375fea3c58b75e26b 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java f0c83806980153bab8a31647281015376a9d2168 
  repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java 7a064b600cb6b3e02a814f45370fcc9041ebcd7e 
  repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java 262f784f50805c8fccde77cfe739e8538b49ab8d 
  typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
  typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
  typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
  typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
  webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java c32f36ea3a5025d2cec11b6ac0bdfe192e9c05f9 


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

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


Testing (updated)
-------

Junits show an error. I am publishing this patch - now at master, for more feedback. I will investigate. 
1) create relationshipDef
2) get typedefs
3) get typedef headers
4) get relationshgipdef by name
5) get relationshipDef by guid.

There is code in for delete - but it does not appear to be effective. I am continuing to invesigate
There is code in for update - but this is failing as the delete is not working I am continuing to invesigate


Thanks,

David Radley


Re: Review Request 59719: ATLAS-1852 Create RelationshipDef

Posted by Graham Wallis <gr...@uk.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59719/#review176902
-----------------------------------------------------------




common/src/main/java/org/apache/atlas/repository/Constants.java
Lines 51 (patched)
<https://reviews.apache.org/r/59719/#comment250444>

    It wasn't obvious to me that these constants are used - the actual relationshipDef seems to not use the xxx_KEY forms.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 49 (patched)
<https://reviews.apache.org/r/59719/#comment250450>

    Possibly nicer to import java.io.Serializable and then just refer to the class here.



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 124 (patched)
<https://reviews.apache.org/r/59719/#comment250445>

    I think you might have wanted to test endPointDef2 here



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 160 (patched)
<https://reviews.apache.org/r/59719/#comment250446>

    Is there no need to clone attributeDefs of 'other'?



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 187 (patched)
<https://reviews.apache.org/r/59719/#comment250447>

    Helpful to include attributeDefs here?



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 216 (patched)
<https://reviews.apache.org/r/59719/#comment250448>

    Remember to check attributeDefs



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
Lines 221 (patched)
<https://reviews.apache.org/r/59719/#comment250449>

    Shouldn't the hashcode depend on the relationshipCategory as well? Ditto attributeDefs?



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java
Lines 70 (patched)
<https://reviews.apache.org/r/59719/#comment250451>

    Do you need this setter in addition to the setContainer() method?



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java
Lines 74 (patched)
<https://reviews.apache.org/r/59719/#comment250452>

    Do you need this getter in addition to the isContainer() method?



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java
Lines 117 (patched)
<https://reviews.apache.org/r/59719/#comment250453>

    I think you might have wanted to return this.isContainer ;-) [ No parameter needed ]



intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java
Lines 127 (patched)
<https://reviews.apache.org/r/59719/#comment250454>

    Did you really mean to label the name as attribute?



intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
Line 35 (original), 49 (patched)
<https://reviews.apache.org/r/59719/#comment250456>

    importing jersey from com.sun.xxx suggests that we have mixed versions of Glassfish in Atlas. Do we need to refine these onto a 2.x base?



intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
Lines 273 (patched)
<https://reviews.apache.org/r/59719/#comment250458>

    Did you really want both this getTypesDef() and the one without the relationships (see below)?



intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java
Lines 456 (patched)
<https://reviews.apache.org/r/59719/#comment250459>

    Remember the TODO



repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java
Lines 185 (patched)
<https://reviews.apache.org/r/59719/#comment250460>

    Any point just rethrowing existing exception (without logging etc)?



typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java
Lines 106 (patched)
<https://reviews.apache.org/r/59719/#comment250462>

    setContainer and isContainer are additional to existing setter and getter above



typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java
Lines 111 (patched)
<https://reviews.apache.org/r/59719/#comment250461>

    No parameter needed; ensure return this.isContainer.



typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java
Lines 122 (patched)
<https://reviews.apache.org/r/59719/#comment250463>

    Possibly meant to label as 'name'



typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java
Lines 231 (patched)
<https://reviews.apache.org/r/59719/#comment250464>

    Comments appears to be out of place



typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java
Lines 238 (patched)
<https://reviews.apache.org/r/59719/#comment250465>

    Do we need to dump more into the toString - e.g. atrributeDefs and maybe name, relationshipCategory, etc?



typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java
Lines 256 (patched)
<https://reviews.apache.org/r/59719/#comment250466>

    This class doesn't appear to extend anything - so would not have a super.



typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java
Lines 270 (patched)
<https://reviews.apache.org/r/59719/#comment250467>

    No super


- Graham Wallis


On June 2, 2017, 10:25 a.m., David Radley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59719/
> -----------------------------------------------------------
> 
> (Updated June 2, 2017, 10:25 a.m.)
> 
> 
> Review request for atlas, Graham Wallis, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch introduces the relationshipDef as a new top level TypeDef, that is storted as a vertex in the graph. Other subtasks with complete the Relationshipdef work. 
> 
> Work that is not included in this patch:
> 1) get relationship by guid is not working
> 2) relationshipdef updates have not been tested
> 3) further constraints are required. I will update the design doc with a proposal
> 4) Tag propagation - I think there are still ongoing discussions we should come to consensus on this - it would be easy to add
> 5) Creation of edges between xxxDef vertexes. I will update the design with a proposal
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/ApplicationProperties.java a35bdfee72a460b3aa793a40c41618dba31e1fb9 
>   common/src/main/java/org/apache/atlas/repository/Constants.java bcdf08cdfbf1d4d8689d3d79413b2ff181b621a4 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 298df6b0171b9b5e0683cd0787c6cdfd2e714f5e 
>   intg/src/main/java/org/apache/atlas/model/TypeCategory.java e47a8a7dab0aac6154833a58148412590be6f796 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasBaseTypeDef.java 7308eb73b513660affaf35b944556d7076289815 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipEndPointDef.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java af95bff5b53bf14057c53820cc62255d37c50498 
>   intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java 198bd8fe515a96e654b24de3af92b6edfac3a6ae 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/type/AtlasType.java 28d0a0748e3357a275bfec5b88cb522f9edfd9c2 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java 29ea60304826ab1c94b5f74614350732415da8a6 
>   intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java c0135f524b2ee926fb94aae31e6b49dab424a19a 
>   intg/src/test/java/org/apache/atlas/model/ModelTestUtil.java 084bcc4609591fd24dc0ee79290be1b337068e6a 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasClassificationDef.java a1abc6e754ff5b45e3f2aabfcc94ff356ff16327 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasEntityDef.java 46d4d065f6f0f89e98a7c6f56c6a261c575bbfc8 
>   intg/src/test/java/org/apache/atlas/model/typedef/TestAtlasRelationshipDef.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/converters/TypeConverterUtil.java 7902100e80a400a5097554800ac2d862b9148144 
>   repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java ca7fad068769dc72d90b18f7ae6ae84143792760 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipDefStore.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java 4a8e1de7942156f0888bacb03479e7f9b2055512 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStream.java eb860ff2a250d122881dd54eb3d2de2986f6f8e6 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java 3bf318f025f1b1edc9c35be08083fc8f0ed2add3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityStream.java 3444bfd6d8b972b6f2f652a6a8e49cb0619145b6 
>   repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java ac135863e82a815a580a095d2942088f571e35a9 
>   repository/src/main/java/org/apache/atlas/repository/typestore/ITypeStore.java 84779f409b47b29f21accb2b5a94e068801a740f 
>   repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java 8573719c912cfac35759da96bf4bcf8a06a75ee1 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypePersistenceVisitor.java bfb1bfc75c1c3ab5f80937d40c325e1b065265a3 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVertexFinder.java 8b381524055aefcb0c7b0f07f773a6250fedb51d 
>   repository/src/main/java/org/apache/atlas/repository/typestore/TypeVisitor.java a6e353c18d690201818c899666f4fecb63172e42 
>   repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java fd85ef0f6d4859ae6da53e5cac49b577e225519a 
>   repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java a7cb2e5b541db27bd19818ee5e3639ebca0a6389 
>   repository/src/test/java/org/apache/atlas/TestUtils.java cf39d8d8130a97e5709036c1d406227f4f026027 
>   repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryDeleteTestBase.java 4fd416c70bd307a9c2cc358d5a059bab1bb9d3f9 
>   repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateTestBase.java c08fbc99908f2a4c4be2eee337e6ef0c7151033d 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasDeleteHandlerV1Test.java 9a11e087515909e271301f85786f1bdfbdad789a 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 1dd727661ca8a8d59caaee0f3aa9854fb4b631ea 
>   repository/src/test/java/org/apache/atlas/repository/typestore/GraphBackedTypeStoreTest.java 65cd9386ada156e5fa975433a5c5fa89698e49e0 
>   repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala c844558a9463d0953274ba28c54e08272a93ce89 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 21d5f1a1e7488c73ab84ec9512d488ed3b9002bf 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalTypeDefinition.java ab63fea3c6695065943a7b11fdb71cec8f79565d 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipEndPointDef.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipType.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/RelationshipTypeDefinition.java PRE-CREATION 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java c853ec655676eed99d93ced9f0f0de18c77bc27a 
>   typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java f131458fc36dd4e9c29b49ce903446526d020877 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/TypesDef.scala b51048df2c9bccf904ffd5287d5021d2294fe458 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/builders/TypesBuilder.scala 5ea345feeee79dec15c9fa5cd27724aedf50eaae 
>   typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 4478a44b55f745076c9f15a47371b3863ca56c9c 
>   typesystem/src/test/java/org/apache/atlas/typesystem/json/SerializationJavaTest.java 5ee019cba021e3e372c555558ad46690ffe73ea7 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/BaseTest.java 95c99e4f6c112d71fafd11bda4c41e9dd5ce71dd 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/ClassTest.java daecdd78c952747964885d4cb8cdfb59727ffee5 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java 23071922a4b59b690f8c670a043203a031523c28 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/FieldMappingTest.java 0259ade905929aa021c11dba795f252ee07e27d8 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java 3a1675e1a34683fc9645e3ad7a4b13a9da924aae 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TraitTest.java 7c3921386c8ad582a594504b9b0f82c513cabd40 
>   typesystem/src/test/java/org/apache/atlas/typesystem/types/TypeSystemTest.java 0ef5d10d9dccae64f644470070ed5a345d191ebd 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala 931773dd2b184181743f56971d38a09be8b96e26 
>   typesystem/src/test/scala/org/apache/atlas/typesystem/json/TypesSerializationTest.scala cfd4bdb26482c187c4e80f110b7349df8b524e6e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStart.java 91ba1113b706415d236a3319291500c32322d83e 
>   webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java a95fac37546867cfe6c43b72804c0384b091e195 
>   webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java b461a6a5c652d961931ed9b3dac598a5d27c30b5 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java 5d846cf317ae46fa88ef7877baad129638e38e03 
>   webapp/src/test/java/org/apache/atlas/util/RestUtilsTest.java 87259df2443d858dd305e71be00cee2c7e7c0815 
>   webapp/src/test/java/org/apache/atlas/web/adapters/TestEntityREST.java cadf0ffffc387cf60ded99945cb90d13c86cf3d9 
>   webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java 457dc394680ae8e6a44fcb7619e6df7c746deff8 
>   webapp/src/test/java/org/apache/atlas/web/resources/DataSetLineageJerseyResourceIT.java ee4057d41174765e666eff0e3aaaf00ffc780e92 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityDiscoveryJerseyResourceIT.java a51f3716d66485941c29d57f5aafdf44753176b7 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java f2af20825cd04f07cf1a50f453f82dfed7880a79 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityResourceTest.java 21060d14ac82e037466d8a3490aac9ba721ac611 
>   webapp/src/test/java/org/apache/atlas/web/resources/EntityV2JerseyResourceIT.java 9d5ff5a829241299df84fa429d6199fc3ea16302 
>   webapp/src/test/java/org/apache/atlas/web/resources/MetadataDiscoveryJerseyResourceIT.java 87d8719fda4072ef84072a7ab931fe010f9fb8cb 
>   webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java 2ef33c3ff0c25a179bc7f5ca1b89c7ac12e94b7c 
> 
> 
> Diff: https://reviews.apache.org/r/59719/diff/1/
> 
> 
> Testing
> -------
> 
> Junits run successfuly. 
> 1) Using the sample json, issued a Rest call to create the relationshipDef
> 2) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/typedefs/ retuens the relationshipdef
> 3) curl --user admin:admin http://127.0.0.1:21000/api/atlas/v2/types/relationshipdef/name/Testrel4 returns the relationshipdef
> 
> 
> Sample json
> "{
>     "enumDefs": [],
>     "structDefs": [],
>     "classificationDefs": [],
>     "entityDefs": [
>       {
>               "name": "TestEnt11",
>               "superTypes": [],
>               "typeVersion": "1.0",
>               "attributeDefs": [
>                   {
>                       "name": "name",
>                       "typeName": "string",
>                       "cardinality": "SINGLE",
>                       "isIndexable": true,
>                       "isOptional": false,
>                       "isUnique": false
>                   }
>                 ]
>     },
>     {
>         "name": "TestEnt12",
>         "superTypes": [],
>         "typeVersion": "1.0",
>         "attributeDefs": [
>             {
>                 "name": "name",
>                 "typeName": "string",
>                 "cardinality": "SINGLE",
>                 "isIndexable": true,
>                 "isOptional": false,
>                 "isUnique": false
>             }
>           ]
> 
>     }
>     ],
>     "relationshipDefs" :[
>         {
>             "name": "Testrel4",
>             "typeVersion": "1.0",
> 
>             "endPointDef1": {
>               "name": "aaa",
>               "type": "TestEnt11",
>               "cardinality":"SINGLE"
>             },
>             "endPointDef2": {
>               "name": "bbb",
>               "type": "TestEnt12",
>               "cardinality":"SINGLE"
>             },
>             "relationshipCategory":"ASSOCIATION",
>             "attributeDefs": [
>                 {
>                     "name": "testattr1",
>                     "typeName": "string",
>                     "cardinality": "SINGLE",
>                     "isIndexable": true,
>                     "isOptional": true,
>                     "isUnique": false
>                 }
>               ]
>         }
>     ]
> }
> "
> 
> 
> Thanks,
> 
> David Radley
> 
>