From 8083237ce67c168206063efb84008b949e9ec34a Mon Sep 17 00:00:00 2001 From: Nikhil P Bonte Date: Mon, 9 Sep 2024 17:56:58 +0530 Subject: [PATCH] Initial commit --- .../org/apache/atlas/web/rest/EntityREST.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java index c5c95bb98f..cfdf49acb4 100644 --- a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java +++ b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java @@ -1871,6 +1871,29 @@ public void repairEntityIndex(@PathParam("guid") String guid) throws AtlasBaseEx } } + @POST + @Path("/guid/bulk/repairindex") + public void repairEntityIndexBulk(Set guids) throws AtlasBaseException { + + AtlasAuthorizationUtils.verifyAccess(new AtlasAdminAccessRequest(AtlasPrivilege.ADMIN_REPAIR_INDEX), "Admin Repair Index"); + + AtlasPerfTracer perf = null; + + try { + if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) { + perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.repairEntityIndexBulk(" + guids.size() + ")"); + } + RepairIndex repairIndex = new RepairIndex(); + repairIndex.setupGraph(); + + repairIndex.restoreByIds(guids); + } catch (Exception e) { + LOG.error("Exception while repairEntityIndexBulk ", e); + throw new AtlasBaseException(e); + } finally { + AtlasPerfTracer.log(perf); + } + } @POST @Path("/repairindex/{typename}")