Repository: atlas Updated Branches: refs/heads/master fa9899199 -> f11c18016
ATLAS-2591: During updating a relationship edge restrict update to either propagate direction or blocked propagated classifications Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/f11c1801 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/f11c1801 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/f11c1801 Branch: refs/heads/master Commit: f11c180169b0da1015176126eae6977e9f7cc423 Parents: fa98991 Author: Sarath Subramanian <[email protected]> Authored: Fri Apr 20 15:15:58 2018 -0700 Committer: Sarath Subramanian <[email protected]> Committed: Fri Apr 20 15:15:58 2018 -0700 ---------------------------------------------------------------------- .../store/graph/v1/AtlasRelationshipStoreV1.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/f11c1801/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1.java index 4e42ef1..51dcc3a 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1.java @@ -315,10 +315,7 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore { private AtlasRelationship updateRelationship(AtlasEdge relationshipEdge, AtlasRelationship relationship) throws AtlasBaseException { AtlasRelationshipType relationType = typeRegistry.getRelationshipTypeByName(relationship.getTypeName()); - updateTagPropagations(relationshipEdge, relationship.getPropagateTags()); - - // update blocked propagated classifications - handleBlockedClassifications(relationshipEdge, relationship.getBlockedPropagatedClassifications()); + updateTagPropagations(relationshipEdge, relationship); if (MapUtils.isNotEmpty(relationType.getAllAttributes())) { for (AtlasAttribute attr : relationType.getAllAttributes().values()) { @@ -422,9 +419,9 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore { } } - private void updateTagPropagations(AtlasEdge edge, PropagateTags tagPropagation) throws AtlasBaseException { + private void updateTagPropagations(AtlasEdge edge, AtlasRelationship relationship) throws AtlasBaseException { PropagateTags oldTagPropagation = getPropagateTags(edge); - PropagateTags newTagPropagation = tagPropagation; + PropagateTags newTagPropagation = relationship.getPropagateTags(); if (newTagPropagation != oldTagPropagation) { List<AtlasVertex> currentClassificationVertices = getClassificationVertices(edge); @@ -472,6 +469,9 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore { for (AtlasVertex classificationVertex : removePropagationsMap.keySet()) { deleteHandler.removeTagPropagation(classificationVertex, removePropagationsMap.get(classificationVertex)); } + } else { + // update blocked propagated classifications only if there is no change is tag propagation (don't update both) + handleBlockedClassifications(edge, relationship.getBlockedPropagatedClassifications()); } }
