You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "peng.jianhua (JIRA)" <ji...@apache.org> on 2017/07/06 09:49:00 UTC

[jira] [Created] (RANGER-1678) In different places to achieve the same function, once the function is modified, it is easy to miss one of them, thus importing a new issue. We should extract the common method for writing ranger audit logs to solr.

peng.jianhua created RANGER-1678:
------------------------------------

             Summary: In different places to achieve the same function, once the function is modified, it is easy to miss one of them, thus importing a new issue. We should extract the common method for writing ranger audit logs to solr.
                 Key: RANGER-1678
                 URL: https://issues.apache.org/jira/browse/RANGER-1678
             Project: Ranger
          Issue Type: Bug
          Components: plugins
            Reporter: peng.jianhua
            Assignee: peng.jianhua
             Fix For: master


In agents-audit module, there are following two places of writing audit logs to solr: 
1. org.apache.ranger.audit.provider.solr.SolrAuditProvider.
2. org.apache.ranger.audit.destination.SolrAuditDestination.
Above classes use the same method( "MiscUtil.executePrivilegedAction") to send the audit logs to solr. Codes is as following
final UpdateResponse response = MiscUtil.executePrivilegedAction(new PrivilegedExceptionAction<UpdateResponse>() {
            @Override
            public UpdateResponse run() throws Exception {
                return solrClient.add(docs);
            }
 }); 

We should extract the common method to let our codes more cleaner and reduce the possibility of new issue.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)