Repository: hive Updated Branches: refs/heads/master 7d7c18396 -> 0a70831c9
HIVE-18906: Lower Logging for "Using direct SQL" (Antal Sinkovits via Peter Vary) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0a70831c Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0a70831c Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0a70831c Branch: refs/heads/master Commit: 0a70831c99706a5ba4a18262f1aafb232eefdf68 Parents: 7d7c183 Author: Antal Sinkovits <[email protected]> Authored: Mon May 14 14:00:41 2018 +0200 Committer: Peter Vary <[email protected]> Committed: Mon May 14 14:00:41 2018 +0200 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hive/metastore/HiveMetaStore.java | 7 +++++++ .../org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java | 2 +- .../java/org/apache/hadoop/hive/metastore/ObjectStore.java | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/0a70831c/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index a2b8743..92d2e3f 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -653,6 +653,10 @@ public class HiveMetaStore extends ThriftHiveMetastore { setHMSHandler(this); configuration.set(key, value); notifyMetaListeners(key, oldValue, value); + + if (ConfVars.TRY_DIRECT_SQL == confVar) { + HMSHandler.LOG.info("Direct SQL optimization = {}", value); + } } @Override @@ -8893,6 +8897,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { HMSHandler.LOG.info("TCP keepalive = " + tcpKeepAlive); HMSHandler.LOG.info("Enable SSL = " + useSSL); + boolean directSqlEnabled = MetastoreConf.getBoolVar(conf, ConfVars.TRY_DIRECT_SQL); + HMSHandler.LOG.info("Direct SQL optimization = {}", directSqlEnabled); + if (startLock != null) { signalOtherThreadsToStart(tServer, startLock, startCondition, startedServing); } http://git-wip-us.apache.org/repos/asf/hive/blob/0a70831c/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java index 56fbfed..48f77b9 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java @@ -182,7 +182,7 @@ class MetaStoreDirectSql { boolean isInTest = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST); isCompatibleDatastore = (!isInTest || ensureDbInit()) && runTestQuery(); if (isCompatibleDatastore) { - LOG.info("Using direct SQL, underlying DB is " + dbType); + LOG.debug("Using direct SQL, underlying DB is " + dbType); } } http://git-wip-us.apache.org/repos/asf/hive/blob/0a70831c/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java index b0a805f..264fdb9 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -3490,6 +3490,7 @@ public class ObjectStore implements RawStore, Configurable { try { directSql.prepareTxn(); this.results = getSqlResult(this); + LOG.debug("Using direct SQL optimization."); } catch (Exception ex) { handleDirectSqlError(ex); } @@ -3499,6 +3500,7 @@ public class ObjectStore implements RawStore, Configurable { // 2) DirectSQL threw and was disabled in handleDirectSqlError. if (!doUseDirectSql) { this.results = getJdoResult(this); + LOG.debug("Not using direct SQL optimization."); } return commit(); } catch (NoSuchObjectException ex) {
