MongoClientOptions.Builder addClusterListener(ClusterListener clusterListener)
Adds the given cluster listener.//添加给定的集群监听器

MongoClientOptions.Builder addCommandListener(CommandListener commandListener)
Adds the given command listener.//添加给定的命令监听器

MongoClientOptions.Builder addConnectionPoolListener(ConnectionPoolListener connectionPoolListener)
Adds the given connection pool listener.//添加给定的连接池侦听器。

MongoClientOptions.Builder addServerListener(ServerListener serverListener)
Adds the given server listener.//添加给定的服务器侦听器。

MongoClientOptions.Builder addServerMonitorListener(ServerMonitorListener serverMonitorListener)
Adds the given server monitor listener.//添加给定的服务器监视器侦听器。

MongoClientOptions.Builder alwaysUseMBeans(boolean alwaysUseMBeans)
Sets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is Java 6 or greater.
//设置由驱动程序注册的JMX bean是否应该始终是mbean,而不管VM是Java 6还是更大。

MongoClientOptions.Builder applicationName(String applicationName)
Sets the logical name of the application using this MongoClient.//设置MongoClient应用程序的逻辑名称。

MongoClientOptions build()
Build an instance of MongoClientOptions.//构建一个MongoClientOptions 实例

MongoClientOptions.Builder codecRegistry(CodecRegistry codecRegistry)
Sets the codec registry//设置注册表编解码器

MongoClientOptions.Builder connectionsPerHost(int connectionsPerHost)
Sets the maximum number of connections per host.//设置每个主机的最大连接数。

MongoClientOptions.Builder connectTimeout(int connectTimeout)
Sets the connection timeout.//设置连接超时。

MongoClientOptions.Builder cursorFinalizerEnabled(boolean cursorFinalizerEnabled)
Sets whether cursor finalizers are enabled.//设置是否启用游标终结器。

MongoClientOptions.Builder dbDecoderFactory(DBDecoderFactory dbDecoderFactory)
Sets the decoder factory.//设置集译码器工厂。

MongoClientOptions.Builder dbEncoderFactory(DBEncoderFactory dbEncoderFactory)
Sets the encoder factory.//设置编码器工厂。

MongoClientOptions.Builder description(String description)
Sets the description.//设置描述。

MongoClientOptions.Builder heartbeatConnectTimeout(int connectTimeout)
Sets the connect timeout for connections used for the cluster heartbeat.//为用于集群心跳的连接设置连接超时。

MongoClientOptions.Builder heartbeatFrequency(int heartbeatFrequency)
Sets the heartbeat frequency.//设置心跳频率。

MongoClientOptions.Builder heartbeatSocketTimeout(int socketTimeout)
Sets the socket timeout for connections used for the cluster heartbeat.//为用于集群心跳的连接设置套接字超时。

MongoClientOptions.Builder legacyDefaults()
Sets defaults to be what they are in MongoOptions.//设置默认设置为MongoOptions。

MongoClientOptions.Builder localThreshold(int localThreshold)
Sets the local threshold.//设置本地阈值。

MongoClientOptions.Builder maxConnectionIdleTime(int maxConnectionIdleTime)
Sets the maximum idle time for a pooled connection.//设置池连接的最大空闲时间。

MongoClientOptions.Builder maxConnectionLifeTime(int maxConnectionLifeTime)
Sets the maximum life time for a pooled connection.//设置池连接的最大生命时间。

MongoClientOptions.Builder maxWaitTime(int maxWaitTime)
Sets the maximum time that a thread will block waiting for a connection.//设置的最长时间,线程阻塞等待连接。

MongoClientOptions.Builder minConnectionsPerHost(int minConnectionsPerHost)
Sets the minimum number of connections per host.//设置每个主机的最小连接数。

MongoClientOptions.Builder minHeartbeatFrequency(int minHeartbeatFrequency)
Sets the minimum heartbeat frequency.//设置最小的心跳频率。

MongoClientOptions.Builder readConcern(ReadConcern readConcern)
Sets the read concern.

MongoClientOptions.Builder readPreference(ReadPreference readPreference)
Sets the read preference.

MongoClientOptions.Builder requiredReplicaSetName(String requiredReplicaSetName)
Sets the required replica set name for the cluster.//为集群设置所需的副本集名称。

