You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2020/07/08 07:46:08 UTC
[GitHub] [zeppelin] zjffdu commented on a change in pull request #3844: [ZEPPELIN-4941]. added support for personalized configuration of JDBCInterpreter database connection pool
zjffdu commented on a change in pull request #3844:
URL: https://github.com/apache/zeppelin/pull/3844#discussion_r451347630
##########
File path: docs/interpreter/jdbc.md
##########
@@ -156,6 +156,25 @@ The last step is **Dependency Setting**. Since Zeppelin only includes `PostgreSQ
That's it. You can find more JDBC connection setting examples([Mysql](#mysql), [MariaDB](#mariadb), [Redshift](#redshift), [Apache Hive](#apache-hive), [Apache Phoenix](#apache-phoenix), and [Apache Tajo](#apache-tajo)) in [this section](#examples).
+## JDBC Interpreter Datasource Pool Configuration
+The Jdbc interpreter uses the connection pool technology, and supports users to do some personal configuration of the connection pool. For example, we can configure `default.validationQuery='select 1'` and `default.testOnBorrow=true` in the Interpreter configuration to avoid the "Invalid SessionHandle" runtime error caused by Session timeout when connecting to HiveServer2 through JDBC interpreter.
+
+The Jdbc Interpreter supports the following database connection pool configurations:
+
+| Property Name | Default | Description |
+|----------------------------------------------------------------------------------------------------------------------------------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| testOnBorrow | false | The indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another. |
+| testOnCreate | false | The indication of whether objects will be validated after creation. If the object fails to validate, the borrow attempt that triggered the object creation will fail. |
+| testOnReturn | false | The indication of whether objects will be validated before being returned to the pool. |
+| testWhileIdle | false | The indication of whether objects will be validated by the idle object evictor (if any). If an object fails to validate, it will be dropped from the pool. |
+| timeBetweenEvictionRunsMillis | -1L | The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run. |
+| maxWaitMillis | -lL | The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely. |
+| maxIdle | 8 | The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit. |
+| minIdle | 0 | The minimum number of connections that can remain idle in the pool, without extra ones being created, or zero to create none. |
+| maxTotal | -1 | The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. |
+| validationQuery | show database | The SQL query that will be used to validate connections from this pool before returning them to the caller. If specified, this query MUST be an SQL SELECT statement that returns at least one row. If not specified, connections will be validation by calling the isValid() method. |
+
+
Review comment:
You can use html table to render this. Here's one example of spark interpreter.
https://github.com/apache/zeppelin/blob/master/docs/interpreter/spark.md
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org