Commit f11c1801 by Sarath Subramanian

ATLAS-2591: During updating a relationship edge restrict update to either…

ATLAS-2591: During updating a relationship edge restrict update to either propagate direction or blocked propagated classifications
parent fa989919
...@@ -315,10 +315,7 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore { ...@@ -315,10 +315,7 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore {
private AtlasRelationship updateRelationship(AtlasEdge relationshipEdge, AtlasRelationship relationship) throws AtlasBaseException { private AtlasRelationship updateRelationship(AtlasEdge relationshipEdge, AtlasRelationship relationship) throws AtlasBaseException {
AtlasRelationshipType relationType = typeRegistry.getRelationshipTypeByName(relationship.getTypeName()); AtlasRelationshipType relationType = typeRegistry.getRelationshipTypeByName(relationship.getTypeName());
updateTagPropagations(relationshipEdge, relationship.getPropagateTags()); updateTagPropagations(relationshipEdge, relationship);
// update blocked propagated classifications
handleBlockedClassifications(relationshipEdge, relationship.getBlockedPropagatedClassifications());
if (MapUtils.isNotEmpty(relationType.getAllAttributes())) { if (MapUtils.isNotEmpty(relationType.getAllAttributes())) {
for (AtlasAttribute attr : relationType.getAllAttributes().values()) { for (AtlasAttribute attr : relationType.getAllAttributes().values()) {
...@@ -422,9 +419,9 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore { ...@@ -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 oldTagPropagation = getPropagateTags(edge);
PropagateTags newTagPropagation = tagPropagation; PropagateTags newTagPropagation = relationship.getPropagateTags();
if (newTagPropagation != oldTagPropagation) { if (newTagPropagation != oldTagPropagation) {
List<AtlasVertex> currentClassificationVertices = getClassificationVertices(edge); List<AtlasVertex> currentClassificationVertices = getClassificationVertices(edge);
...@@ -472,6 +469,9 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore { ...@@ -472,6 +469,9 @@ public class AtlasRelationshipStoreV1 implements AtlasRelationshipStore {
for (AtlasVertex classificationVertex : removePropagationsMap.keySet()) { for (AtlasVertex classificationVertex : removePropagationsMap.keySet()) {
deleteHandler.removeTagPropagation(classificationVertex, removePropagationsMap.get(classificationVertex)); 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());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment