ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pengjianhua <peng.jian...@zte.com.cn>
Subject Review Request 60696: In different places to achieve the same function using repeat codes, new issue is perhaps generated when these functions are modified.
Date Fri, 07 Jul 2017 01:46:25 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60696/
-----------------------------------------------------------

Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O hEigeartaigh, Gautam
Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan Neethiraj, Velmurugan Periasamy, and Qiang
Zhang.


Bugs: RANGER-1678
    https://issues.apache.org/jira/browse/RANGER-1678


Repository: ranger


Description (updated)
-------

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.


Diffs (updated)
-----

  agents-audit/src/main/java/org/apache/ranger/audit/destination/SolrAuditDestination.java
14ad791 
  agents-audit/src/main/java/org/apache/ranger/audit/provider/solr/SolrAuditProvider.java
e0c192c 
  agents-audit/src/main/java/org/apache/ranger/audit/utils/SolrAppUtil.java PRE-CREATION 


Diff: https://reviews.apache.org/r/60696/diff/1/


Testing
-------


Thanks,

pengjianhua


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message