----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63879/#review192983 -----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java Lines 194 (patched) <https://reviews.apache.org/r/63879/#comment271415> Minor point. Do you want to trace the label as well. repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java Line 202 (original), 209 (patched) <https://reviews.apache.org/r/63879/#comment271417> if yhe label does not match - presumably an edge will be returned that does not match with the incoming parmeters. Is this an issue? repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java Line 204 (original), 211 (patched) <https://reviews.apache.org/r/63879/#comment271416> what happens for delete edges. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java Lines 364 (patched) <https://reviews.apache.org/r/63879/#comment271419> I do not understand this comment or the following code line. What does "attribute is a relationship " mean? We are looping through the possible relationship attributes as defined in the entityType and we find that the entity does not have this relationship attribute. Why does entity.getAttribute(attrName); give us a value when entity.hasRelationshipAttribute(attrName) does not? repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java Lines 370 (patched) <https://reviews.apache.org/r/63879/#comment271418> can we move this line and the line below outside the if else- as they are repeated in each section. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Line 805 (original), 856 (patched) <https://reviews.apache.org/r/63879/#comment271420> I suggest putting this comment content in the Java doc for the method. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 941 (patched) <https://reviews.apache.org/r/63879/#comment271421> what does Classification mean here? repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 964 (patched) <https://reviews.apache.org/r/63879/#comment271426> I do not see these cases being handled by the code below; the comment implies that the code needs to handle each of these cases separately. We just check not empty and the index. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 965 (patched) <https://reviews.apache.org/r/63879/#comment271423> or empty repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 1012 (patched) <https://reviews.apache.org/r/63879/#comment271428> I wonder whether before we start processing anything - we should check validate that the array of new objectids are non-null, as of objectid type and point to valid entities. We could then reject the request upfront before doing any processing. As it stands it looks like the code could do some graph updates and then find that there is a null or invalid array element - leaving the graph partially updated. I would hope that this validation should be done almost immediately when the rest call comes in. So we only get well formed content at this layer that we do not need to check for nulls, invalid types or invalid guids. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 1028 (patched) <https://reviews.apache.org/r/63879/#comment271424> I sugegst putting out the tostring of the element we cannot process repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 1033 (patched) <https://reviews.apache.org/r/63879/#comment271429> could we check the relationship guid? If this was specified in the new elements we should match it. Or can this not be specified? repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 1037 (patched) <https://reviews.apache.org/r/63879/#comment271431> I think I missed how we ensure thatthe edges we chaeck are for our label. repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java Lines 1146 (patched) <https://reviews.apache.org/r/63879/#comment271432> I do not understand what this if doing. it looks like the delete handler has done a soft delete- why would a soft deleted edgebe added to newElementsCreated? - David Radley On Nov. 20, 2017, 5:15 p.m., Graham Wallis wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/63879/ > ----------------------------------------------------------- > > (Updated Nov. 20, 2017, 5:15 p.m.) > > > Review request for atlas. > > > Repository: atlas > > > Description > ------- > > ATLAS-2262.patch > This patch contains fixes for the EntityGraphMapper and related classes, to > fix intermittent relationship failures. > This change means that an UPDATE operation will inspect the existing and new > relationships and compare them fully before adding/modifying edges. Matching > elements will be reused, new elements will be added, and redundant elements > will be discarded. The behaviour should be consistent regardless of which > graph provider is being used. > > > Diffs > ----- > > repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java > 3e602431400677cbe0d8fe440732b02bb4a30a62 > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java > 739d610263a1b5bb8a0a9ff8183196ebe2c6294b > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java > b0f9845d6e92a6ef4bb53cccec537a0a54afb5e8 > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AttributeMutationContext.java > b6d82dd834b8cc8b3bac630c084b91ac34dd0cec > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java > f6a15b695e676bc035ce8336bcce7bacf1852ff9 > > repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java > b24774d6376765f054022b9220b61769505e488c > > repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java > fd1b6db0c4dd57cd70ba56f49b9c4751f6915858 > > repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1Test.java > d207a6958ab9dce0bd9f8e08c8e49232ab7d2e8a > > > Diff: https://reviews.apache.org/r/63879/diff/3/ > > > Testing > ------- > > Build with full tests with janus grap provider > > > Thanks, > > Graham Wallis > >
