diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java index 6a7e45b648..0ff7934e3c 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java @@ -2416,8 +2416,11 @@ private void addOrRemoveDaapInternalAttr(AtlasVertex toVertex, String internalAt .filter(guid -> !currentElementGuids.contains(guid)) .collect(Collectors.toList()); } - RequestContext.get().setAddedOutputPorts(addedGuids); - RequestContext.get().setRemovedOutputPorts(removedGuids); + + String productGuid = toVertex.getProperty("__guid", String.class); + AtlasEntity diffEntity = RequestContext.get().getDifferentialEntity(productGuid); + diffEntity.setAddedRelationshipAttribute(OUTPUT_PORTS, addedGuids); + diffEntity.setRemovedRelationshipAttribute(OUTPUT_PORTS, removedGuids); } } diff --git a/server-api/src/main/java/org/apache/atlas/RequestContext.java b/server-api/src/main/java/org/apache/atlas/RequestContext.java index 264142fd21..3783bbc789 100644 --- a/server-api/src/main/java/org/apache/atlas/RequestContext.java +++ b/server-api/src/main/java/org/apache/atlas/RequestContext.java @@ -118,8 +118,6 @@ public class RequestContext { private boolean isInvokedByIndexSearch = false; private Map> deletedClassificationAndVertices = new HashMap<>(); private Map> addedClassificationAndVertices = new HashMap<>(); - private final List addedOutputPorts = new ArrayList<>(); - private final List removedOutputPorts = new ArrayList<>(); Map tagsDiff = new HashMap<>(); @@ -186,8 +184,6 @@ public void clearCache() { this.delayTagNotifications = false; deletedClassificationAndVertices.clear(); addedClassificationAndVertices.clear(); - this.addedOutputPorts.clear(); - this.removedOutputPorts.clear(); if (metrics != null && !metrics.isEmpty()) { METRICS.debug(metrics.toString()); @@ -902,21 +898,4 @@ public void addEdgeLabel(String processEdgeLabel) { public boolean isEdgeLabelAlreadyProcessed(String processEdgeLabel) { return edgeLabels.contains(processEdgeLabel); } - - public void setAddedOutputPorts(List addedOutputPorts) { - this.addedOutputPorts.addAll(addedOutputPorts); - } - - public List getAddedOutputPorts() { - return addedOutputPorts; - } - - public void setRemovedOutputPorts(List removedOutputPorts) { - this.removedOutputPorts.addAll(removedOutputPorts); - } - - public List getRemovedOutputPorts() { - return removedOutputPorts; - } - } \ No newline at end of file diff --git a/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java b/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java index 3982ba41c1..f61aad380e 100644 --- a/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java +++ b/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java @@ -153,9 +153,6 @@ private void notifyEntityEvents(List entities, OperationType operat Map differentialEntities = RequestContext.get().getDifferentialEntitiesMap(); Map requestContextHeaders = RequestContext.get().getRequestContextHeaders(); - List addedOutputPorts = RequestContext.get().getAddedOutputPorts(); - List removedOutputPorts = RequestContext.get().getRemovedOutputPorts(); - List messages = new ArrayList<>(); for (AtlasEntity entity : entities) { @@ -166,10 +163,6 @@ private void notifyEntityEvents(List entities, OperationType operat if(differentialEntities != null){ if (differentialEntities.containsKey(entityGuid)) { - if (differentialEntities.get(entityGuid).hasRelationshipAttribute(OUTPUT_PORTS)) { - differentialEntities.get(entityGuid).setAddedRelationshipAttribute(OUTPUT_PORTS, addedOutputPorts); - differentialEntities.get(entityGuid).setRemovedRelationshipAttribute(OUTPUT_PORTS, removedOutputPorts); - } messages.add(new EntityNotificationV2(toNotificationHeader(entity), differentialEntities.get(entityGuid), operationType, RequestContext.get().getRequestTime(), requestContextHeaders)); }else {