Skip to content

Commit

Permalink
mesh-292: changed constants
Browse files Browse the repository at this point in the history
  • Loading branch information
PRATHAM2002-DS committed Dec 11, 2024
1 parent 5126f15 commit 82e3448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public class DataDomainPreProcessor extends AbstractDomainPreProcessor {
private Map<String, String> updatedPolicyResources;
private EntityGraphRetriever retrieverNoRelation = null;
private Map<String, String> updatedDomainQualifiedNames;
public static final String UNIQUE_ATTRIBUTE_SHADE_PROPERTY_PREFIX = "__u_";

public DataDomainPreProcessor(AtlasTypeRegistry typeRegistry, EntityGraphRetriever entityRetriever,
AtlasGraph graph) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 82e3448

Please sign in to comment.