You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Suma Shivaprasad <su...@gmail.com> on 2017/01/25 02:55:54 UTC

Review Request 55912: Add UTS for Array, map, struct and entity updates

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

Review request for atlas.


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


Repository: atlas


Description
-------

Fixed issues in entity discovery, collections etc found during testing


Diffs
-----

  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java e4f3dfd 
  intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java 8aba1fb 
  intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4712508 
  intg/src/test/java/org/apache/atlas/TestUtilsV2.java f9040f3 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b874c5d 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java 18e397b 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 1947855 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java 425bde9 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 174e490 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityMutationContext.java f942a91 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/IDBasedEntityResolver.java 488f141 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/MapVertexMapper.java 9d219f5 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/StructVertexMapper.java ae9ecc4 
  repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 0ff33ba 

Diff: https://reviews.apache.org/r/55912/diff/


Testing
-------


Thanks,

Suma Shivaprasad


Re: Review Request 55912: Add UTS for Array, map, struct and entity updates

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




intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java (line 71)
<https://reviews.apache.org/r/55912/#comment234571>

    add @JsonIgnore?



intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java (line 80)
<https://reviews.apache.org/r/55912/#comment234572>

    add @JsonIgnore?



intg/src/main/java/org/apache/atlas/type/AtlasStructType.java (line 323)
<https://reviews.apache.org/r/55912/#comment234574>

    This method is no more used elsewhere. Consider marking this as private.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java (line 230)
<https://reviews.apache.org/r/55912/#comment234575>

    Replacing this 'for' with:
      for (AtlasAttribite attribute : structType.getAllAttributes().values()) {
      
    can help eliminate hash table lookups in line #231 and #233. Please review any other such usage as well.


- Madhan Neethiraj


On Jan. 26, 2017, 4:32 a.m., Suma Shivaprasad wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55912/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2017, 4:32 a.m.)
> 
> 
> Review request for atlas.
> 
> 
> Bugs: ATLAS-1498
>     https://issues.apache.org/jira/browse/ATLAS-1498
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Fixed issues in entity discovery, collections etc found during testing
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java e4f3dfd 
>   intg/src/main/java/org/apache/atlas/model/instance/AtlasStruct.java 794310a 
>   intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java 8aba1fb 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java 5ad3a55 
>   intg/src/main/java/org/apache/atlas/type/AtlasMapType.java 6e6c522 
>   intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4712508 
>   intg/src/main/java/org/apache/atlas/type/AtlasType.java 6ea34b3 
>   intg/src/test/java/org/apache/atlas/TestUtilsV2.java f9040f3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/ArrayVertexMapper.java 528430c 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b874c5d 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java 18e397b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 1947855 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java 425bde9 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java 3b557e6 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 174e490 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityMutationContext.java f942a91 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphMutationContext.java d5ba7e1 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/IDBasedEntityResolver.java 488f141 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/MapVertexMapper.java 9d219f5 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/StructVertexMapper.java ae9ecc4 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/UniqAttrBasedEntityResolver.java 8025f1e 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 0ff33ba 
>   webapp/src/main/java/org/apache/atlas/web/adapters/AtlasEntityFormatConverter.java 74ab740 
>   webapp/src/main/java/org/apache/atlas/web/adapters/AtlasInstanceRestAdapters.java 2b13552 
> 
> Diff: https://reviews.apache.org/r/55912/diff/
> 
> 
> Testing
> -------
> 
> All tests till webapp are passing. In webapp , UTs are failing which need to be fixed
> 
> Failed tests:
>   TestEntitiesREST.testCreateOrUpdateEntities:105 � AtlasBase expected type Map ...
>   TestEntityREST.testGetEntityById:97 expected:<false> but was:<null>
>   TestEntityREST.testUpdateGetDeleteEntityByUniqueAttribute:171 expected:<false> but was:<null>
> 
> 
> Thanks,
> 
> Suma Shivaprasad
> 
>


Re: Review Request 55912: Add UTS for Array, map, struct and entity updates

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


Ship it!




Ship It!

- Madhan Neethiraj


