diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index 0028818d74..21b1ef6f2a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -342,15 +342,17 @@ private static Hive create(HiveConf c, boolean doRegisterAllFns) throws HiveExce } c.set("fs.scheme.class", "dfs"); Hive newdb = new Hive(c, doRegisterAllFns); - if (c.get(HiveConf.ConfVars.METASTORE_CLIENT_CAPABILITIES.varname) != null) { - String[] capabilities = c.get(HiveConf.ConfVars.METASTORE_CLIENT_CAPABILITIES.varname).split(","); - newdb.setHMSClientCapabilities(capabilities); - String hostName = "unknown"; - try { - hostName = InetAddress.getLocalHost().getCanonicalHostName(); - } catch (UnknownHostException ue) { + if (newdb.getHMSClientCapabilities() == null || newdb.getHMSClientCapabilities().length == 0) { + if (c.get(HiveConf.ConfVars.METASTORE_CLIENT_CAPABILITIES.varname) != null) { + String[] capabilities = c.get(HiveConf.ConfVars.METASTORE_CLIENT_CAPABILITIES.varname).split(","); + newdb.setHMSClientCapabilities(capabilities); + String hostName = "unknown"; + try { + hostName = InetAddress.getLocalHost().getCanonicalHostName(); + } catch (UnknownHostException ue) { + } + newdb.setHMSClientIdentifier("Hiveserver2#" + HiveVersionInfo.getVersion() + "@" + hostName); } - newdb.setHMSClientIdentifier("Hiveserver2#" + HiveVersionInfo.getVersion() + "@" + hostName); } hiveDB.set(newdb); return newdb; @@ -369,6 +371,14 @@ public void setHMSClientIdentifier(final String id) { HiveMetaStoreClient.setProcessorIdentifier(id); } + public String[] getHMSClientCapabilities() { + return HiveMetaStoreClient.getProcessorCapabilities(); + } + + public String getHMSClientIdentifier() { + return HiveMetaStoreClient.getProcessorIdentifier(); + } + private static boolean isCompatible(Hive db, HiveConf c, boolean isFastCheck) { if (isFastCheck) { return (db.metaStoreClient == null || db.metaStoreClient.isSameConfObj(c)) diff --git ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java index 463236135c..88a8919d09 100644 --- ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java +++ ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java @@ -457,7 +457,7 @@ public void updateThreadName() { final String currThreadName = Thread.currentThread().getName(); if (!currThreadName.contains(logPrefix)) { final String newThreadName = logPrefix + " " + currThreadName; - LOG.info("Updating thread name to {}", newThreadName); + LOG.debug("Updating thread name to {}", newThreadName); Thread.currentThread().setName(newThreadName); } } @@ -468,7 +468,7 @@ public void resetThreadName() { final String currThreadName = Thread.currentThread().getName(); if (currThreadName.contains(logPrefix)) { final String[] names = currThreadName.split(logPrefix); - LOG.info("Resetting thread name to {}", names[names.length - 1]); + LOG.debug("Resetting thread name to {}", names[names.length - 1]); Thread.currentThread().setName(names[names.length - 1].trim()); } } 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 02b3af74d4..9b64028a76 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 @@ -733,6 +733,14 @@ public static void setProcessorIdentifier(final String id) { processorIdentifier = id; } + public static String[] getProcessorCapabilities() { + return processorCapabilities; + } + + public static String getProcessorIdentifier() { + return processorIdentifier; + } + @Override public void setMetaConf(String key, String value) throws TException { client.setMetaConf(key, value);