You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ma...@apache.org on 2019/11/19 06:57:51 UTC

[hive] branch master updated: HIVE-22497 : Remove default value for Capabilities from HiveConf. (Naveen Gangam, reviewed by Sam An)

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

mahesh 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 c032cbe  HIVE-22497 : Remove default value for Capabilities from HiveConf. (Naveen Gangam, reviewed by Sam An)
c032cbe is described below

commit c032cbe2d3fdfc9a107c91f3642d95560efd89a2
Author: Naveen Gangam <ng...@apache.org>
AuthorDate: Tue Nov 19 12:25:37 2019 +0530

    HIVE-22497 : Remove default value for Capabilities from HiveConf. (Naveen Gangam, reviewed by Sam An)
    
    Signed-off-by: Mahesh Kumar Behera <ma...@apache.org>
---
 .../src/java/org/apache/hadoop/hive/conf/HiveConf.java   | 16 ++++++++++------
 .../hadoop/hive/metastore/HiveMetaStoreClient.java       | 11 +++++++++++
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index 9162253..a7687d5 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -745,10 +745,7 @@ public class HiveConf extends Configuration {
     @Deprecated
     METASTORE_CAPABILITY_CHECK("hive.metastore.client.capability.check", true,
         "Whether to check client capabilities for potentially breaking API usage."),
-    METASTORE_CLIENT_CAPABILITIES("hive.metastore.client.capabilities", "EXTWRITE,EXTREAD,HIVEBUCKET2,"
-        + "HIVEFULLACIDREAD,HIVEFULLACIDWRITE,HIVECACHEINVALIDATE,HIVEMANAGESTATS,"
-        + "HIVEMANAGEDINSERTWRITE,HIVEMANAGEDINSERTREAD,"
-        + "HIVESQL,HIVEMQT,HIVEONLYMQTWRITE", "Capabilities possessed by HiveServer"),
+    METASTORE_CLIENT_CAPABILITIES("hive.metastore.client.capabilities", "", "Capabilities possessed by HiveServer"),
     METASTORE_CLIENT_CACHE_ENABLED("hive.metastore.client.cache.enabled", false,
       "Whether to enable metastore client cache"),
     METASTORE_CLIENT_CACHE_EXPIRY_TIME("hive.metastore.client.cache.expiry.time", "120s",
@@ -5620,8 +5617,15 @@ public class HiveConf extends Configuration {
     // metastore can be embedded within hiveserver2, in such cases
     // the conf params in hiveserver2-site.xml will override whats defined
     // in hivemetastore-site.xml
-    if (isLoadHiveServer2Config() && hiveServer2SiteUrl != null) {
-      addResource(hiveServer2SiteUrl);
+    if (isLoadHiveServer2Config()) {
+      // set the hardcoded value first, so anything in hiveserver2-site.xml can override it
+      set(ConfVars.METASTORE_CLIENT_CAPABILITIES.varname, "EXTWRITE,EXTREAD,HIVEBUCKET2,HIVEFULLACIDREAD,"
+          + "HIVEFULLACIDWRITE,HIVECACHEINVALIDATE,HIVEMANAGESTATS,HIVEMANAGEDINSERTWRITE,HIVEMANAGEDINSERTREAD,"
+          + "HIVESQL,HIVEMQT,HIVEONLYMQTWRITE");
+
+      if (hiveServer2SiteUrl != null) {
+        addResource(hiveServer2SiteUrl);
+      }
     }
 
     String val = this.getVar(HiveConf.ConfVars.HIVE_ADDITIONAL_CONFIG_FILES);
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index 459af5b..736c2b0 100644
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -176,6 +176,17 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable {
     fileMetadataBatchSize = MetastoreConf.getIntVar(
         conf, ConfVars.BATCH_RETRIEVE_OBJECTS_MAX);
 
+    if ((MetastoreConf.get(conf, "hive.metastore.client.capabilities")) != null) {
+      String[] capabilities = MetastoreConf.get(conf, "hive.metastore.client.capabilities").split(",");
+      setProcessorCapabilities(capabilities);
+      String hostName = "unknown";
+      try {
+        hostName = InetAddress.getLocalHost().getCanonicalHostName();
+      } catch (UnknownHostException ue) {
+      }
+      setProcessorIdentifier("HMSClient-" + "@" + hostName);
+    }
+
     String msUri = MetastoreConf.getVar(conf, ConfVars.THRIFT_URIS);
     localMetaStore = MetastoreConf.isEmbeddedMetaStore(msUri);
     if (localMetaStore) {