From 82e3448c06c8fac05932b42861fb252ecbb64e2c Mon Sep 17 00:00:00 2001 From: PRATHAM2002-DS Date: Wed, 11 Dec 2024 13:12:08 +0530 Subject: [PATCH] mesh-292: changed constants --- .../main/java/org/apache/atlas/repository/Constants.java | 2 ++ .../v2/preprocessor/datamesh/DataDomainPreProcessor.java | 9 ++------- 2 files changed, 4 insertions(+), 7 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 4fc62e0e6e..ff3741878b 100644 --- a/common/src/main/java/org/apache/atlas/repository/Constants.java +++ b/common/src/main/java/org/apache/atlas/repository/Constants.java @@ -39,6 +39,7 @@ import java.util.Set; import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey; +import static org.apache.atlas.type.AtlasStructType.UNIQUE_ATTRIBUTE_SHADE_PROPERTY_PREFIX; /** * Repository Constants. @@ -269,6 +270,7 @@ public final class Constants { public static final String NAME = "name"; public static final String QUALIFIED_NAME = "qualifiedName"; + public static final String UNIQUE_QUALIFIED_NAME = UNIQUE_ATTRIBUTE_SHADE_PROPERTY_PREFIX + QUALIFIED_NAME; public static final String TYPE_NAME_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "typeName"; public static final String INDEX_SEARCH_MAX_RESULT_SET_SIZE = "atlas.graph.index.search.max-result-set-size"; public static final String INDEX_SEARCH_TYPES_MAX_QUERY_STR_LENGTH = "atlas.graph.index.search.types.max-query-str-length"; diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DataDomainPreProcessor.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DataDomainPreProcessor.java index 88b0da188d..5a83f833b7 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DataDomainPreProcessor.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/datamesh/DataDomainPreProcessor.java @@ -53,7 +53,6 @@ public class DataDomainPreProcessor extends AbstractDomainPreProcessor { private Map updatedPolicyResources; private EntityGraphRetriever retrieverNoRelation = null; private Map updatedDomainQualifiedNames; - public static final String UNIQUE_ATTRIBUTE_SHADE_PROPERTY_PREFIX = "__u_"; public DataDomainPreProcessor(AtlasTypeRegistry typeRegistry, EntityGraphRetriever entityRetriever, AtlasGraph graph) { @@ -291,14 +290,12 @@ private void moveChildrenToAnotherDomain(AtlasVertex childDomainVertex, String currentDomainQualifiedName = childDomainVertex.getProperty(QUALIFIED_NAME, String.class); String updatedDomainQualifiedName = parentDomainQualifiedName + getOwnQualifiedNameForChild(currentDomainQualifiedName); - String uniqueQualifiedNameAttribute = UNIQUE_ATTRIBUTE_SHADE_PROPERTY_PREFIX + QUALIFIED_NAME; - // Change domain qualifiedName childDomainVertex.setProperty(QUALIFIED_NAME, updatedDomainQualifiedName); updatedAttributes.put(QUALIFIED_NAME, updatedDomainQualifiedName); // Change unique qualifiedName attribute - childDomainVertex.setProperty(uniqueQualifiedNameAttribute, updatedDomainQualifiedName); + childDomainVertex.setProperty(UNIQUE_QUALIFIED_NAME, updatedDomainQualifiedName); //change superDomainQN, parentDomainQN childDomainVertex.setProperty(SUPER_DOMAIN_QN_ATTR, superDomainQualifiedName); @@ -353,10 +350,8 @@ private void moveChildDataProductToAnotherDomain(AtlasVertex productVertex, String currentQualifiedName = productVertex.getProperty(QUALIFIED_NAME, String.class); String updatedQualifiedName = parentDomainQualifiedName + getOwnQualifiedNameForChild(currentQualifiedName); - String uniqueQualifiedNameAttribute = UNIQUE_ATTRIBUTE_SHADE_PROPERTY_PREFIX + QUALIFIED_NAME; - productVertex.setProperty(QUALIFIED_NAME, updatedQualifiedName); - productVertex.setProperty(uniqueQualifiedNameAttribute, updatedQualifiedName); + productVertex.setProperty(UNIQUE_QUALIFIED_NAME, updatedQualifiedName); updatedAttributes.put(QUALIFIED_NAME, updatedQualifiedName); productVertex.setProperty(PARENT_DOMAIN_QN_ATTR, parentDomainQualifiedName);