You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jc...@apache.org on 2018/11/21 21:51:10 UTC

[geode] branch develop updated: Update javadocs for data-source pool classes (#2870)

This is an automated email from the ASF dual-hosted git repository.

jchen21 pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5f53d53  Update javadocs for data-source pool classes (#2870)
5f53d53 is described below

commit 5f53d53b327d9e006632b07350e012f557135395
Author: Scott Jewell <db...@yahoo.com>
AuthorDate: Wed Nov 21 13:51:01 2018 -0800

    Update javadocs for data-source pool classes (#2870)
    
    Also fix parameter name in CreateDataSourceCommand
---
 .../jdbc/JdbcPooledDataSourceFactory.java          | 23 ++++++++++++++++++++--
 .../jdbc/internal/cli/CreateDataSourceCommand.java |  5 ++---
 .../geode/datasource/PooledDataSourceFactory.java  | 18 +++++++++++------
 3 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcPooledDataSourceFactory.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcPooledDataSourceFactory.java
index bf46006..7d784ec 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcPooledDataSourceFactory.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcPooledDataSourceFactory.java
@@ -27,8 +27,27 @@ import org.apache.geode.datasource.PooledDataSourceFactory;
 
 /**
  * This class implements PooledDataSourceFactory for the JDBC Connector extension.
- * It will be used by default for a jndi-binding of type "POOLED".
- * For more information see "gfsh create jndi-binding".
+ * It will be used by default for a data-source with type "POOLED" specified when using
+ * the "gfsh create data-source" command.
+ * <p>
+ * The connection pooling is provided by Hikari, a high-performance JDBC connection pool.
+ * <br>
+ * The following data-source parameters will be will be passed to Hikari as the following:
+ * <br>
+ * connection-url --> jdbcUrl<br>
+ * jdbc-driver-class --> driverClassName<br>
+ * user-name --> username<br>
+ * password --> password<br>
+ * max-pool-size --> maximumPoolSize<br>
+ * idle-timeout-seconds --> idleTimeout<br>
+ * <p>
+ * Additional Hikari configuration parameters may be passed to configure the Hikari pool
+ * by specifying them using the --pool-properties of the "gfsh create data-source" command.
+ * <p>
+ * For more information see the "gfsh create data-source" command.
+ * <br>
+ * Additional Hikari options are described at
+ * https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
  */
 public class JdbcPooledDataSourceFactory implements PooledDataSourceFactory {
 
diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateDataSourceCommand.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateDataSourceCommand.java
index c0c94b7..17293d3 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateDataSourceCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateDataSourceCommand.java
@@ -67,10 +67,9 @@ public class CreateDataSourceCommand extends SingleGfshCommand {
       "Skip the create operation when a data source with the same name already exists.  Without specifying this option, this command execution results into an error.";
   static final String POOL_PROPERTIES = "pool-properties";
   static final String POOL_PROPERTIES_HELP =
-      "Properties for a pooled data source. Only valid if --pooled. These properties will be used to configure the database data source unless the name begins with \"pool.\"."
-          + " If that prefix is used it will be used to configure the pool data source."
+      "Used to configure pool properties of a pooled data source . Only valid if --pooled is specified."
           + "The value is a comma separated list of json strings. Each json string contains a name and value. "
-          + "For example: --properties={'name':'name1','value':'value1'},{'name':'name2','value':'value2'}";
+          + "For example: --pool-properties={'name':'name1','value':'value1'},{'name':'name2','value':'value2'}";
 
   @CliCommand(value = CREATE_DATA_SOURCE, help = CREATE_DATA_SOURCE__HELP)
   @CliMetaData(relatedTopic = CliStrings.DEFAULT_TOPIC_GEODE,
diff --git a/geode-core/src/main/java/org/apache/geode/datasource/PooledDataSourceFactory.java b/geode-core/src/main/java/org/apache/geode/datasource/PooledDataSourceFactory.java
index 0f8a2dd..a093e8a 100644
--- a/geode-core/src/main/java/org/apache/geode/datasource/PooledDataSourceFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/datasource/PooledDataSourceFactory.java
@@ -23,9 +23,12 @@ import javax.sql.DataSource;
 import org.apache.geode.annotations.Experimental;
 
 /**
- * Classes that implement this interface can be used as the class name
- * specified in the jndi-binding "conn-pooled-datasource-class" when the
- * jndi-binding type is "POOLED". For more information see "gfsh create jndi-binding".
+ * Classes that implement this interface can be used as the class name specified
+ * in the "gfsh create data-source --pooled-data-source-factory-class" parameter.
+ * <br>
+ * This parameter is only valid when the data-source type is "POOLED".
+ * <br>
+ * For more information see "gfsh create data-source".
  * <p>
  * Note: implementors of this interface must also implement a zero-arg constructor.
  */
@@ -38,12 +41,15 @@ public interface PooledDataSourceFactory {
    * or the jndi-binding is removed, then also implement {@link AutoCloseable}.
    *
    * @param poolProperties properties to use to initialize the pool part of the data source
-   *        The poolProperties names can be any of the following: connection-url, user-name,
-   *        password, jdbc-driver-class, max-pool-size, init-pool-size, idle-timeout-seconds,
+   *        The poolProperties names can be any of the following:
+   *        <br>
+   *        connection-url, user-name, password, jdbc-driver-class,
+   *        max-pool-size, init-pool-size, idle-timeout-seconds,
    *        login-timeout-seconds, or blocking-timeout-seconds.
-   *
+   *        <p>
    * @param dataSourceProperties properties to use to initialize the data source the pool will use
    *        to create connections
+   *        <p>
    * @return the created data source
    */
   public DataSource createDataSource(Properties poolProperties, Properties dataSourceProperties);