You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2018/05/07 20:40:15 UTC

hive git commit: HIVE-19310 : Metastore: MetaStoreDirectSql.ensureDbInit has some slow DN calls which might need to be run only in test env (Sergey Shelukhin, reviewed by Gopal Vijayaraghavan)

Repository: hive
Updated Branches:
  refs/heads/branch-3 63abf9be0 -> 41f570a2c


HIVE-19310 : Metastore: MetaStoreDirectSql.ensureDbInit has some slow DN calls which might need to be run only in test env (Sergey Shelukhin, reviewed by Gopal Vijayaraghavan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/41f570a2
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/41f570a2
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/41f570a2

Branch: refs/heads/branch-3
Commit: 41f570a2c303cf390806e4681c73873486fdb19d
Parents: 63abf9b
Author: sergey <se...@apache.org>
Authored: Mon May 7 12:10:49 2018 -0700
Committer: sergey <se...@apache.org>
Committed: Mon May 7 13:38:25 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/41f570a2/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 997f5fd..e2ca6d2 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
@@ -179,7 +179,8 @@ class MetaStoreDirectSql {
           + " Disabling directSQL as it uses hand-hardcoded SQL with that assumption.");
       isCompatibleDatastore = false;
     } else {
-      isCompatibleDatastore = ensureDbInit() && runTestQuery();
+      boolean isInTest = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST);
+      isCompatibleDatastore = (!isInTest || ensureDbInit()) && runTestQuery();
       if (isCompatibleDatastore) {
         LOG.info("Using direct SQL, underlying DB is " + dbType);
       }