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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6469f07  HIVE-24022: Optimise 
HiveMetaStoreAuthorizer.createHiveMetaStoreAuthorizer(Sam An reviewed by Naveen 
Gangam)
6469f07 is described below

commit 6469f07ed9b59b29e9cb1ba6dc6f9d0d0789a815
Author: Sam An <[email protected]>
AuthorDate: Mon Aug 10 18:48:53 2020 -0700

    HIVE-24022: Optimise 
HiveMetaStoreAuthorizer.createHiveMetaStoreAuthorizer(Sam An reviewed by Naveen 
Gangam)
---
 .../plugin/metastore/HiveMetaStoreAuthorizer.java             | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/HiveMetaStoreAuthorizer.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/HiveMetaStoreAuthorizer.java
index 23db0da..8dbeeee 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/HiveMetaStoreAuthorizer.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/HiveMetaStoreAuthorizer.java
@@ -31,6 +31,7 @@ import 
org.apache.hadoop.hive.metastore.api.InvalidOperationException;
 import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
 import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.apache.hadoop.hive.metastore.events.PreAlterTableEvent;
 import org.apache.hadoop.hive.metastore.events.PreCreateTableEvent;
 import org.apache.hadoop.hive.metastore.events.PreDropTableEvent;
@@ -70,9 +71,10 @@ public class HiveMetaStoreAuthorizer extends 
MetaStorePreEventListener implement
   private static final Log LOG = 
LogFactory.getLog(HiveMetaStoreAuthorizer.class);
 
   private static final ThreadLocal<Configuration> tConfig = new 
ThreadLocal<Configuration>() {
+
     @Override
     protected Configuration initialValue() {
-      return new HiveConf(HiveMetaStoreAuthorizer.class);
+      return null;
     }
   };
 
@@ -451,7 +453,12 @@ public class HiveMetaStoreAuthorizer extends 
MetaStorePreEventListener implement
 
   HiveAuthorizer createHiveMetaStoreAuthorizer() throws Exception {
     HiveAuthorizer ret = null;
-    HiveConf hiveConf = new HiveConf(super.getConf(), HiveConf.class);
+    HiveConf hiveConf = (HiveConf)tConfig.get();
+    if(hiveConf == null){
+      HiveConf hiveConf1 = new HiveConf(super.getConf(), HiveConf.class);
+      tConfig.set(hiveConf1);
+      hiveConf = hiveConf1;
+    }
     HiveAuthorizerFactory authorizerFactory =
         HiveUtils.getAuthorizerFactory(hiveConf, 
HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER);
 

Reply via email to