FAQ
Author: kevinwilfong
Date: Fri Apr 13 16:29:03 2012
New Revision: 1325830

URL: http://svn.apache.org/viewvc?rev=1325830&view=rev
Log:
HIVE-2937. TestHiveServerSessions hangs when executed directly. (navis via kevinwilfong)

Modified:
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.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=1325830&r1=1325829&r2=1325830&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 Fri Apr 13 16:29:03 2012
@@ -382,21 +382,22 @@ public class HiveMetaStore extends Thrif
* @throws MetaException
*/
private void createDefaultDB() throws MetaException {
- if (HMSHandler.createDefaultDB || !checkForDefaultDb) {
- return;
- }
+ synchronized (HMSHandler.class) {
+ if (HMSHandler.createDefaultDB || !checkForDefaultDb) {
+ return;
+ }

- try {
- createDefaultDB_core(getMS());
- } catch (InvalidObjectException e) {
- throw new MetaException(e.getMessage());
- } catch (MetaException e) {
- throw e;
- } catch (Exception e) {
- assert (e instanceof RuntimeException);
- throw (RuntimeException) e;
+ try {
+ createDefaultDB_core(getMS());
+ } catch (InvalidObjectException e) {
+ throw new MetaException(e.getMessage());
+ } catch (MetaException e) {
+ throw e;
+ } catch (Exception e) {
+ assert (e instanceof RuntimeException);
+ throw (RuntimeException) e;
+ }
}
-
}

private void logInfo(String m) {

Modified: hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java?rev=1325830&r1=1325829&r2=1325830&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java (original)
+++ hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java Fri Apr 13 16:29:03 2012
@@ -152,11 +152,11 @@ public class HiveServer extends ThriftHi
session.in = null;
session.out = new PrintStream(System.out, true, "UTF-8");
session.err = new PrintStream(System.err, true, "UTF-8");
- } catch (UnsupportedEncodingException ee) {
- ee.printStackTrace();
- session.out = null;
- session.err = null;
- }
+ } catch (UnsupportedEncodingException ee) {
+ ee.printStackTrace();
+ session.out = null;
+ session.err = null;
+ }
}
}

@@ -545,11 +545,14 @@ public class HiveServer extends ThriftHi
}

@Override
+ @SuppressWarnings("unchecked")
public TProcessor getProcessor(TTransport trans) {
try {
Iface handler = new HiveServerHandler(new HiveConf(conf));
return new ThriftHive.Processor(handler);
} catch (Exception e) {
+ HiveServerHandler.LOG.warn("Failed to get processor by exception " + e, e);
+ trans.close();
throw new RuntimeException(e);
}
}

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedApr 13, '12 at 4:29p
activeApr 13, '12 at 4:29p
posts1
users1
websitehive.apache.org

1 user in discussion

Kevinwilfong: 1 post

People

Translate

site design / logo © 2021 Grokbase