rkundam commented on code in PR #518:
URL: https://github.com/apache/atlas/pull/518#discussion_r2800730996
##########
notification/src/main/java/org/apache/atlas/hook/AtlasHook.java:
##########
@@ -278,12 +355,34 @@ private static void
preprocessEntities(List<HookNotification> hookNotifications)
entities.removeIf((AtlasEntity entity) ->
isMatch(entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME).toString(),
entitiesToIgnore));
+ for (AtlasEntity entity : entities) {
+ Object inputs = entity.getAttribute(ATTRIBUTE_INPUTS);
+ Object outputs = entity.getAttribute(ATTRIBUTE_OUTPUTS);
+
+ filterProcessRelatedEntities(inputs);
+ filterProcessRelatedEntities(outputs);
+
+
filterProcessRelatedEntities(entity.getRelationshipAttributes());
+ }
+
Map<String, AtlasEntity> referredEntitiesMap =
entitiesWithExtInfo.getReferredEntities();
referredEntitiesMap = ((referredEntitiesMap != null) ?
referredEntitiesMap : Collections.emptyMap());
referredEntitiesMap.entrySet().removeIf((Map.Entry<String,
AtlasEntity> entry) ->
isMatch(entry.getValue().getAttribute(ATTRIBUTE_QUALIFIED_NAME).toString(),
entitiesToIgnore));
+ for (Map.Entry<String, AtlasEntity> entry :
referredEntitiesMap.entrySet()) {
+ AtlasEntity entity = entry.getValue();
+
+ Object inputs = entity.getAttribute(ATTRIBUTE_INPUTS);
Review Comment:
The block inside the for loop is redundant with lines 359–367 and can be
simplified to avoid duplication.
##########
notification/src/main/java/org/apache/atlas/hook/AtlasHook.java:
##########
@@ -278,12 +355,34 @@ private static void
preprocessEntities(List<HookNotification> hookNotifications)
entities.removeIf((AtlasEntity entity) ->
isMatch(entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME).toString(),
entitiesToIgnore));
+ for (AtlasEntity entity : entities) {
+ Object inputs = entity.getAttribute(ATTRIBUTE_INPUTS);
+ Object outputs = entity.getAttribute(ATTRIBUTE_OUTPUTS);
+
+ filterProcessRelatedEntities(inputs);
+ filterProcessRelatedEntities(outputs);
+
+
filterProcessRelatedEntities(entity.getRelationshipAttributes());
Review Comment:
Since this is operating on entity.getRelationshipAttributes(), shouldn’t we
call filterRelationshipAttributes() rather than filterProcessRelatedEntities()?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]