JAMES-2318 Expose Cassandra PoolingOptions::setMaxQueueSize

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/fe5d53c4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/fe5d53c4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/fe5d53c4

Branch: refs/heads/master
Commit: fe5d53c474c2696aef408b6ec9243119054cecef
Parents: a5e3479
Author: matzepan <mat...@gmail.com>
Authored: Sat Oct 20 15:23:46 2018 +0200
Committer: Benoit Tellier <btell...@linagora.com>
Committed: Wed Oct 24 16:38:54 2018 +0700

----------------------------------------------------------------------
 .../init/configuration/ClusterConfiguration.java   |  5 ++++-
 .../destination/conf/cassandra.properties          |  1 +
 src/site/xdoc/server/config-cassandra.xml          | 17 +++++++++++------
 3 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/fe5d53c4/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
----------------------------------------------------------------------
diff --git 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
index e8fcc15..2db6f7e 100644
--- 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
+++ 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
@@ -204,11 +204,13 @@ public class ClusterConfiguration {
         Optional<Integer> maxRequests = 
Optional.ofNullable(configuration.getInteger("cassandra.pooling.local.max.requests",
 null));
         Optional<Integer> poolingTimeout = 
Optional.ofNullable(configuration.getInteger("cassandra.pooling.timeout", 
null));
         Optional<Integer> heartbeatTimeout = 
Optional.ofNullable(configuration.getInteger("cassandra.pooling.heartbeat.timeout",
 null));
+        Optional<Integer> maxQueueSize = 
Optional.ofNullable(configuration.getInteger("cassandra.pooling.max.queue.size",
 null));
 
         if (!maxConnections.isPresent()
             && !maxRequests.isPresent()
             && !poolingTimeout.isPresent()
-            && !heartbeatTimeout.isPresent()) {
+            && !heartbeatTimeout.isPresent()
+            && !maxQueueSize.isPresent()) {
             return Optional.empty();
         }
         PoolingOptions result = new PoolingOptions();
@@ -223,6 +225,7 @@ public class ClusterConfiguration {
         });
         poolingTimeout.ifPresent(result::setPoolTimeoutMillis);
         heartbeatTimeout.ifPresent(result::setHeartbeatIntervalSeconds);
+        maxQueueSize.ifPresent(result::setMaxQueueSize);
 
         return Optional.of(result);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/fe5d53c4/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties
----------------------------------------------------------------------
diff --git 
a/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties 
b/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties
index afc5915..27ef4a8 100644
--- a/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties
+++ b/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties
@@ -14,6 +14,7 @@ cassandra.retryConnection.minDelay=5000
 # cassandra.pooling.timeout=5000
 ## In seconds.
 # cassandra.pooling.heartbeat.timeout=30
+# cassandra.pooling.max.queue.size=256
 
 ## These low level tuning options controls performance related options in 
Cassandra related code
 ## The default values are documented here. Understand the effects before 
editing.

http://git-wip-us.apache.org/repos/asf/james-project/blob/fe5d53c4/src/site/xdoc/server/config-cassandra.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/server/config-cassandra.xml 
b/src/site/xdoc/server/config-cassandra.xml
index 142a3f4..292681e 100644
--- a/src/site/xdoc/server/config-cassandra.xml
+++ b/src/site/xdoc/server/config-cassandra.xml
@@ -65,7 +65,7 @@
 
         <dt><strong>cassandra.readTimeoutMillis</strong></dt>
         <dd>Optional.
-          If specified defines the Cassandra <a 
href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/socket_options/";>driver
 read timeout</a></dd>
+          If specified defines the Cassandra <a 
href="https://docs.datastax.com/en/developer/java-driver/3.5/manual/socket_options/";>driver
 read timeout</a>.</dd>
 
         # Read com.datastax.driver.core.PoolingOptions for knowing defaults 
value
         # No value here will default to driver's default value
@@ -76,22 +76,27 @@
         # cassandra.pooling.timeout=5000
         ## In seconds.
         # cassandra.pooling.heartbeat.timeout=30
+        # cassandra.pooling.max.queue.size=256
 
         <dt><strong>cassandra.pooling.local.max.connections</strong></dt>
         <dd>Optional.
-          If specified defines the Cassandra <a 
href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/pooling/";>maximum
 number of connections to hosts</a> (remote and local)</dd>
+          If specified defines the Cassandra <a 
href="https://docs.datastax.com/en/developer/java-driver/3.5/manual/pooling/";>maximum
 number of connections to hosts</a> (remote and local).</dd>
 
         <dt><strong>cassandra.pooling.local.max.requests</strong></dt>
         <dd>Optional.
-          If specified defines the Cassandra <a 
href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/pooling/";>maximum
 number of concurrent requests per connection</a></dd>
+          If specified defines the Cassandra <a 
href="https://docs.datastax.com/en/developer/java-driver/3.5/manual/pooling/";>maximum
 number of concurrent requests per connection</a>.</dd>
 
         <dt><strong>cassandra.pooling.timeout</strong></dt>
         <dd>Optional.
-          If specified defines the Cassandra <a 
href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/pooling/";>Specify
 timeout while not locationg pool</a>. Should be higher than sockets 
timeout.</dd>
+          If specified defines the Cassandra <a 
href="https://docs.datastax.com/en/developer/java-driver/3.5/manual/pooling/#acquisition-queue";>timeout
 for waiting in the pool queue</a>. Should be higher than sockets timeout.</dd>
 
         <dt><strong>cassandra.pooling.heartbeat.timeout</strong></dt>
         <dd>Optional.
-          If specified defines the Cassandra <a 
href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/pooling/";>Specify
 heartbeat timeout</a></dd>
+          If specified defines the Cassandra <a 
href="https://docs.datastax.com/en/developer/java-driver/3.5/manual/pooling/#heartbeat";>heartbeat
 timeout</a>.</dd>
+
+        <dt><strong>cassandra.pooling.max.queue.size</strong></dt>
+        <dd>Optional.
+          If specified defines the Cassandra <a 
href="https://docs.datastax.com/en/developer/java-driver/3.5/manual/pooling/#acquisition-queue";>maximum
 size of the connection pool queue</a>.</dd>
 
         <dt><strong>mailbox.max.retry.acl</strong></dt>
         <dd>Optional. Defaults to 1000.<br/> Controls the number of retries 
upon Cassandra ACL updates.</dd>
@@ -183,7 +188,7 @@
         <dt><strong>attachment.v2.migration.read.timeout</strong></dt>
         <dd>Optional. Defaults to one day.<br/> Controls how many milliseconds 
before the read on attachment v1 time out.</dd>
       </dl>
-      
+
     </subsection>
 
     <subsection name="From V4 to V5">


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to