Elffuss BraidHub

kikocis/java-driver public

Change PoolingOptions defaults to have fixed-size pools.
Changeset2f7ab0de2ec4b0684bcc1de3a90a0da7937dec5bd3dd1b23d5c1435df53e81d7
Authorolim7t <omichallat+github@gmail.com> · 2014-12-22 11:30 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2014-12-22 22:50 +01:00
Parentsdef037affef4

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java +18 −2
@@ -37,6 +37,12 @@
3737 * Each of these parameters can be separately set for {@code LOCAL} and
3838 * {@code REMOTE} hosts ({@link HostDistance}). For {@code IGNORED} hosts,
3939 * the default for all those settings is 0 and cannot be changed.
40+ * <p>
41+ * Due to known issues with the current pool implementation (see
42+ * <a href="https://datastax-oss.atlassian.net/browse/JAVA-419">JAVA-419</a>),
43+ * it is <b>strongly recommended</b> to use a fixed-size pool (core connections =
44+ * max connections).
45+ * The default values respect this (8 for local hosts, 2 for remote hosts).
4046 */
4147 public class PoolingOptions {
4248
@@ -45,8 +51,8 @@
4551 private static final int DEFAULT_MIN_REQUESTS = 25;
4652 private static final int DEFAULT_MAX_REQUESTS = 100;
4753
48- private static final int DEFAULT_CORE_POOL_LOCAL = 2;
49- private static final int DEFAULT_CORE_POOL_REMOTE = 1;
54+ private static final int DEFAULT_CORE_POOL_LOCAL = 8;
55+ private static final int DEFAULT_CORE_POOL_REMOTE = 2;
5056
5157 private static final int DEFAULT_MAX_POOL_LOCAL = 8;
5258 private static final int DEFAULT_MAX_POOL_REMOTE = 2;
@@ -169,6 +175,11 @@
169175
170176 /**
171177 * Sets the core number of connections per host.
178+ * <p>
179+ * Due to known issues with the current pool implementation (see
180+ * <a href="https://datastax-oss.atlassian.net/browse/JAVA-419">JAVA-419</a>),
181+ * it is <b>strongly recommended</b> to use a fixed-size pool (core connections =
182+ * max connections).
172183 *
173184 * @param distance the {@code HostDistance} for which to set this threshold.
174185 * @param newCoreConnections the value to set
@@ -204,6 +215,11 @@
204215
205216 /**
206217 * Sets the maximum number of connections per host.
218+ * <p>
219+ * Due to known issues with the current pool implementation (see
220+ * <a href="https://datastax-oss.atlassian.net/browse/JAVA-419">JAVA-419</a>),
221+ * it is <b>strongly recommended</b> to use a fixed-size pool (core connections =
222+ * max connections).
207223 *
208224 * @param distance the {@code HostDistance} for which to set this threshold.
209225 * @param newMaxConnections the value to set