hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1163681 - in /hive/trunk: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
Date Wed, 31 Aug 2011 16:22:21 GMT
Author: jvs
Date: Wed Aug 31 16:22:21 2011
New Revision: 1163681

URL: http://svn.apache.org/viewvc?rev=1163681&view=rev
Log:
HIVE-2184. Few improvements in org.apache.hadoop.hive.ql.metadata.Hive.close
(Chinna Rao Lalam via jvs)


Modified:
    hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
    hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=1163681&r1=1163680&r2=1163681&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Wed
Aug 31 16:22:21 2011
@@ -577,6 +577,7 @@ public class HiveMetaStore extends Thrif
       RawStore ms = threadLocalMS.get();
       if (ms != null) {
         ms.shutdown();
+        ms = null;
       }
       logInfo("Metastore shutdown complete.");
     }

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java?rev=1163681&r1=1163680&r2=1163681&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
(original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
Wed Aug 31 16:22:21 2011
@@ -77,7 +77,6 @@ public class HiveMetaStoreClient impleme
   private TTransport transport = null;
   private boolean isConnected = false;
   private URI metastoreUris[];
-  private final boolean standAloneClient = false;
   private final HiveMetaHookLoader hookLoader;
   private final HiveConf conf;
   private String tokenStrForm;
@@ -264,15 +263,15 @@ public class HiveMetaStoreClient impleme
     if ((transport != null) && transport.isOpen()) {
       transport.close();
     }
-    if (standAloneClient) {
-      try {
+    try {
+      if (null != client) {
         client.shutdown();
-      } catch (TException e) {
-        // TODO:pc cleanup the exceptions
-        LOG.error("Unable to shutdown local metastore client");
-        LOG.error(e.getStackTrace());
-        // throw new RuntimeException(e.getMessage());
       }
+    } catch (TException e) {
+      // TODO:pc cleanup the exceptions
+      LOG.error("Unable to shutdown local metastore client");
+      LOG.error(e.getStackTrace());
+      // throw new RuntimeException(e.getMessage());
     }
   }
 

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java?rev=1163681&r1=1163680&r2=1163681&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java Wed Aug 31 16:22:21
2011
@@ -191,6 +191,7 @@ public class Hive {
     LOG.info("Closing current thread's connection to Hive Metastore.");
     if (metaStoreClient != null) {
       metaStoreClient.close();
+      metaStoreClient = null;
     }
   }
 



Mime
View raw message