Skip to content

Commit

Permalink
Merge pull request #2913 from atlanhq/PLT-1036-fix
Browse files Browse the repository at this point in the history
Typo Fix in the key restrictPropagationThroughHierarchy
  • Loading branch information
nikhilbonte21 authored Apr 3, 2024
2 parents 9bf6522 + a989040 commit ef84908
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ public AtlasClassification(AtlasClassification other) {
setDisplayName(other.getDisplayName());
setRemovePropagationsOnEntityDelete(other.getRemovePropagationsOnEntityDelete());
setRestrictPropagationThroughLineage(other.getRestrictPropagationThroughLineage());
setRestrictPropagationThroughHierarchy(other.getRestrictPropagationThroughHierachy());
setRestrictPropagationThroughHierarchy(other.getRestrictPropagationThroughHierarchy());
}
}

public void setRestrictPropagationThroughHierarchy(Boolean restrictPropagationThroughHierachy) {
this.restrictPropagationThroughHierarchy = restrictPropagationThroughHierachy;
public void setRestrictPropagationThroughHierarchy(Boolean restrictPropagationThroughHierarchy) {
this.restrictPropagationThroughHierarchy = restrictPropagationThroughHierarchy;
}

public Boolean getRestrictPropagationThroughHierachy() {
public Boolean getRestrictPropagationThroughHierarchy() {
return this.restrictPropagationThroughHierarchy;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2997,7 +2997,7 @@ public void addClassifications(final EntityMutationContext context, String guid,
Boolean propagateTags = classification.isPropagate();
Boolean removePropagations = classification.getRemovePropagationsOnEntityDelete();
Boolean restrictPropagationThroughLineage = classification.getRestrictPropagationThroughLineage();
Boolean restrictPropagationThroughHierarchy = classification.getRestrictPropagationThroughHierachy();
Boolean restrictPropagationThroughHierarchy = classification.getRestrictPropagationThroughHierarchy();

if (propagateTags != null && propagateTags &&
classification.getEntityGuid() != null &&
Expand Down Expand Up @@ -3075,7 +3075,7 @@ public void addClassifications(final EntityMutationContext context, String guid,
// compute propagatedEntityVertices only once
if (entitiesToPropagateTo == null) {
String propagationMode;
propagationMode = entityRetriever.determinePropagationMode(classification.getRestrictPropagationThroughLineage(),classification.getRestrictPropagationThroughHierachy());
propagationMode = entityRetriever.determinePropagationMode(classification.getRestrictPropagationThroughLineage(),classification.getRestrictPropagationThroughHierarchy());
Boolean toExclude = propagationMode == CLASSIFICATION_PROPAGATION_MODE_RESTRICT_LINEAGE ? true : false;
entitiesToPropagateTo = entityRetriever.getImpactedVerticesV2(entityVertex, CLASSIFICATION_PROPAGATION_MODE_LABELS_MAP.get(propagationMode),toExclude);
}
Expand Down Expand Up @@ -3578,8 +3578,8 @@ public void updateClassifications(EntityMutationContext context, String guid, Li
Boolean updatedTagPropagation = classification.isPropagate();
Boolean currentRestrictPropagationThroughLineage = currentClassification.getRestrictPropagationThroughLineage();
Boolean updatedRestrictPropagationThroughLineage = classification.getRestrictPropagationThroughLineage();
Boolean currentRestrictPropagationThroughHierarchy = currentClassification.getRestrictPropagationThroughHierachy();
Boolean updatedRestrictPropagationThroughHierarchy = classification.getRestrictPropagationThroughHierachy();
Boolean currentRestrictPropagationThroughHierarchy = currentClassification.getRestrictPropagationThroughHierarchy();
Boolean updatedRestrictPropagationThroughHierarchy = classification.getRestrictPropagationThroughHierarchy();

if ((!Objects.equals(updatedRemovePropagations, currentRemovePropagations) ||
!Objects.equals(currentTagPropagation, updatedTagPropagation) ||
Expand Down Expand Up @@ -3705,8 +3705,8 @@ private AtlasEdge mapClassification(EntityOperation operation, final EntityMuta
AtlasGraphUtilsV2.setEncodedProperty(traitInstanceVertex, CLASSIFICATION_VERTEX_RESTRICT_PROPAGATE_THROUGH_LINEAGE, classification.getRestrictPropagationThroughLineage());
}

if(classification.getRestrictPropagationThroughHierachy() != null){
AtlasGraphUtilsV2.setEncodedProperty(traitInstanceVertex, CLASSIFICATION_VERTEX_RESTRICT_PROPAGATE_THROUGH_HIERARCHY, classification.getRestrictPropagationThroughHierachy());
if(classification.getRestrictPropagationThroughHierarchy() != null){
AtlasGraphUtilsV2.setEncodedProperty(traitInstanceVertex, CLASSIFICATION_VERTEX_RESTRICT_PROPAGATE_THROUGH_HIERARCHY, classification.getRestrictPropagationThroughHierarchy());
}

// map all the attributes to this newly created AtlasVertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,15 @@ public Map<AtlasVertex, List<AtlasVertex>> getClassificationPropagatedEntitiesMa
public void verifyClassificationsPropagationMode(List<AtlasClassification> incomingClassifications) throws AtlasBaseException {
for(AtlasClassification incomingClassification : incomingClassifications){
if(Boolean.TRUE.equals(incomingClassification.isPropagate()))
determinePropagationMode(incomingClassification.getRestrictPropagationThroughLineage(),incomingClassification.getRestrictPropagationThroughHierachy());
determinePropagationMode(incomingClassification.getRestrictPropagationThroughLineage(),incomingClassification.getRestrictPropagationThroughHierarchy());
}
}

public String determinePropagationMode(Boolean currentRestrictPropagationThroughLineage, Boolean currentRestrictPropagationThroughHierarchy) throws AtlasBaseException {
String propagationMode;

if (Boolean.TRUE.equals(currentRestrictPropagationThroughLineage) && Boolean.TRUE.equals(currentRestrictPropagationThroughHierarchy)) {
throw new AtlasBaseException("Both currentRestrictPropagationThroughLineage and currentRestrictPropagationThroughHierarchy cannot be true simultaneously.");
throw new AtlasBaseException("Both restrictPropagationThroughLineage and restrictPropagationThroughHierarchy cannot be true simultaneously.");
} else if (Boolean.TRUE.equals(currentRestrictPropagationThroughLineage)) {
propagationMode = CLASSIFICATION_PROPAGATION_MODE_RESTRICT_LINEAGE;
} else if (Boolean.TRUE.equals(currentRestrictPropagationThroughHierarchy)) {
Expand Down

0 comments on commit ef84908

Please sign in to comment.