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 53208cce0d..a40b20ba2d 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -341,15 +341,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; @@ -368,6 +370,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()); } }