From 861d095acdf9d5d3879f8b57c7473506faa15091 Mon Sep 17 00:00:00 2001 From: arpit-at Date: Fri, 12 Jul 2024 15:07:26 +0530 Subject: [PATCH] DG-1697: Adding endpoint for linking/unlink policy --- .../repository/store/graph/v2/AtlasEntityStoreV2.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java index e818b82f32..0379418011 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java @@ -104,6 +104,7 @@ import javax.inject.Inject; import java.io.InputStream; import java.util.*; +import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; import static java.lang.Boolean.FALSE; @@ -2748,7 +2749,15 @@ public void linkBusinessPolicy(String guid, List linkGuids) throws Atlas aeh = entityRetriever.toAtlasEntityHeader(v); entityMutationResponse.addEntity(UPDATE, aeh); } - entityChangeNotifier.onEntitiesMutated(entityMutationResponse, false); + // Send notifications for the entity changes asynchronously + CompletableFuture.runAsync(() -> { + try { + entityChangeNotifier.onEntitiesMutated(entityMutationResponse, false); + } catch (AtlasBaseException e) { + // Handle exception + LOG.error("Error in processing notification for policy link updates for asset ids {} ", linkGuids, e); + } + }); RequestContext.get().endMetricRecord(metric); }