MongoClientOptions.Builder serverSelectionTimeout(int serverSelectionTimeout)
Sets the server selection timeout in milliseconds, which defines how long the driver will wait for server selection to succeed before throwing an exception.//设置服务器选择超时以毫秒为间隔,这定义了在抛出异常之前,驱动程序等待服务器选择成功的时间。

MongoClientOptions.Builder socketFactory(SocketFactory socketFactory)
Sets the socket factory.//设置套接字工厂。

MongoClientOptions.Builder socketKeepAlive(boolean socketKeepAlive)
Deprecated. //默认为true
configuring keep-alive has been deprecated. It now defaults to true and disabling it is not recommended.

MongoClientOptions.Builder socketTimeout(int socketTimeout)
Sets the socket timeout.//设置套接字超时。

MongoClientOptions.Builder sslContext(SSLContext sslContext)
Sets the SSLContext to be used with SSL is enabled.//设置启用SSL的SSL上下文。

MongoClientOptions.Builder sslEnabled(boolean sslEnabled)
Sets whether to use SSL.//设置是否使用 SSL。

MongoClientOptions.Builder sslInvalidHostNameAllowed(boolean sslInvalidHostNameAllowed)
Define whether invalid host names should be allowed.//定义是否允许使用无效的主机名。

MongoClientOptions.Builder threadsAllowedToBlockForConnectionMultiplier(int threadsAllowedToBlockForConnectionMultiplier)
Sets the multiplier for number of threads allowed to block waiting for a connection.//设置允许阻塞等待连接的线程数量的倍数。

MongoClientOptions.Builder writeConcern(WriteConcern writeConcern)
Sets the write concern.

常用配置信息:

MongoClientOptions.Builder connectionsPerHost(int connectionsPerHost)
Sets the maximum number of connections per host.//设置每个主机的最大连接数。

MongoClientOptions.Builder connectTimeout(int connectTimeout)
Sets the connection timeout.//设置连接超时。

MongoClientOptions.Builder maxConnectionIdleTime(int maxConnectionIdleTime)
Sets the maximum idle time for a pooled connection.//设置池连接的最大空闲时间。

MongoClientOptions.Builder maxConnectionLifeTime(int maxConnectionLifeTime)
Sets the maximum life time for a pooled connection.//设置池连接的最大生命时间。

MongoClientOptions.Builder maxWaitTime(int maxWaitTime)
Sets the maximum time that a thread will block waiting for a connection.//设置的最长时间,线程阻塞等待连接。

MongoClientOptions.Builder minConnectionsPerHost(int minConnectionsPerHost)
Sets the minimum number of connections per host.//设置每个主机的最小连接数。

MongoClientOptions.Builder socketTimeout(int socketTimeout)
Sets the socket timeout.//设置套接字超时。

MongoClientOptions.Builder threadsAllowedToBlockForConnectionMultiplier(int threadsAllowedToBlockForConnectionMultiplier)
Sets the multiplier for number of threads allowed to block waiting for a connection.//设置允许阻塞等待连接的线程数量的倍数。

