hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r926718 - in /hadoop/hive/trunk: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java
Date Tue, 23 Mar 2010 18:47:47 GMT
Author: namit
Date: Tue Mar 23 18:47:47 2010
New Revision: 926718

URL: http://svn.apache.org/viewvc?rev=926718&view=rev
Log:
HIVE-1261. ql.metadata.Hive#close() should check for null metaStoreClient
(bc Wong via namit)


Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
    hadoop/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=926718&r1=926717&r2=926718&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Tue Mar 23 18:47:47 2010
@@ -285,6 +285,9 @@ Trunk -  Unreleased
     HIVE-1252. Column pruning buf after a filter
     (He Yongqiang via namit)
 
+    HIVE-1261. ql.metadata.Hive#close() should check for null metaStoreClient
+    (bc Wong via namit)
+
 Release 0.5.0 -  Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java?rev=926718&r1=926717&r2=926718&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java Tue Mar 23
18:47:47 2010
@@ -160,7 +160,9 @@ public class Hive {
    */
   private void close() {
     LOG.info("Closing current thread's connection to Hive Metastore.");
-    metaStoreClient.close();
+    if (metaStoreClient != null) {
+      metaStoreClient.close();
+    }
   }
 
   /**

Modified: hadoop/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java?rev=926718&r1=926717&r2=926718&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java (original)
+++ hadoop/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java Tue Mar
23 18:47:47 2010
@@ -267,6 +267,18 @@ public class TestHive extends TestCase {
     return tbl;
   }
 
+  /**
+   * Test basic Hive class interaction, that:
+   * - We can have different Hive objects throughout the lifetime of this thread.
+   */
+  public void testHiveCloseCurrent() throws Throwable {
+    Hive hive1 = Hive.get();
+    Hive.closeCurrent();
+    Hive hive2 = Hive.get();
+    Hive.closeCurrent();
+    assertTrue(hive1 != hive2);
+  }
+
   public void testGetAndDropTables() throws Throwable {
     try {
       String dbName = "db_for_testgettables";



Mime
View raw message