From 63500aebc244f07178ab8c299538d29e586a0800 Mon Sep 17 00:00:00 2001 From: Nikhil P Bonte Date: Fri, 20 Oct 2023 15:00:19 +0530 Subject: [PATCH 1/3] DG-128 repair __hasLineage info log --- .../atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 1 + 1 file changed, 1 insertion(+) 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 6c4734082a..165458de9b 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 @@ -2494,6 +2494,7 @@ private void repairHasLineageForAsset(AtlasHasLineageRequest request) { if (!foundActiveRel) { AtlasGraphUtilsV2.setEncodedProperty(assetVertex, HAS_LINEAGE, false); + LOG.info("repairHasLineage: repairHasLineageForAsset: Repaired {}", request.getAssetGuid()); } } } From a7710b4313a391dc6bc45562b3b8dcaa8ca4820c Mon Sep 17 00:00:00 2001 From: Nikhil P Bonte Date: Mon, 23 Oct 2023 13:11:37 +0530 Subject: [PATCH 2/3] Logging --- .../atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 4 ++++ 1 file changed, 4 insertions(+) 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 165458de9b..06160c50dd 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 @@ -2478,10 +2478,14 @@ public void repairHasLineage(AtlasHasLineageRequests requests) throws AtlasBaseE private void repairHasLineageForAsset(AtlasHasLineageRequest request) { //only supports repairing scenario mentioned here - https://atlanhq.atlassian.net/browse/DG-128?focusedCommentId=20652 + AtlasPerfMetrics.MetricRecorder metricRecorder = RequestContext.get().startMetricRecord("repairHasLineageForAssetGetById"); AtlasVertex assetVertex = AtlasGraphUtilsV2.findByGuid(this.graph, request.getAssetGuid()); + RequestContext.get().endMetricRecord(metricRecorder); if (getEntityHasLineage(assetVertex)) { + metricRecorder = RequestContext.get().startMetricRecord("repairHasLineageForAssetGetRelations"); Iterator lineageEdges = assetVertex.getEdges(AtlasEdgeDirection.BOTH, PROCESS_EDGE_LABELS).iterator(); + RequestContext.get().endMetricRecord(metricRecorder); boolean foundActiveRel = false; while (lineageEdges.hasNext()) { From e31dc259c73904cd0ee6d5c6903ae1201881373a Mon Sep 17 00:00:00 2001 From: Nikhil P Bonte Date: Wed, 25 Oct 2023 17:26:46 +0530 Subject: [PATCH 3/3] DG-128 Logging --- .../atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 2 ++ 1 file changed, 2 insertions(+) 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 06160c50dd..124ad92218 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 @@ -2497,8 +2497,10 @@ private void repairHasLineageForAsset(AtlasHasLineageRequest request) { } if (!foundActiveRel) { + metricRecorder = RequestContext.get().startMetricRecord("repairHasLineageForRequiredAsset"); AtlasGraphUtilsV2.setEncodedProperty(assetVertex, HAS_LINEAGE, false); LOG.info("repairHasLineage: repairHasLineageForAsset: Repaired {}", request.getAssetGuid()); + RequestContext.get().endMetricRecord(metricRecorder); } } }