On Jan. 26, 2017, 8:05 p.m., Suma Shivaprasad wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55912/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2017, 8:05 p.m.)
> 
> 
> Review request for atlas.
> 
> 
> Bugs: ATLAS-1498
>     https://issues.apache.org/jira/browse/ATLAS-1498
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Fixed issues in entity discovery, collections etc found during testing
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java e4f3dfd 
>   intg/src/main/java/org/apache/atlas/model/instance/AtlasStruct.java 794310a 
>   intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java 8aba1fb 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java 5ad3a55 
>   intg/src/main/java/org/apache/atlas/type/AtlasMapType.java 6e6c522 
>   intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4712508 
>   intg/src/main/java/org/apache/atlas/type/AtlasType.java 6ea34b3 
>   intg/src/test/java/org/apache/atlas/TestUtilsV2.java f9040f3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/ArrayVertexMapper.java 528430c 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b874c5d 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java 18e397b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 1947855 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java 425bde9 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java 3b557e6 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 174e490 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityMutationContext.java f942a91 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphMutationContext.java d5ba7e1 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/IDBasedEntityResolver.java 488f141 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/MapVertexMapper.java 9d219f5 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/StructVertexMapper.java ae9ecc4 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/UniqAttrBasedEntityResolver.java 8025f1e 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 0ff33ba 
>   webapp/src/main/java/org/apache/atlas/web/adapters/AtlasEntityFormatConverter.java 74ab740 
>   webapp/src/main/java/org/apache/atlas/web/adapters/AtlasInstanceRestAdapters.java 2b13552 
>   webapp/src/test/java/org/apache/atlas/web/adapters/TestEntitiesREST.java c55234c 
> 
> Diff: https://reviews.apache.org/r/55912/diff/
> 
> 
> Testing
> -------
> 
> All tests till webapp are passing. In webapp , UTs are failing which need to be fixed
> 
> Failed tests:
>   TestEntitiesREST.testCreateOrUpdateEntities:105 � AtlasBase expected type Map ...
>   TestEntityREST.testGetEntityById:97 expected:<false> but was:<null>
>   TestEntityREST.testUpdateGetDeleteEntityByUniqueAttribute:171 expected:<false> but was:<null>
> 
> 
> Thanks,
> 
> Suma Shivaprasad
> 
>


Re: Review Request 55912: Add UTS for Array, map, struct and entity updates

Posted by Suma Shivaprasad <su...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55912/
-----------------------------------------------------------

(Updated Jan. 26, 2017, 8:05 p.m.)


Review request for atlas.


Changes
-------

Fixed tests in webapp and review comments


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


Repository: atlas


Description
-------

Fixed issues in entity discovery, collections etc found during testing


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java e4f3dfd 
  intg/src/main/java/org/apache/atlas/model/instance/AtlasStruct.java 794310a 
  intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java 8aba1fb 
  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java 5ad3a55 
  intg/src/main/java/org/apache/atlas/type/AtlasMapType.java 6e6c522 
  intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4712508 
  intg/src/main/java/org/apache/atlas/type/AtlasType.java 6ea34b3 
  intg/src/test/java/org/apache/atlas/TestUtilsV2.java f9040f3 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/ArrayVertexMapper.java 528430c 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b874c5d 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java 18e397b 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 1947855 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java 425bde9 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java 3b557e6 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 174e490 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityMutationContext.java f942a91 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphMutationContext.java d5ba7e1 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/IDBasedEntityResolver.java 488f141 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/MapVertexMapper.java 9d219f5 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/StructVertexMapper.java ae9ecc4 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/UniqAttrBasedEntityResolver.java 8025f1e 
  repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 0ff33ba 
  webapp/src/main/java/org/apache/atlas/web/adapters/AtlasEntityFormatConverter.java 74ab740 
  webapp/src/main/java/org/apache/atlas/web/adapters/AtlasInstanceRestAdapters.java 2b13552 
  webapp/src/test/java/org/apache/atlas/web/adapters/TestEntitiesREST.java c55234c 

Diff: https://reviews.apache.org/r/55912/diff/


Testing
-------

All tests till webapp are passing. In webapp , UTs are failing which need to be fixed

Failed tests:
  TestEntitiesREST.testCreateOrUpdateEntities:105 � AtlasBase expected type Map ...
  TestEntityREST.testGetEntityById:97 expected:<false> but was:<null>
  TestEntityREST.testUpdateGetDeleteEntityByUniqueAttribute:171 expected:<false> but was:<null>


Thanks,

Suma Shivaprasad


Re: Review Request 55912: Add UTS for Array, map, struct and entity updates

Posted by Suma Shivaprasad <su...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55912/
-----------------------------------------------------------

