|
37 | 37 | import org.apache.atlas.model.notification.AtlasDistributedTaskNotification;
|
38 | 38 | import org.apache.atlas.model.tasks.AtlasTask;
|
39 | 39 | import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
|
40 |
| -import org.apache.atlas.notification.AtlasTaskNotificationSender; |
| 40 | +import org.apache.atlas.notification.task.AtlasDistributedTaskNotificationSender; |
41 | 41 | import org.apache.atlas.repository.Constants;
|
42 | 42 | import org.apache.atlas.repository.RepositoryException;
|
43 | 43 | import org.apache.atlas.repository.graph.GraphHelper;
|
@@ -143,13 +143,13 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore {
|
143 | 143 |
|
144 | 144 | private final ESAliasStore esAliasStore;
|
145 | 145 | private final IAtlasMinimalChangeNotifier atlasAlternateChangeNotifier;
|
146 |
| - private final AtlasTaskNotificationSender taskNotificationSender; |
| 146 | + private final AtlasDistributedTaskNotificationSender taskNotificationSender; |
147 | 147 |
|
148 | 148 | @Inject
|
149 | 149 | public AtlasEntityStoreV2(AtlasGraph graph, DeleteHandlerDelegate deleteDelegate, RestoreHandlerV1 restoreHandlerV1, AtlasTypeRegistry typeRegistry,
|
150 | 150 | IAtlasEntityChangeNotifier entityChangeNotifier, EntityGraphMapper entityGraphMapper, TaskManagement taskManagement,
|
151 | 151 | AtlasRelationshipStore atlasRelationshipStore, FeatureFlagStore featureFlagStore,
|
152 |
| - IAtlasMinimalChangeNotifier atlasAlternateChangeNotifier, AtlasTaskNotificationSender taskNotificationSender) { |
| 152 | + IAtlasMinimalChangeNotifier atlasAlternateChangeNotifier, AtlasDistributedTaskNotificationSender taskNotificationSender) { |
153 | 153 |
|
154 | 154 | this.graph = graph;
|
155 | 155 | this.deleteDelegate = deleteDelegate;
|
@@ -591,10 +591,6 @@ public EntityMutationResponse deleteById(final String guid) throws AtlasBaseExce
|
591 | 591 |
|
592 | 592 | AtlasAuthorizationUtils.verifyDeleteEntityAccess(typeRegistry, entityHeader, "delete entity: guid=" + guid);
|
593 | 593 |
|
594 |
| - if (AtlasConfiguration.NOTIFICATION_ATLAS_DISTRIBUTED_TASKS_TOPIC_NAME.getBoolean()) { |
595 |
| - checkAndCreateProcessRelationshipsCleanupTaskNotification(typeRegistry.getEntityTypeByName(entityHeader.getTypeName()), vertex); |
596 |
| - } |
597 |
| - |
598 | 594 | deletionCandidates.add(vertex);
|
599 | 595 | } else {
|
600 | 596 | if (LOG.isDebugEnabled()) {
|
@@ -641,10 +637,6 @@ public EntityMutationResponse deleteByIds(final List<String> guids) throws Atlas
|
641 | 637 |
|
642 | 638 | AtlasAuthorizationUtils.verifyDeleteEntityAccess(typeRegistry, entityHeader, "delete entity: guid=" + guid);
|
643 | 639 |
|
644 |
| - if (AtlasConfiguration.NOTIFICATION_ATLAS_DISTRIBUTED_TASKS_TOPIC_NAME.getBoolean()) { |
645 |
| - checkAndCreateProcessRelationshipsCleanupTaskNotification(typeRegistry.getEntityTypeByName(entityHeader.getTypeName()), vertex); |
646 |
| - } |
647 |
| - |
648 | 640 | deletionCandidates.add(vertex);
|
649 | 641 | }
|
650 | 642 |
|
@@ -755,10 +747,6 @@ public EntityMutationResponse deleteByUniqueAttributes(AtlasEntityType entityTyp
|
755 | 747 | AtlasAuthorizationUtils.verifyDeleteEntityAccess(typeRegistry, entityHeader,
|
756 | 748 | "delete entity: typeName=" + entityType.getTypeName() + ", uniqueAttributes=" + uniqAttributes);
|
757 | 749 |
|
758 |
| - if (AtlasConfiguration.NOTIFICATION_ATLAS_DISTRIBUTED_TASKS_TOPIC_NAME.getBoolean()) { |
759 |
| - checkAndCreateProcessRelationshipsCleanupTaskNotification(typeRegistry.getEntityTypeByName(entityHeader.getTypeName()), vertex); |
760 |
| - } |
761 |
| - |
762 | 750 | deletionCandidates.add(vertex);
|
763 | 751 | } else {
|
764 | 752 | if (LOG.isDebugEnabled()) {
|
@@ -1744,7 +1732,6 @@ private EntityMutationContext preCreateOrUpdate(EntityStream entityStream, Entit
|
1744 | 1732 |
|
1745 | 1733 | if (entity != null) { // entity would be null if guid is not in the stream but referenced by an entity in the stream
|
1746 | 1734 | AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entity.getTypeName());
|
1747 |
| - // If typeName is Process or ColumnProcess we send task notification |
1748 | 1735 |
|
1749 | 1736 | if (entityType == null) {
|
1750 | 1737 | throw new AtlasBaseException(element.getValue(), AtlasErrorCode.TYPE_NAME_INVALID, TypeCategory.ENTITY.name(), entity.getTypeName());
|
@@ -2125,6 +2112,10 @@ private EntityMutationResponse deleteVertices(Collection<AtlasVertex> deletionCa
|
2125 | 2112 |
|
2126 | 2113 | String typeName = getTypeName(vertex);
|
2127 | 2114 |
|
| 2115 | + if(ATLAS_DISTRIBUTED_TASK_ENABLED.getBoolean()) { |
| 2116 | + checkAndCreateProcessRelationshipsCleanupTaskNotification(typeRegistry.getEntityTypeByName(typeName), vertex); |
| 2117 | + } |
| 2118 | + |
2128 | 2119 | List<PreProcessor> preProcessors = getPreProcessor(typeName);
|
2129 | 2120 | for(PreProcessor processor : preProcessors){
|
2130 | 2121 | processor.processDelete(vertex);
|
|
0 commit comments