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

[10/50] [abbrv] hive git commit: Revert "Revert "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)""

Revert "Revert "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)""

This reverts commit 71d77ab1b268b200c93cb9e69f2f2ee74afa8c96.


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

Branch: refs/heads/branch-3.0.0
Commit: 92bc9cf04ef3779cea2959917a2063e16ce86fac
Parents: aa040c5
Author: sergey <se...@apache.org>
Authored: Tue May 8 17:20:19 2018 -0700
Committer: sergey <se...@apache.org>
Committed: Tue May 8 17:20:19 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java | 3 ++-
 .../test/java/org/apache/hadoop/hive/metastore/TestOldSchema.java | 1 +
 .../src/test/java/org/apache/hadoop/hive/metastore/TestStats.java | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/92bc9cf0/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);
       }

http://git-wip-us.apache.org/repos/asf/hive/blob/92bc9cf0/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestOldSchema.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestOldSchema.java b/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestOldSchema.java
index 49033d3..54b14c3 100644
--- a/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestOldSchema.java
+++ b/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestOldSchema.java
@@ -98,6 +98,7 @@ public class TestOldSchema {
   public void setUp() throws Exception {
     conf = MetastoreConf.newMetastoreConf();
     MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.STATS_FETCH_BITVECTOR, false);
+    MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.HIVE_IN_TEST, true);
     MetaStoreTestUtils.setConfForStandloneMode(conf);
 
     store = new ObjectStore();

http://git-wip-us.apache.org/repos/asf/hive/blob/92bc9cf0/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestStats.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestStats.java b/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestStats.java
index 6cca062..4d88505 100644
--- a/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestStats.java
+++ b/standalone-metastore/src/test/java/org/apache/hadoop/hive/metastore/TestStats.java
@@ -76,6 +76,7 @@ public class TestStats {
     conf = MetastoreConf.newMetastoreConf();
     MetaStoreTestUtils.setConfForStandloneMode(conf);
     MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.AGGREGATE_STATS_CACHE_ENABLED, false);
+    MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.HIVE_IN_TEST, true);
     // Get new client
     client = new HiveMetaStoreClient(conf);
   }