This is an automated email from the ASF dual-hosted git repository.

pengjianhua pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 96560fd  RANGER-2560 Solve the problem of the order of the 
configuration items of the Solr plugin
96560fd is described below

commit 96560fd86543ffd2fe97531eb862b3c66cf0736a
Author: Kehua Wu <[email protected]>
AuthorDate: Thu Sep 5 20:07:45 2019 +0800

    RANGER-2560 Solve the problem of the order of the configuration items of 
the Solr plugin
    
    Signed-off-by: peng.jianhua <[email protected]>
---
 .../solr/authorizer/RangerSolrAuthorizer.java      | 32 +++++++++++-----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
 
b/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
index f87e531..5fcd45d 100644
--- 
a/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
+++ 
b/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
@@ -83,6 +83,22 @@ public class RangerSolrAuthorizer implements 
AuthorizationPlugin {
                logger.info("init()");
 
                try {
+                       RangerBasePlugin me = solrPlugin;
+                       if (me == null) {
+                               synchronized(RangerSolrAuthorizer.class) {
+                                       me = solrPlugin;
+                                       logger.info("RangerSolrAuthorizer(): 
init called");
+                                       if (me == null) {
+                                               me = solrPlugin = new 
RangerBasePlugin("solr", "solr");
+                                       }
+                               }
+                       }
+                       solrPlugin.init();
+               } catch (Throwable t) {
+                       logger.fatal("Error creating and initializing 
RangerBasePlugin()");
+               }
+
+               try {
                        useProxyIP = 
RangerConfiguration.getInstance().getBoolean(
                                        PROP_USE_PROXY_IP, useProxyIP);
                        proxyIPHeader = RangerConfiguration.getInstance().get(
@@ -104,22 +120,6 @@ public class RangerSolrAuthorizer implements 
AuthorizationPlugin {
                } catch (Throwable t) {
                        logger.fatal("Error init", t);
                }
-
-               try {
-                       RangerBasePlugin me = solrPlugin;
-                       if (me == null) {
-                               synchronized(RangerSolrAuthorizer.class) {
-                                       me = solrPlugin;
-                                       logger.info("RangerSolrAuthorizer(): 
init called");
-                                       if (me == null) {
-                                               me = solrPlugin = new 
RangerBasePlugin("solr", "solr");
-                                       }
-                               }
-                       }
-                       solrPlugin.init();
-               } catch (Throwable t) {
-                       logger.fatal("Error creating and initializing 
RangerBasePlugin()");
-               }
        }
 
        private void authToJAASFile() {

Reply via email to