Skip to content

Commit

Permalink
Merge pull request #4389 from atlanhq/mesh-363
Browse files Browse the repository at this point in the history
MESH-363 : Additional info for outptuPort update event
  • Loading branch information
PRATHAM2002-DS authored Mar 6, 2025
2 parents 596f664 + 76ce186 commit 148440c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
21 changes: 0 additions & 21 deletions server-api/src/main/java/org/apache/atlas/RequestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ public class RequestContext {
private boolean isInvokedByIndexSearch = false;
private Map<AtlasClassification, Collection<Object>> deletedClassificationAndVertices = new HashMap<>();
private Map<AtlasClassification, Collection<Object>> addedClassificationAndVertices = new HashMap<>();
private final List<String> addedOutputPorts = new ArrayList<>();
private final List<String> removedOutputPorts = new ArrayList<>();

Map<String, Object> tagsDiff = new HashMap<>();

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -902,21 +898,4 @@ public void addEdgeLabel(String processEdgeLabel) {
public boolean isEdgeLabelAlreadyProcessed(String processEdgeLabel) {
return edgeLabels.contains(processEdgeLabel);
}

public void setAddedOutputPorts(List<String> addedOutputPorts) {
this.addedOutputPorts.addAll(addedOutputPorts);
}

public List<String> getAddedOutputPorts() {
return addedOutputPorts;
}

public void setRemovedOutputPorts(List<String> removedOutputPorts) {
this.removedOutputPorts.addAll(removedOutputPorts);
}

public List<String> getRemovedOutputPorts() {
return removedOutputPorts;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ private void notifyEntityEvents(List<AtlasEntity> entities, OperationType operat
Map<String,AtlasEntity> differentialEntities = RequestContext.get().getDifferentialEntitiesMap();
Map<String, String> requestContextHeaders = RequestContext.get().getRequestContextHeaders();

List<String> addedOutputPorts = RequestContext.get().getAddedOutputPorts();
List<String> removedOutputPorts = RequestContext.get().getRemovedOutputPorts();

List<EntityNotificationV2> messages = new ArrayList<>();

for (AtlasEntity entity : entities) {
Expand All @@ -166,10 +163,6 @@ private void notifyEntityEvents(List<AtlasEntity> 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 {
Expand Down

0 comments on commit 148440c

Please sign in to comment.