(Updated Jan. 26, 2017, 4:32 a.m.)


Review request for atlas.


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


Repository: atlas


Description
-------

Fixed issues in entity discovery, collections etc found during testing


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java e4f3dfd 
  intg/src/main/java/org/apache/atlas/model/instance/AtlasStruct.java 794310a 
  intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java 8aba1fb 
  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java 5ad3a55 
  intg/src/main/java/org/apache/atlas/type/AtlasMapType.java 6e6c522 
  intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4712508 
  intg/src/main/java/org/apache/atlas/type/AtlasType.java 6ea34b3 
  intg/src/test/java/org/apache/atlas/TestUtilsV2.java f9040f3 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/ArrayVertexMapper.java 528430c 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b874c5d 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java 18e397b 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 1947855 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java 425bde9 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java 3b557e6 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 174e490 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityMutationContext.java f942a91 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphMutationContext.java d5ba7e1 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/IDBasedEntityResolver.java 488f141 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/MapVertexMapper.java 9d219f5 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/StructVertexMapper.java ae9ecc4 
  repository/src/main/java/org/apache/atlas/repository/store/graph/v1/UniqAttrBasedEntityResolver.java 8025f1e 
  repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 0ff33ba 
  webapp/src/main/java/org/apache/atlas/web/adapters/AtlasEntityFormatConverter.java 74ab740 
  webapp/src/main/java/org/apache/atlas/web/adapters/AtlasInstanceRestAdapters.java 2b13552 

Diff: https://reviews.apache.org/r/55912/diff/


Testing (updated)
-------

All tests till webapp are passing. In webapp , UTs are failing which need to be fixed

Failed tests:
  TestEntitiesREST.testCreateOrUpdateEntities:105 � AtlasBase expected type Map ...
  TestEntityREST.testGetEntityById:97 expected:<false> but was:<null>
  TestEntityREST.testUpdateGetDeleteEntityByUniqueAttribute:171 expected:<false> but was:<null>


Thanks,

Suma Shivaprasad


Re: Review Request 55912: Add UTS for Array, map, struct and entity updates

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




repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java (line 73)
<https://reviews.apache.org/r/55912/#comment234315>

    preCreateOrUpdate - if this is not accessed outside this class, consider marking this as 'private'.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java (line 84)
<https://reviews.apache.org/r/55912/#comment234317>

    Consider replacing this line with:
    
      AtlasEntityType entityType  = typeRegistry.getEntityTypeByName(entity.getTypeName());



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java (line 214)
<https://reviews.apache.org/r/55912/#comment234316>

    Consider replacing the following lines:
      AtlasType type = typeRegistry.getType(entity.getTypeName());
      if (type.getTypeCategory() != TypeCategory.ENTITY) {
        throw new AtlasBaseException(AtlasErrorCode.TYPE_MATCH_FAILED, type.getTypeCategory().name(), TypeCategory.ENTITY.name());
      } 
    
    With:
      AtlasEntityType type = typeRegistry.getEntityTypeByName(entity.getTypeName());
      if (type == null) {
        throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID, TypeCategory.ENTITY.name(), entity.getTypeName());
      }
      
    Please review other such usage of typeRegistry.getType(name) for replacing with typeRegistry.get<entity/struct/classification/enum>TypeByName(name)


- Madhan Neethiraj


On Jan. 25, 2017, 2:55 a.m., Suma Shivaprasad wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55912/
> -----------------------------------------------------------
> 
> (Updated Jan. 25, 2017, 2:55 a.m.)
> 
> 
> Review request for atlas.
> 
> 
> Bugs: ATLAS-1498
>     https://issues.apache.org/jira/browse/ATLAS-1498
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Fixed issues in entity discovery, collections etc found during testing
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java e4f3dfd 
>   intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java 8aba1fb 
>   intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4712508 
>   intg/src/test/java/org/apache/atlas/TestUtilsV2.java f9040f3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b874c5d 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java 18e397b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 1947855 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java 425bde9 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 174e490 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityMutationContext.java f942a91 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/IDBasedEntityResolver.java 488f141 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/MapVertexMapper.java 9d219f5 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/StructVertexMapper.java ae9ecc4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 0ff33ba 
> 
> Diff: https://reviews.apache.org/r/55912/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Suma Shivaprasad
> 
>


Re: Review Request 55912: Add UTS for Array, map, struct and entity updates

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




intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java (line 46)
<https://reviews.apache.org/r/55912/#comment234297>

    this initialization seems unnecessary, as this gets initialized on demand in addEntity().



intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java (line 93)
<https://reviews.apache.org/r/55912/#comment234298>

    Consider the following little optimization:
    
    List<AtlasEntityHeader> opEntities = entitiesMutaged.get(op);
    
    if (opEntities == null) {
      opEntities = new ArrayList<>();
      entitiesMutated.put(opEntities);
    }
    
    opEntities.add(header);



intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java (line 105)
<https://reviews.apache.org/r/55912/#comment234299>

    Consider replacing this "if" block with a call to:
      AtlasBaseTypeDef.dumpObjects(entitiesMutated)



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java (line 141)
<https://reviews.apache.org/r/55912/#comment234296>

    "Invalid entity type " ==> "Invalid object type "



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java (line 182)
<https://reviews.apache.org/r/55912/#comment234301>

    Consider moving this to line #184, as the variable is not referenced outside that "if" block.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java (line 185)
<https://reviews.apache.org/r/55912/#comment234302>

    "b" is not used here. Please review and remove.



repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java (line 227)
<https://reviews.apache.org/r/55912/#comment234308>

    structType.getStructDef().getAttributeDefs() will not get attributes of superTypes, right?
    
    This method is called with 'entity' as value from few places - line #135, line #237. Please review if structType.getAllAttributes() should be used here instead?


Please review this test failure as well:

Tests run: 9, Failures: 1, Errors: 0, Skipped: 6, Time elapsed: 11.297 sec <<< FAILURE! - in org.apache.atlas.repository.store.graph.v1.AtlasEntityStoreV1Test
testCreate(org.apache.atlas.repository.store.graph.v1.AtlasEntityStoreV1Test)  Time elapsed: 0.103 sec  <<< FAILURE!
java.lang.NullPointerException: null
	at org.apache.atlas.repository.graph.GraphHelper.vertexString(GraphHelper.java:357)
	at org.apache.atlas.repository.graph.GraphHelper.getOrCreateEdge(GraphHelper.java:203)
	at org.apache.atlas.repository.store.graph.v1.EntityGraphMapper.toGraph(EntityGraphMapper.java:98)
	at org.apache.atlas.repository.store.graph.v1.StructVertexMapper.mapToVertexByTypeCategory(StructVertexMapper.java:161)
	at org.apache.atlas.repository.store.graph.v1.StructVertexMapper.mapAttribute(StructVertexMapper.java:140)
	at org.apache.atlas.repository.store.graph.v1.StructVertexMapper.mapAttributestoVertex(StructVertexMapper.java:115)
	at org.apache.atlas.repository.store.graph.v1.EntityGraphMapper.mapAttributes(EntityGraphMapper.java:144)
	at org.apache.atlas.repository.store.graph.v1.AtlasEntityStoreV1.createOrUpdate(AtlasEntityStoreV1.java:143)
	at org.apache.atlas.repository.store.graph.v1.AtlasEntityStoreV1.createOrUpdate(AtlasEntityStoreV1.java:70)
	at org.apache.atlas.repository.store.graph.v1.AtlasEntityStoreV1Test.testCreate(AtlasEntityStoreV1Test.java:133)

- Madhan Neethiraj


On Jan. 25, 2017, 2:55 a.m., Suma Shivaprasad wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55912/
> -----------------------------------------------------------
> 
> (Updated Jan. 25, 2017, 2:55 a.m.)
> 
> 
> Review request for atlas.
> 
> 
> Bugs: ATLAS-1498
>     https://issues.apache.org/jira/browse/ATLAS-1498
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Fixed issues in entity discovery, collections etc found during testing
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java e4f3dfd 
>   intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java 8aba1fb 
>   intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4712508 
>   intg/src/test/java/org/apache/atlas/TestUtilsV2.java f9040f3 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java b874c5d 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java 18e397b 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java 1947855 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java 425bde9 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java 174e490 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityMutationContext.java f942a91 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/IDBasedEntityResolver.java 488f141 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/MapVertexMapper.java 9d219f5 
>   repository/src/main/java/org/apache/atlas/repository/store/graph/v1/StructVertexMapper.java ae9ecc4 
>   repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java 0ff33ba 
> 
> Diff: https://reviews.apache.org/r/55912/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Suma Shivaprasad
> 
>