You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by pengjianhua <pe...@zte.com.cn> on 2017/07/07 01:46:25 UTC

Review Request 60696: In different places to achieve the same function using repeat codes, new issue is perhaps generated when these functions are modified.

-----------------------------------------------------------
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


Re: Review Request 60696: In different places to achieve the same function using repeat codes, new issue is perhaps generated when these functions are modified.

Posted by Qiang Zhang <zh...@zte.com.cn>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60696/#review180263
-----------------------------------------------------------


Ship it!




Ship It!

- Qiang Zhang


On 七月 11, 2017, 2:41 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60696/
> -----------------------------------------------------------
> 
> (Updated 七月 11, 2017, 2:41 a.m.)
> 
> 
> 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
> -------
> 
> 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
> -----
> 
>   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/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> pengjianhua
> 
>


Re: Review Request 60696: In different places to achieve the same function using repeat codes, new issue is perhaps generated when these functions are modified.

Posted by Colm O hEigeartaigh <co...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60696/#review180189
-----------------------------------------------------------


Ship it!




Ship It!

- Colm O hEigeartaigh


On July 11, 2017, 2:41 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60696/
> -----------------------------------------------------------
> 
> (Updated July 11, 2017, 2:41 a.m.)
> 
> 
> 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
> -------
> 
> 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
> -----
> 
>   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/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> pengjianhua
> 
>


Re: Review Request 60696: In different places to achieve the same function using repeat codes, new issue is perhaps generated when these functions are modified.

Posted by pengjianhua <pe...@zte.com.cn>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60696/
-----------------------------------------------------------

(Updated 七月 11, 2017, 2:41 a.m.)


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
-------

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/3/

Changes: https://reviews.apache.org/r/60696/diff/2-3/


Testing
-------


Thanks,

pengjianhua


Re: Review Request 60696: In different places to achieve the same function using repeat codes, new issue is perhaps generated when these functions are modified.

Posted by pengjianhua <pe...@zte.com.cn>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60696/
-----------------------------------------------------------

(Updated 七月 11, 2017, 1:52 a.m.)


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.


Changes
-------

Colm O hEigeartaigh
thanks for your suggestion, I have modified it.


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


Repository: ranger


Description
-------

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/2/

Changes: https://reviews.apache.org/r/60696/diff/1-2/


Testing
-------


Thanks,

pengjianhua


Re: Review Request 60696: In different places to achieve the same function using repeat codes, new issue is perhaps generated when these functions are modified.

Posted by Colm O hEigeartaigh <co...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60696/#review180023
-----------------------------------------------------------



> final Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();
> docs.add(document);

Better to write this as:

final Collection<SolrInputDocument> docs = Collections.singletonList(document);

- Colm O hEigeartaigh


On July 7, 2017, 1:46 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60696/
> -----------------------------------------------------------
> 
> (Updated July 7, 2017, 1:46 a.m.)
> 
> 
> 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
> -------
> 
> 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
> -----
> 
>   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
> 
>