Skip to content

Commit

Permalink
edge label changed
Browse files Browse the repository at this point in the history
  • Loading branch information
PRATHAM2002-DS committed Mar 13, 2024
1 parent 9e6963d commit e893e1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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());
Expand All @@ -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
Expand All @@ -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");
Expand All @@ -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());
Expand Down

0 comments on commit e893e1e

Please sign in to comment.