MngoDb MongoClientOptions 配置信息及常用配置信息的更多相关文章

  1. SpringMVC常用配置(二),最简洁的配置实现文件上传

    Spring.SpringMVC持续介绍中,基础配置前面已经介绍了很多,如果小伙伴们还不熟悉可以参考这几篇文章: 1.Spring基础配置 2.Spring常用配置 3.Spring常用配置(二) 4 ...

  2. httpd常用配置之虚拟主机

    httpd常用配置 目录 httpd常用配置 虚拟主机: 相同IP不同端口 不同IP相同端口 相同IP相同端口不同域名 切换使用MPM(编辑/etc/httpd/conf.modules.d/00-m ...

  3. 玩玩微信公众号Java版之一:配置微信公众平台服务器信息

    在进行微信公众平台开发前,前先做好准备工作,好了以后,我们可以开始啦!   第一.准备好服务端接口   定义一个http服务接口,主要分为如下几步:   1.创建一个servlet类,用来接收请求: ...

  4. 错误:该表单无法显示,可能是由于 Microsoft SharePoint Server State Service 配置不当。有关详细信息,请与服务器管理员联系

    问题场景: 1.SharePoint 2013 中工作流需要状态服务(State Service),如果没有正确配置状态服务,则在给列表.文档库添加工作流时会遇到错误: “该表单无法显示,可能是由于 ...

  5. Android之——JNI配置C语言打印Logcat信息

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/47425073 这篇文章给大家介绍一下在JNI中怎样为C语言配置打印Logcat信息 ...

  6. 微信通过openID发送消息/后台post、get提交并接收数据 C# .NET 配置404,500等错误信息 连接字符串

    微信通过openID发送消息/后台post.get提交并接收数据   控制器:下面是post发送消息(微信不支持从前台发送数据,之前试过,报错,需要跨域,跨域的问题解决后还不行,最后发现之后后端提交 ...

  7. zookeeper作配置中心(存储支付信息)

    zookeeper作配置中心(存储敏感信息) 前提:最近在项目中需要用到支付接口,支付宝或者微信支付,根据官方文档,需要配置一些诸如notify-url或者app-private-key等信息,这些信 ...

  8. 【Git】3、创建Git版本库、配置Git仓库用户邮箱信息

    初识Git 文章目录 初识Git 1.创建Git版本库 认识.git 2.基础配置 2.1.查看配置信息 2.2.配置昵称邮箱信息 2.3.修改配置信息 1.通过命令行 2.通过修改配置文件. 修改全 ...

  9. logback 常用配置详解<appender>

    logback 常用配置详解 <appender> <appender>: <appender>是<configuration>的子节点,是负责写日志的 ...

随机推荐

  1. 在IDEA下导入Maven项目之后 Dependencies报红线

    在IDEA中导入新的Maven项目之后,许多jar包出现波浪线的情况,在网上搜了很多办法都不管,什么直接删掉pom文件中的依赖,保存之后,刷新再ctrl+z 撤回 问题就消失了, 还有的说,你可以直接 ...

  2. Asp.net Zero 应用实战-官方示例PhoneBook学习1_修改1版

    适用Zero版本:ASP.NET Core & Angular 2+ (aspnet-zero-core-3.1.0). 该版本官方有两个solution文件夹:Angular(前端) 和 a ...

  3. Alpha冲刺四

    第四天    日期:2018/6/19 1.1 今日完成任务情况以及遇到的问题. 成员 汝春瑞.曹  阳 赵红波.梁玉龙 傅  康.丁炜轩 今日完成任务 设计餐厅每个店家的餐品界面 完成公告和失物招领 ...

  4. Java实现产生一个int数组,长度为100,并向其中随机插入1-100,并且不能重复。

    public static void main(String[] args){ //创建一个int数组,长度为100, int n = 100; int[] arrayInt = new int[n] ...

  5. HDU-6060 RXD and dividing

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6060   多校的题目,每次只能写两道SB题,剩下的要么想不到,要么想到了,代码不知道怎么实现,还是写的 ...

  6. vue 导航守卫,验证是否登录

    路由跳转前,可以用导航守卫判断是否登录,如果登录了就正常跳转,没有登录就把路由指向登录页面. router.beforeEach((to, from, next) => { const next ...

  7. tensorflow学习之(八)使用dropout解决overfitting(过拟合)问题

    #使用dropout解决overfitting(过拟合)问题 #如果有dropout,在feed_dict的参数中一定要加入dropout的值 import tensorflow as tf from ...

  8. 20175316盛茂淞 2018-2019-2 《Java程序设计》第7周学习总结

    20175316盛茂淞 2018-2019-2 <Java程序设计>第7周学习总结 教材学习内容总结 第八章 常用实用类 一.String类 String类在java.lang包中,jav ...

  9. Unity3D编辑器扩展(六)——模态窗口

    前面我们已经写了5篇关于编辑器的,这是第六篇,也是最后一篇: Unity3D编辑器扩展(一)——定义自己的菜单按钮 Unity3D编辑器扩展(二)——定义自己的窗口 Unity3D编辑器扩展(三)—— ...

  10. 关闭iptables服务及命令行连接wifi及locale设置

    Ubuntu系统启动时都会自动启动iptables服务.如果想关闭该服务的自动启动,可以执行: sudo ufw disable 命令行方式连接某个SSID: sudo nmcli d wifi co ...