You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Qiang Zhang (JIRA)" <ji...@apache.org> on 2017/02/21 07:59:44 UTC
[jira] [Comment Edited] (RANGER-1399) Do some code improvement in
Java method SolrUtil.searchResources
[ https://issues.apache.org/jira/browse/RANGER-1399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875515#comment-15875515 ]
Qiang Zhang edited comment on RANGER-1399 at 2/21/17 7:59 AM:
--------------------------------------------------------------
Review Requet:
https://reviews.apache.org/r/56866/
Solution patch, please see attachment:
[patch|https://issues.apache.org/jira/secure/attachment/12853683/0001-RANGER-1399-Do-some-code-improvement-in-Java-method-.patch]
was (Author: zhangqiang2):
Review Requet:
https://reviews.apache.org/r/56866/
Solution patch, please see attachment:
[patch|https://issues.apache.org/jira/secure/attachment/12853674/0001-RANGER-1399-Do-some-code-improvement-in-Java-method-.patch]
> Do some code improvement in Java method SolrUtil.searchResources
> ----------------------------------------------------------------
>
> Key: RANGER-1399
> URL: https://issues.apache.org/jira/browse/RANGER-1399
> Project: Ranger
> Issue Type: Improvement
> Components: admin
> Reporter: Qiang Zhang
> Assignee: Qiang Zhang
> Priority: Minor
> Labels: patch
> Attachments: 0001-RANGER-1399-Do-some-code-improvement-in-Java-method-.patch
>
> Original Estimate: 12h
> Remaining Estimate: 12h
>
> In method searchResources of class /security-admin-web/src/main/java/org/apache/ranger/solr/SolrUtil.java,
> there is some code can be improved:
> 1.There is spelling error, "Search file" should be "Search field"
> {code}
> logger.error("Search file is not of java object instanceof Date");
> {code}
> 2.use "query" to replace "query.toString()" when print log
> {code}
> if (logger.isDebugEnabled()) {
> logger.debug("SOLR QUERY=" + query.toString());
> }
> if (response == null || response.getStatus() != 0) {
> logger.error("Error running query. query=" + query.toString()
> + ", response=" + response);
> throw restErrorUtil.createRESTException("Error running query",
> MessageEnums.ERROR_SYSTEM);
> }
> {code}
> 3.In Java method SolrAccessAuditsService.searchXAccessAudits, there is duplicate code to check response, in fact it would never be called, because response has been checked before returning in SolrUtil.searchResources, so remove it
> {code}
> if (response == null) {
> logger.warn("Error running search query. searchCriteria="
> + searchCriteria.toString());
> throw restErrorUtil.createRESTException(
> "Error running search query", MessageEnums.ERROR_SYSTEM);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)