hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject [40/50] [abbrv] hive git commit: HIVE-13931: Add support for HikariCP and replace BoneCP usage with HikariCP (Prasanth Jayachandran reviewed by Sushanth Sowmyan)
Date Tue, 15 Nov 2016 20:21:12 GMT
HIVE-13931: Add support for HikariCP and replace BoneCP usage with HikariCP (Prasanth Jayachandran
reviewed by Sushanth Sowmyan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4427eab3
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4427eab3
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4427eab3

Branch: refs/heads/hive-14535
Commit: 4427eab3df52ef5c1604bc020af85c2787ca15b1
Parents: 6536e30
Author: Prasanth Jayachandran <prasanthj@apache.org>
Authored: Mon Nov 14 22:34:39 2016 -0800
Committer: Prasanth Jayachandran <prasanthj@apache.org>
Committed: Mon Nov 14 22:34:39 2016 -0800

----------------------------------------------------------------------
 .../src/java/org/apache/hadoop/hive/conf/HiveConf.java   |  3 ++-
 .../main/java/org/apache/hadoop/hive/ql/QTestUtil.java   |  1 +
 metastore/pom.xml                                        |  5 +++++
 .../org/apache/hadoop/hive/metastore/txn/TxnHandler.java | 10 ++++++++++
 .../hive/metastore/txn/TestTxnHandlerNegative.java       | 11 ++++++++---
 pom.xml                                                  |  8 +++++++-
 6 files changed, 33 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/4427eab3/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
----------------------------------------------------------------------
diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index 14dacf5..200a1ad 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -717,7 +717,8 @@ public class HiveConf extends Configuration {
         "Defaults to all permissions for the hiveserver2/metastore process user."),
     METASTORE_CACHE_PINOBJTYPES("hive.metastore.cache.pinobjtypes", "Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order",
         "List of comma separated metastore object types that should be pinned in the cache"),
-    METASTORE_CONNECTION_POOLING_TYPE("datanucleus.connectionPoolingType", "BONECP",
+    METASTORE_CONNECTION_POOLING_TYPE("datanucleus.connectionPoolingType", "BONECP", new
StringSet("BONECP", "DBCP",
+      "HikariCP", "NONE"),
         "Specify connection pool library for datanucleus"),
     // Workaround for DN bug on Postgres:
     // http://www.datanucleus.org/servlet/forum/viewthread_thread,7985_offset

http://git-wip-us.apache.org/repos/asf/hive/blob/4427eab3/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
----------------------------------------------------------------------
diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
index adb2c0e..ab21589 100644
--- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
+++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
@@ -1706,6 +1706,7 @@ public class QTestUtil {
       "fk_-?[0-9]*_[0-9]*_[0-9]*",
       ".*at com\\.sun\\.proxy.*",
       ".*at com\\.jolbox.*",
+      ".*at com\\.zaxxer.*",
       "org\\.apache\\.hadoop\\.hive\\.metastore\\.model\\.MConstraint@([0-9]|[a-z])*",
       "(s3.?|swift|wasb.?):\\/\\/[\\w\\.\\/-]*"
   });

http://git-wip-us.apache.org/repos/asf/hive/blob/4427eab3/metastore/pom.xml
----------------------------------------------------------------------
diff --git a/metastore/pom.xml b/metastore/pom.xml
index 7f75d4db..c1b707a 100644
--- a/metastore/pom.xml
+++ b/metastore/pom.xml
@@ -81,6 +81,11 @@
       <version>${bonecp.version}</version>
     </dependency>
     <dependency>
+      <groupId>com.zaxxer</groupId>
+      <artifactId>HikariCP</artifactId>
+      <version>${hikaricp.version}</version>
+    </dependency>
+    <dependency>
       <groupId>commons-cli</groupId>
       <artifactId>commons-cli</artifactId>
       <version>${commons-cli.version}</version>

http://git-wip-us.apache.org/repos/asf/hive/blob/4427eab3/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
index a815f2c..97d09df 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
@@ -20,6 +20,9 @@ package org.apache.hadoop.hive.metastore.txn;
 import com.google.common.annotations.VisibleForTesting;
 import com.jolbox.bonecp.BoneCPConfig;
 import com.jolbox.bonecp.BoneCPDataSource;
+import com.zaxxer.hikari.HikariConfig;
+import com.zaxxer.hikari.HikariDataSource;
+
 import org.apache.commons.dbcp.ConnectionFactory;
 import org.apache.commons.dbcp.DriverManagerConnectionFactory;
 import org.apache.commons.dbcp.PoolableConnectionFactory;
@@ -2939,6 +2942,13 @@ abstract class TxnHandler implements TxnStore, TxnStore.MutexAPI {
       PoolableConnectionFactory poolConnFactory =
           new PoolableConnectionFactory(connFactory, objectPool, null, null, false, true);
       connPool = new PoolingDataSource(objectPool);
+    } else if ("hikaricp".equals(connectionPooler)) {
+      HikariConfig config = new HikariConfig();
+      config.setJdbcUrl(driverUrl);
+      config.setUsername(user);
+      config.setPassword(passwd);
+
+      connPool = new HikariDataSource(config);
     } else if ("none".equals(connectionPooler)) {
       LOG.info("Choosing not to pool JDBC connections");
       connPool = new NoPoolConnectionPool(conf);

http://git-wip-us.apache.org/repos/asf/hive/blob/4427eab3/metastore/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandlerNegative.java
----------------------------------------------------------------------
diff --git a/metastore/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandlerNegative.java
b/metastore/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandlerNegative.java
index ddee0fb..639669e 100644
--- a/metastore/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandlerNegative.java
+++ b/metastore/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandlerNegative.java
@@ -17,13 +17,14 @@
  */
 package org.apache.hadoop.hive.metastore.txn;
 
-import org.apache.tools.ant.RuntimeConfigurable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.junit.Test;
 
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertTrue;
+
 public class TestTxnHandlerNegative {
   static final private Logger LOG = LoggerFactory.getLogger(TestTxnHandlerNegative.class);
 
@@ -44,6 +45,10 @@ public class TestTxnHandlerNegative {
       LOG.info("Expected error: " + ex.getMessage(), ex);
       e = ex;
     }
-    assert e != null && e.getMessage().contains("No suitable driver found for blah")
: "did not get exception";
+    assertNotNull(e);
+    assertTrue(
+        e.getMessage().contains("No suitable driver found for blah")
+        || e.getMessage().contains("Failed to get driver instance for jdbcUrl=blah")
+    );
   }
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/4427eab3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2e1d6ed..8c58f4c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,7 +100,7 @@
     <maven.install.plugin.version>2.4</maven.install.plugin.version>
     <maven.jar.plugin.version>2.4</maven.jar.plugin.version>
     <maven.javadoc.plugin.version>2.4</maven.javadoc.plugin.version>
-    <maven.shade.plugin.version>2.2</maven.shade.plugin.version>
+    <maven.shade.plugin.version>2.4.3</maven.shade.plugin.version>
     <maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version>
     <maven.war.plugin.version>2.4</maven.war.plugin.version>
     <maven.dependency.plugin.version>2.8</maven.dependency.plugin.version>
@@ -144,6 +144,7 @@
     <hbase.version>1.1.1</hbase.version>
     <!-- required for logging test to avoid including hbase which pulls disruptor transitively
-->
     <disruptor.version>3.3.0</disruptor.version>
+    <hikaricp.version>2.5.1</hikaricp.version>
     <!-- httpcomponents are not always in version sync -->
     <httpcomponents.client.version>4.4</httpcomponents.client.version>
     <httpcomponents.core.version>4.4</httpcomponents.core.version>
@@ -289,6 +290,11 @@
         <version>${bonecp.version}</version>
       </dependency>
       <dependency>
+        <groupId>com.zaxxer</groupId>
+        <artifactId>HikariCP</artifactId>
+        <version>${hikaricp.version}</version>
+      </dependency>
+      <dependency>
         <groupId>org.apache.parquet</groupId>
         <artifactId>parquet</artifactId>
         <version>${parquet.version}</version>


Mime
View raw message