Skip to content

Commit

Permalink
Merge pull request #2249 from atlanhq/fix/gov-1255
Browse files Browse the repository at this point in the history
[Staging] Fix for refresh propagation propagating tag to source vertex
  • Loading branch information
sumandas0 authored Aug 10, 2023
2 parents 8446626 + 9001140 commit 79794df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3523,7 +3523,7 @@ public void classificationRefreshPropagation(String classificationId) throws Atl
LOG.info("{} entity vertices have classification with id {} attached", propagatedVerticesIds.size(), classificationId);

List<String> verticesIdsToAddClassification = new ArrayList<>();
List<String> propagatedVerticesIdWithoutEdge = entityRetriever.getImpactedVerticesIds(sourceEntityVertex , classificationId,
List<String> propagatedVerticesIdWithoutEdge = entityRetriever.getImpactedVerticesIdsClassificationAttached(sourceEntityVertex , classificationId,
CLASSIFICATION_PROPAGATION_EXCLUSION_MAP.get(propagationMode), verticesIdsToAddClassification);

LOG.info("To add classification with id {} to {} vertices", classificationId, verticesIdsToAddClassification.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,10 +616,15 @@ public List<String> getImpactedVerticesIds(AtlasVertex entityVertex, String rela
return ret;
}

public List<String> getImpactedVerticesIds(AtlasVertex entityVertex, String classificationId, List<String> edgeLabelsToExclude, List<String> verticesWithoutClassification) {
public List<String> getImpactedVerticesIdsClassificationAttached(AtlasVertex entityVertex, String classificationId, List<String> edgeLabelsToExclude, List<String> verticesWithoutClassification) {
List<String> ret = new ArrayList<>();

traverseImpactedVerticesByLevel(entityVertex, null, classificationId, ret, edgeLabelsToExclude, verticesWithoutClassification);
GraphHelper.getClassificationEdges(entityVertex).forEach(classificationEdge -> {
AtlasVertex classificationVertex = classificationEdge.getInVertex();
if (classificationVertex != null && classificationId.equals(classificationVertex.getIdForDisplay())) {
traverseImpactedVerticesByLevel(entityVertex, null, classificationId, ret, edgeLabelsToExclude, verticesWithoutClassification);
}
});

return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public List<AtlasTask> createAtlasTasks(List<AtlasTask> tasks) throws AtlasBaseE
if (isClassificationTaskType(taskType)) {
String classificationName = task.getClassificationName();
String entityGuid = task.getEntityGuid();
String classificationId = resolveAndReturnClassificationId(classificationName, entityGuid);
String classificationId = StringUtils.isEmpty(task.getClassificationId()) ? resolveAndReturnClassificationId(classificationName, entityGuid) : task.getClassificationId();
if (StringUtils.isEmpty(classificationId)) {
throw new AtlasBaseException(AtlasErrorCode.TASK_INVALID_PARAMETERS, task.toString());
}
Expand Down

0 comments on commit 79794df

Please sign in to comment.