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 cdb5db1d10..2d7f61074b 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}")