RakeshGuptaDev commented on code in PR #1251:
URL: https://github.com/apache/ranger/pull/1251#discussion_r4092047328


##########
security-admin/src/main/java/org/apache/ranger/rest/AuditMetricsREST.java:
##########
@@ -104,7 +116,11 @@ public RangerAuditMetrics getAuditMetrics(@PathParam("id") 
Long id, @QueryParam(
         LOG.debug("==> AuditMetricsREST.getAuditMetrics(id={})", id);
         RangerAuditMetrics ret;
         try {
-            ret = solrAccessAuditsService.getAuditMetrics(id, timezone);
+            if 
(RangerBizUtil.AUDIT_STORE_OPENSEARCH.equalsIgnoreCase(rangerBizUtil.getAuditDBType()))
 {

Review Comment:
   Thanks for the suggestion.
   
   I've introduced:
   
   - AccessAuditsMetricsService interface
   - AccessAuditsMetricsServiceFactory to resolve the implementation based on 
audit store type
   - SolrAccessAuditsService and OpenSearchAccessAuditsService implementing the 
interface
   - AuditMetricsREST now delegates through the factory
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to