Skip to content

Commit d3ea5fa

Browse files
committed
Deprecate connection pool wait queue-related classes and properties.
The connection pooling specification calls for removal of limits on the wait queue size, and does not define wait queue-related events, so we plan to remove events and settings related to the connection pool wait queue in the next major release. JAVA-3460
1 parent bfc32c2 commit d3ea5fa

File tree

7 files changed

+20
-0
lines changed

7 files changed

+20
-0
lines changed

driver-core/src/main/com/mongodb/MongoWaitQueueFullException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
*
2222
* @see com.mongodb.connection.ConnectionPoolSettings#getMaxWaitQueueSize()
2323
* @since 3.0
24+
* @deprecated In the next major release the limit on wait queue size will be removed, so this exception will no longer be thrown
2425
*/
26+
@Deprecated
2527
public class MongoWaitQueueFullException extends MongoClientException {
2628

2729
private static final long serialVersionUID = 1482094507852255793L;

driver-core/src/main/com/mongodb/connection/ClusterSettings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ public Builder serverSelectionTimeout(final long serverSelectionTimeout, final T
261261
*
262262
* @param maxWaitQueueSize the number of threads that are allowed to be waiting for a connection.
263263
* @return this
264+
* @deprecated in the next major release, wait queue size limitations will be removed
264265
*/
266+
@Deprecated
265267
public Builder maxWaitQueueSize(final int maxWaitQueueSize) {
266268
this.maxWaitQueueSize = maxWaitQueueSize;
267269
return this;
@@ -476,7 +478,9 @@ public long getLocalThreshold(final TimeUnit timeUnit) {
476478
* <p>Default is 500.</p>
477479
*
478480
* @return the number of threads that are allowed to be waiting for a connection.
481+
* @deprecated in the next major release, wait queue size limitations will be removed
479482
*/
483+
@Deprecated
480484
public int getMaxWaitQueueSize() {
481485
return maxWaitQueueSize;
482486
}

driver-core/src/main/com/mongodb/connection/ConnectionPoolSettings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ public Builder minSize(final int minSize) {
145145
*
146146
* @param maxWaitQueueSize the number of threads that are allowed to be waiting for a connection.
147147
* @return this
148+
* @deprecated in the next major release, wait queue size limitations will be removed
148149
*/
150+
@Deprecated
149151
public Builder maxWaitQueueSize(final int maxWaitQueueSize) {
150152
this.maxWaitQueueSize = maxWaitQueueSize;
151153
return this;
@@ -308,7 +310,9 @@ public int getMinSize() {
308310
* <p>Default is 500.</p>
309311
*
310312
* @return the number of threads that are allowed to be waiting for a connection.
313+
* @deprecated in the next major release, wait queue size limitations will be removed
311314
*/
315+
@Deprecated
312316
public int getMaxWaitQueueSize() {
313317
return maxWaitQueueSize;
314318
}

driver-core/src/main/com/mongodb/event/ConnectionPoolListener.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,18 @@ public interface ConnectionPoolListener extends EventListener {
5656
* Invoked when a connection pool's wait queue is entered.
5757
*
5858
* @param event the event
59+
* @deprecated In the next major release, this event will no longer be published
5960
*/
61+
@Deprecated
6062
void waitQueueEntered(ConnectionPoolWaitQueueEnteredEvent event);
6163

6264
/**
6365
* Invoked when a connection pools wait queue is exited.
6466
*
6567
* @param event the event
68+
* @deprecated In the next major release, this event will no longer be published
6669
*/
70+
@Deprecated
6771
void waitQueueExited(ConnectionPoolWaitQueueExitedEvent event);
6872

6973
/**

driver-core/src/main/com/mongodb/event/ConnectionPoolWaitQueueEnteredEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
* An event for entering the wait queue of the connection pool.
2323
*
2424
* @since 3.5
25+
* @deprecated In the next major release, this event will no longer be published
2526
*/
27+
@Deprecated
2628
public final class ConnectionPoolWaitQueueEnteredEvent {
2729
private final ServerId serverId;
2830

driver-core/src/main/com/mongodb/event/ConnectionPoolWaitQueueExitedEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
* An event for entering the wait queue of the connection pool.
2323
*
2424
* @since 3.5
25+
* @deprecated In the next major release, this event will no longer be published
2526
*/
27+
@Deprecated
2628
public final class ConnectionPoolWaitQueueExitedEvent {
2729
private final ServerId serverId;
2830

driver-core/src/main/com/mongodb/management/ConnectionPoolStatisticsMBean.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public interface ConnectionPoolStatisticsMBean {
7171
* Gets the size of the wait queue for a connection from this pool. *
7272
*
7373
* @return size of the wait queue
74+
* @deprecated In the next major release, wait queue events will no longer be published so this statistic will be unavailable
7475
*/
76+
@Deprecated
7577
int getWaitQueueSize();
7678
}

0 commit comments

Comments
 (0)