[JAVA-1516] Improve the documentation to define the MongoClientOptions.Builder method parameters Created: 24/Oct/14  Updated: 10/Oct/22  Resolved: 10/Oct/22

Status: Closed
Project: Java Driver
Component/s: Documentation
Affects Version/s: 0.8
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Anil Kumar Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

The current API does not provide much detail about the parameters that can be set on the MongoOptions. i.e. I see a few of these:

  • some of the time parameters are missing the units
  • some parameter are not very clear on what behaviour it would result in i.e. minConnectionsPerHost or connectionsPerHost.


 Comments   
Comment by Jeffrey Yemin [ 10/Oct/22 ]

MongoClientOptions is effectively deprecated in favor of MongoClientSettings

Comment by Anil Kumar [ 27/Oct/14 ]

My bad, I just forgot where I was seeing the issue. I believe this is for the get part. Most of the people when setting up a MongoClientOptions will really be looking at MongoClientOptions.Builder documentation (and that is what I was doing as well) which looks skinny compared to this as well as missing some of the time-units.

  1. Also it may be worthwhile to specify some of the behaviour i.e. minConnectionsPerHost will create these connections to each host of the replica-set. It was not very clear as how this differs in behaviour when compared to normal scaling of connectionsPerHost.
  2. It may be also be useful to define the relationship between some of these dependent range values as to how these will behave if say minConnectionsPerHost >= connectionsPerHost.
Comment by Jeffrey Yemin [ 24/Oct/14 ]

Can you be more specific about connectionsPerHost/minConnectionsPerHost? What's not clear about:

    /**
     * The minimum number of connections per host for this MongoClient instance. Those connections will be kept in a pool when idle, and the
     * pool will ensure over time that it contains at least this minimum number.
     * <p/>
     * Default is 0.
     *
     * @return the minimum size of the connection pool per host
     * @since 2.12
     */
    public int getMinConnectionsPerHost() {
        return minConnectionsPerHost;
    }
 
    /**
     * The maximum number of connections allowed per host for this MongoClient instance.
     * Those connections will be kept in a pool when idle.
     * Once the pool is exhausted, any operation requiring a connection will block waiting for an available connection.
     * <p/>
     * Default is 100.
     *
     * @return the maximum size of the connection pool per host
     * @see MongoClientOptions#getThreadsAllowedToBlockForConnectionMultiplier()
     */
    public int getConnectionsPerHost() {
        return connectionsPerHost;
    }
 

Generated at Thu Feb 08 08:54:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.