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

hive git commit: HIVE-11157: Hive.get(HiveConf) returns same Hive object to different user sessions (Chaoyu Tang, reviewed by Jimmy Xiang)

Repository: hive
Updated Branches:
  refs/heads/master 023c06c17 -> 470d9c8ab


HIVE-11157: Hive.get(HiveConf) returns same Hive object to different user sessions (Chaoyu Tang, reviewed by Jimmy Xiang)


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

Branch: refs/heads/master
Commit: 470d9c8ab20d2c3e4f57883ac4e3e72d34483ba8
Parents: 023c06c
Author: ctang <ct...@gmail.com>
Authored: Thu Jul 2 09:56:40 2015 -0400
Committer: ctang <ct...@gmail.com>
Committed: Thu Jul 2 09:56:40 2015 -0400

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/470d9c8a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
index a6193ba..d89aafc 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
@@ -194,7 +194,7 @@ public class Hive {
   /**
    * Gets hive object for the current thread. If one is not initialized then a
    * new one is created If the new configuration is different in metadata conf
-   * vars then a new one is created.
+   * vars, or the owner will be different then a new one is created.
    *
    * @param c
    *          new Hive Configuration
@@ -204,7 +204,7 @@ public class Hive {
    */
   public static Hive get(HiveConf c) throws HiveException {
     Hive db = hiveDB.get();
-    if (db == null ||
+    if (db == null || !db.isCurrentUserOwner() ||
         (db.metaStoreClient != null && !db.metaStoreClient.isCompatibleWith(c))) {
       return get(c, true);
     }
@@ -292,6 +292,9 @@ public class Hive {
       metaStoreClient.close();
       metaStoreClient = null;
     }
+    if (owner != null) {
+      owner = null;
+    }
   }
 
   /**