Repository: ranger Updated Branches: refs/heads/master 513788f50 -> e1912c8dc
RANGER-2099: updated TagSync for recent Atlas changes in notification details - ATLAS-2656 Project: http://git-wip-us.apache.org/repos/asf/ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/e1912c8d Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/e1912c8d Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/e1912c8d Branch: refs/heads/master Commit: e1912c8dcf1866d552db8e9fcd858f43cb489541 Parents: 513788f Author: Madhan Neethiraj <[email protected]> Authored: Tue May 8 20:29:18 2018 -0700 Committer: Madhan Neethiraj <[email protected]> Committed: Wed May 9 18:30:46 2018 -0700 ---------------------------------------------------------------------- .../tagsync/source/atlas/EntityNotificationWrapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ranger/blob/e1912c8d/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/EntityNotificationWrapper.java ---------------------------------------------------------------------- diff --git a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/EntityNotificationWrapper.java b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/EntityNotificationWrapper.java index f08c331..adaa2f9 100644 --- a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/EntityNotificationWrapper.java +++ b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/EntityNotificationWrapper.java @@ -22,12 +22,13 @@ package org.apache.ranger.tagsync.source.atlas; import org.apache.atlas.model.TimeBoundary; import org.apache.atlas.model.instance.AtlasClassification; import org.apache.atlas.model.instance.AtlasEntity; +import org.apache.atlas.model.instance.AtlasEntityHeader; import org.apache.atlas.model.notification.EntityNotification; +import org.apache.atlas.model.notification.EntityNotification.EntityNotificationV2; import org.apache.atlas.v1.model.instance.Id; import org.apache.atlas.v1.model.instance.Referenceable; import org.apache.atlas.v1.model.instance.Struct; import org.apache.atlas.v1.model.notification.EntityNotificationV1; -import org.apache.atlas.v1.model.notification.EntityNotificationV2; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -82,7 +83,7 @@ public class EntityNotificationWrapper { switch (notificationType) { case ENTITY_NOTIFICATION_V2: { EntityNotificationV2 v2Notification = (EntityNotificationV2) notification; - AtlasEntity atlasEntity = v2Notification.getEntity(); + AtlasEntityHeader atlasEntity = v2Notification.getEntity(); String guid = atlasEntity.getGuid(); String typeName = atlasEntity.getTypeName(); @@ -92,9 +93,9 @@ public class EntityNotificationWrapper { isEntityTypeHandled = isEntityActive && AtlasResourceMapperUtil.isEntityTypeHandled(entityTypeName); isEntityDeleteOp = EntityNotificationV2.OperationType.ENTITY_DELETE == v2Notification.getOperationType(); isEntityCreateOp = EntityNotificationV2.OperationType.ENTITY_CREATE == v2Notification.getOperationType(); - isEmptyClassifications = CollectionUtils.isNotEmpty(v2Notification.getClassifications()); + isEmptyClassifications = CollectionUtils.isNotEmpty(atlasEntity.getClassifications()); - List<AtlasClassification> allClassifications = v2Notification.getClassifications(); + List<AtlasClassification> allClassifications = atlasEntity.getClassifications(); if (CollectionUtils.isNotEmpty(allClassifications)) { classifications = new ArrayList<>();
