You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ga...@apache.org on 2014/10/30 00:28:27 UTC
svn commit: r1635337 -
/hive/trunk/hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/HiveEndPoint.java
Author: gates
Date: Wed Oct 29 23:28:26 2014
New Revision: 1635337
URL: http://svn.apache.org/r1635337
Log:
HIVE-8629 Streaming / ACID : hive cli session creation takes too long and times out if execution engine is tez (Roshan Naik via Alan Gates)
Modified:
hive/trunk/hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/HiveEndPoint.java
Modified: hive/trunk/hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/HiveEndPoint.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/HiveEndPoint.java?rev=1635337&r1=1635336&r2=1635337&view=diff
==============================================================================
--- hive/trunk/hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/HiveEndPoint.java (original)
+++ hive/trunk/hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/HiveEndPoint.java Wed Oct 29 23:28:26 2014
@@ -267,6 +267,9 @@ public class HiveEndPoint {
if (conf==null) {
conf = HiveEndPoint.createHiveConf(this.getClass(), endPoint.metaStoreUri);
}
+ else {
+ overrideConfSettings(conf);
+ }
this.secureMode = ugi==null ? false : ugi.hasKerberosCredentials();
this.msClient = getMetaStoreClient(endPoint, conf, secureMode);
if (createPart && !endPoint.partitionVals.isEmpty()) {
@@ -837,14 +840,35 @@ public class HiveEndPoint {
static HiveConf createHiveConf(Class<?> clazz, String metaStoreUri) {
HiveConf conf = new HiveConf(clazz);
- conf.setVar(HiveConf.ConfVars.HIVE_TXN_MANAGER,
- "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager");
- conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, true);
- conf.setBoolVar(HiveConf.ConfVars.METASTORE_EXECUTE_SET_UGI, true);
if (metaStoreUri!= null) {
- conf.setVar(HiveConf.ConfVars.METASTOREURIS, metaStoreUri);
+ setHiveConf(conf, HiveConf.ConfVars.METASTOREURIS, metaStoreUri);
}
+ HiveEndPoint.overrideConfSettings(conf);
return conf;
}
+ private static void overrideConfSettings(HiveConf conf) {
+ setHiveConf(conf, HiveConf.ConfVars.HIVE_TXN_MANAGER,
+ "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager");
+ setHiveConf(conf, HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, true);
+ setHiveConf(conf, HiveConf.ConfVars.METASTORE_EXECUTE_SET_UGI, true);
+ // Avoids creating Tez Client sessions internally as it takes much longer currently
+ setHiveConf(conf, HiveConf.ConfVars.HIVE_EXECUTION_ENGINE, "mr");
+ }
+
+ private static void setHiveConf(HiveConf conf, HiveConf.ConfVars var, String value) {
+ if( LOG.isDebugEnabled() ) {
+ LOG.debug("Overriding HiveConf setting : " + var + " = " + value);
+ }
+ conf.setVar(var, value);
+ }
+
+ private static void setHiveConf(HiveConf conf, HiveConf.ConfVars var, boolean value) {
+ if( LOG.isDebugEnabled() ) {
+ LOG.debug("Overriding HiveConf setting : " + var + " = " + value);
+ }
+ conf.setBoolVar(var, value);
+ }
+
+
} // class HiveEndPoint