You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by GitBox <gi...@apache.org> on 2021/06/14 13:04:41 UTC

[GitHub] [atlas] bellemare commented on a change in pull request #139: ATLAS-4323: Add keys to Kafka notifications

bellemare commented on a change in pull request #139:
URL: https://github.com/apache/atlas/pull/139#discussion_r650927829



##########
File path: webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java
##########
@@ -155,14 +155,16 @@ public void onLabelsAdded(AtlasEntity entity, Set<String> labels) throws AtlasBa
 
     private void notifyEntityEvents(List<AtlasEntity> entities, OperationType operationType) throws AtlasBaseException {
         MetricRecorder metric = RequestContext.get().startMetricRecord("entityNotification");
-        List<EntityNotificationV2> messages = new ArrayList<>();
+        List<KeyValue<String, EntityNotificationV2>> messages = new ArrayList<>();
 
         for (AtlasEntity entity : entities) {
             if (isInternalType(entity.getTypeName())) {
                 continue;
             }
+            messages.add(new KeyValue<>(
+                             entity.getGuid(),

Review comment:
       @mneethiraj Adding GUID as key for entity here.

##########
File path: webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java
##########
@@ -171,21 +173,23 @@ private void notifyEntityEvents(List<AtlasEntity> entities, OperationType operat
 
     private void notifyRelationshipEvents(List<AtlasRelationship> relationships, OperationType operationType) throws AtlasBaseException {
         MetricRecorder metric = RequestContext.get().startMetricRecord("entityNotification");
-        List<EntityNotificationV2> messages = new ArrayList<>();
+        List<KeyValue<String, EntityNotificationV2>> messages = new ArrayList<>();
 
         for (AtlasRelationship relationship : relationships) {
             if (isInternalType(relationship.getTypeName())) {
                 continue;
             }
 
-            messages.add(new EntityNotificationV2(toNotificationHeader(relationship), operationType, RequestContext.get().getRequestTime()));
+            messages.add(new KeyValue<>(
+                    relationship.getGuid(),

Review comment:
       @mneethiraj Adding GUID as key for relationship here.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org