----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/56260/#review164076 -----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java (line 608) <https://reviews.apache.org/r/56260/#comment235632> Since this is applicable only for struct/entity/classification types, consider replacing use of generic AtlasType with AtlasStructType. With this change, the method would be: Consider using the following: AtlasAttribute attribute = structType.getAttribute(attributeName); if (attribute != null) { return attribute.getQualifiedAttributeName(). } } return null; Also update the another variation of this method (above). repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java (line 635) <https://reviews.apache.org/r/56260/#comment235634> Since this is applicable only for struct/entity/classification, consider using AtlasStructType instead of generic AtlasType. repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java (line 1033) <https://reviews.apache.org/r/56260/#comment235645> "actualPropertyName" ==> "vertexPropertyName" repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java (line 1034) <https://reviews.apache.org/r/56260/#comment235644> Consider adding method AtlasAttribute.getEncodedPropertyName() - which can be computed once and avoid the overhead. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphEntityMapper.java (line 124) <https://reviews.apache.org/r/56260/#comment235647> Consider passing the following parameters to this method: mapAttributesToEntity(AtlasVertex vertex, AtlasStructType structType, AtlasStruct instance) This method can be used to read attributes for entity/struct/classification types. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphEntityMapper.java (line 176) <https://reviews.apache.org/r/56260/#comment235646> - there should be only one edge for a given classification from an entity; hence only a single vertex at most - reading the attributes should be same as reading struct/entity attributes. Consider using a single method to read attributes of an instance of struct/entity/classification, given a vertex and AtlasStructType. Please refer to my earlier comment in mapAttributesToEntity() repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphEntityMapper.java (line 199) <https://reviews.apache.org/r/56260/#comment235641> Is "entityType" needed in this method? It is only used to get edge label. I would suggest to add method AtlasAttribute.getEdgeLabel() and use this to get the edge lable everywhere. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphEntityMapper.java (line 203) <https://reviews.apache.org/r/56260/#comment235643> Use attribute.getAttributeType(), instead of typeRegistry.getType(attribute.getTypeName()) repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphEntityMapper.java (line 218) <https://reviews.apache.org/r/56260/#comment235648> - for STRUCT type, the value would be AtlasStruct - for ENTITY type, the value would be AtlasObjectId Please review and update. webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java (line 163) <https://reviews.apache.org/r/56260/#comment235637> "typeName" should be pathParam. Similar to getByUniqueAttribute(). It will be useful to be able specify multiple attribute/values in the param - Madhan Neethiraj On Feb. 3, 2017, 1:36 a.m., Sarath Subramanian wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/56260/ > ----------------------------------------------------------- > > (Updated Feb. 3, 2017, 1:36 a.m.) > > > Review request for atlas, Apoorv Naik, Madhan Neethiraj, Suma Shivaprasad, > and Vimal Sharma. > > > Bugs: ATLAS-1523 > https://issues.apache.org/jira/browse/ATLAS-1523 > > > Repository: atlas > > > Description > ------- > > Current implementation of GET API for entity v2 still routes to V1 entity > APIs and does a V1toV2 conversion. We need to directly query the v2 > entitiesStore to get the required entity. > > > Diffs > ----- > > intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 0fb16c6 > repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java > ce8d4c7 > > repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java > c42f95f > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java > 4c79cef > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/GraphEntityMapper.java > PRE-CREATION > > repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java > 546cd0c > webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java aa209f9 > > Diff: https://reviews.apache.org/r/56260/diff/ > > > Testing > ------- > > Tested using POSTMAN > > > Thanks, > > Sarath Subramanian > >
