You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by th...@apache.org on 2014/10/28 00:45:32 UTC
svn commit: r1634742 -
/hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
Author: thejas
Date: Mon Oct 27 23:45:31 2014
New Revision: 1634742
URL: http://svn.apache.org/r1634742
Log:
HIVE-8320 : Error in MetaException(message:Got exception: org.apache.thrift.transport.TTransportException java.net.SocketTimeoutException: Read timed out) (Gavin Kim via Thejas Nair)
Modified:
hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java?rev=1634742&r1=1634741&r2=1634742&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java Mon Oct 27 23:45:31 2014
@@ -35,12 +35,13 @@ import org.apache.hadoop.hive.common.cli
import org.apache.hadoop.hive.common.cli.IHiveFileProcessor;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
-import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.ql.exec.FetchFormatter;
import org.apache.hadoop.hive.ql.exec.ListSinkOperator;
import org.apache.hadoop.hive.ql.history.HiveHistory;
+import org.apache.hadoop.hive.ql.metadata.Hive;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.processors.SetProcessor;
import org.apache.hadoop.hive.ql.session.SessionState;
import org.apache.hadoop.hive.shims.ShimLoader;
@@ -81,7 +82,6 @@ public class HiveSessionImpl implements
private SessionManager sessionManager;
private OperationManager operationManager;
- private IMetaStoreClient metastoreClient = null;
private final Set<OperationHandle> opHandleSet = new HashSet<OperationHandle>();
private boolean isOperationLogEnabled;
private File sessionLogDir;
@@ -327,14 +327,13 @@ public class HiveSessionImpl implements
@Override
public IMetaStoreClient getMetaStoreClient() throws HiveSQLException {
- if (metastoreClient == null) {
- try {
- metastoreClient = new HiveMetaStoreClient(getHiveConf());
- } catch (MetaException e) {
- throw new HiveSQLException(e);
- }
+ try {
+ return Hive.get(getHiveConf()).getMSC();
+ } catch (HiveException e) {
+ throw new HiveSQLException("Failed to get metastore connection", e);
+ } catch (MetaException e) {
+ throw new HiveSQLException("Failed to get metastore connection", e);
}
- return metastoreClient;
}
@Override
@@ -550,14 +549,6 @@ public class HiveSessionImpl implements
public void close() throws HiveSQLException {
try {
acquire(true);
- /**
- * For metadata operations like getTables(), getColumns() etc,
- * the session allocates a private metastore handler which should be
- * closed at the end of the session
- */
- if (metastoreClient != null) {
- metastoreClient.close();
- }
// Iterate through the opHandles and close their operations
for (OperationHandle opHandle : opHandleSet) {
operationManager.closeOperation(opHandle);