Skip to content

Commit ed5564c

Browse files
Merge pull request #2246 from atlanhq/fix/gov-1255
Fix for refresh propagation propagating tag to source vertex
2 parents 36c9db8 + 9001140 commit ed5564c

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3523,7 +3523,7 @@ public void classificationRefreshPropagation(String classificationId) throws Atl
35233523
LOG.info("{} entity vertices have classification with id {} attached", propagatedVerticesIds.size(), classificationId);
35243524

35253525
List<String> verticesIdsToAddClassification = new ArrayList<>();
3526-
List<String> propagatedVerticesIdWithoutEdge = entityRetriever.getImpactedVerticesIds(sourceEntityVertex , classificationId,
3526+
List<String> propagatedVerticesIdWithoutEdge = entityRetriever.getImpactedVerticesIdsClassificationAttached(sourceEntityVertex , classificationId,
35273527
CLASSIFICATION_PROPAGATION_EXCLUSION_MAP.get(propagationMode), verticesIdsToAddClassification);
35283528

35293529
LOG.info("To add classification with id {} to {} vertices", classificationId, verticesIdsToAddClassification.size());

repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,15 @@ public List<String> getImpactedVerticesIds(AtlasVertex entityVertex, String rela
616616
return ret;
617617
}
618618

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

622-
traverseImpactedVerticesByLevel(entityVertex, null, classificationId, ret, edgeLabelsToExclude, verticesWithoutClassification);
622+
GraphHelper.getClassificationEdges(entityVertex).forEach(classificationEdge -> {
623+
AtlasVertex classificationVertex = classificationEdge.getInVertex();
624+
if (classificationVertex != null && classificationId.equals(classificationVertex.getIdForDisplay())) {
625+
traverseImpactedVerticesByLevel(entityVertex, null, classificationId, ret, edgeLabelsToExclude, verticesWithoutClassification);
626+
}
627+
});
623628

624629
return ret;
625630
}

repository/src/main/java/org/apache/atlas/tasks/AtlasTaskService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public List<AtlasTask> createAtlasTasks(List<AtlasTask> tasks) throws AtlasBaseE
151151
if (isClassificationTaskType(taskType)) {
152152
String classificationName = task.getClassificationName();
153153
String entityGuid = task.getEntityGuid();
154-
String classificationId = resolveAndReturnClassificationId(classificationName, entityGuid);
154+
String classificationId = StringUtils.isEmpty(task.getClassificationId()) ? resolveAndReturnClassificationId(classificationName, entityGuid) : task.getClassificationId();
155155
if (StringUtils.isEmpty(classificationId)) {
156156
throw new AtlasBaseException(AtlasErrorCode.TASK_INVALID_PARAMETERS, task.toString());
157157
}

0 commit comments

Comments
 (0)