diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 282f4cdb0b..a0d87bd9da 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -742,10 +742,7 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal @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", @@ -5597,8 +5594,15 @@ private void initialize(Class cls) { // 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 standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index 43657e7430..de0acecf7d 100644 --- standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -176,6 +176,17 @@ public HiveMetaStoreClient(Configuration conf, HiveMetaHookLoader hookLoader, Bo 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) {