From e893e1ef65e3a29a80fad3d713ef12d9a1ceec8c Mon Sep 17 00:00:00 2001 From: PRATHAM2002-DS Date: Wed, 13 Mar 2024 18:37:04 +0530 Subject: [PATCH] edge label changed --- .../java/org/apache/atlas/repository/Constants.java | 4 ++-- .../v2/preprocessor/datamesh/DomainPreProcessor.java | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/org/apache/atlas/repository/Constants.java b/common/src/main/java/org/apache/atlas/repository/Constants.java index 37b6d7416b..42ad0d9e26 100644 --- a/common/src/main/java/org/apache/atlas/repository/Constants.java +++ b/common/src/main/java/org/apache/atlas/repository/Constants.java @@ -139,8 +139,8 @@ public final class Constants { */ public static final String DATA_DOMAIN_ENTITY_TYPE = "DataDomain"; public static final String DATA_PRODUCT_ENTITY_TYPE = "DataProduct"; - public static final String DATA_PRODUCT_EDGE_LABEL = "r:AtlasDataProduct"; - public static final String DOMAIN_PARENT_EDGE_LABEL = "r:AtlasDataDomainHierarchyLink"; + public static final String DATA_PRODUCT_EDGE_LABEL = "__DataDomain.dataProducts"; + public static final String DOMAIN_PARENT_EDGE_LABEL = "__DataDomain.subDomains"; diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DomainPreProcessor.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DomainPreProcessor.java index 3c6fce63ba..def84b56ff 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DomainPreProcessor.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DomainPreProcessor.java @@ -107,7 +107,7 @@ private void processUpdateDomain(AtlasEntity entity, AtlasVertex vertex) throws if (!currentDomainQualifiedName.equals(newDomainQualifiedName)) { //Auth check isAuthorized(currentDomainHeader, parentDomain); - + LOG.info("Edge Labels: {}", entity.getRelationshipAttributes()); processMoveSubDomainToAnotherDomain(entity, vertex, currentDomainQualifiedName, newDomainQualifiedName, vertexQnName, superDomainQualifiedName); } else { @@ -171,8 +171,8 @@ private void moveChildrenToAnotherDomain(AtlasVertex childDomainVertex, updatedAttributes.put(QUALIFIED_NAME, updatedQualifiedName); //change superDomainQN, parentDomainQN - childDomainVertex.setProperty(SUPER_DOMAIN_QN, parentDomainQualifiedName); - childDomainVertex.setProperty(PARENT_DOMAIN_QN, targetDomainQualifiedName); + childDomainVertex.setProperty(SUPER_DOMAIN_QN, targetDomainQualifiedName); + childDomainVertex.setProperty(PARENT_DOMAIN_QN, parentDomainQualifiedName); //update system properties GraphHelper.setModifiedByAsString(childDomainVertex, RequestContext.get().getUser()); @@ -183,7 +183,7 @@ private void moveChildrenToAnotherDomain(AtlasVertex childDomainVertex, while (products.hasNext()) { AtlasVertex productVertex = products.next(); - moveChildDataProductToAnotherDomain(productVertex, sourceDomainQualifiedName, targetDomainQualifiedName); + moveChildDataProductToAnotherDomain(productVertex, parentDomainQualifiedName, sourceDomainQualifiedName, targetDomainQualifiedName); } // Get all children domains of current domain @@ -203,6 +203,7 @@ private void moveChildrenToAnotherDomain(AtlasVertex childDomainVertex, } private void moveChildDataProductToAnotherDomain(AtlasVertex productVertex, + String parentDomainQualifiedName, String sourceDomainQualifiedName, String targetDomainQualifiedName) throws AtlasBaseException { AtlasPerfMetrics.MetricRecorder recorder = RequestContext.get().startMetricRecord("moveChildDataProductToAnotherDomain"); @@ -219,6 +220,7 @@ private void moveChildDataProductToAnotherDomain(AtlasVertex productVertex, updatedAttributes.put(QUALIFIED_NAME, updatedQualifiedName); productVertex.setProperty(PARENT_DOMAIN_QN, targetDomainQualifiedName); + productVertex.setProperty(SUPER_DOMAIN_QN, parentDomainQualifiedName); //update system properties GraphHelper.setModifiedByAsString(productVertex, RequestContext.get().getUser());