1.这是一个系列,有兴趣的朋友可以持续关注
2.如果你有HikariCP使用上的问题,可以给我留言,我们一起沟通讨论
3.希望大家可以提供我一些案例,我也希望可以支持你们做一些调优
我认为欠妥的升级作者详细资料梳理
可能欠妥的升级
最近很多业务方找我咨询hikariCP 3.0.0的问题,比如shutdown方法没了之类,毕竟我前段时间还在研究2.6.2~2.7.8版本的源码,很感兴趣翻了一下,翻完之后发现居然升级到3.1.0版本的。
我们可以看一下changenote
HikariCP Changes
Changes in 3.1.0
Add get/setCatalog() to HikariConfigMXBean, allowing the catalog to be changed at runtime.
The catalog should only be changed while the pool is suspended, and after evicting existing
connections via HikariPoolMXBean.softEvictConnections().
Changes in 3.0.0
Removed previously deprecated methods;
HikariConfig.copyState()
HikariConfig.getScheduledExecutorService()
HikariConfig.setScheduledExecutorService()
HikariConfig.isInitializationFailFast()
HikariConfig.setInitializationFailFast()
HikariConfig.isJdbc4ConnectionTest()
HikariConfig.setJdbc4ConnectionTest()
HikariDataSource.copyState()
HikariDataSource.getScheduledExecutorService()
HikariDataSource.setScheduledExecutorService()
HikariDataSource.suspendPool()
HikariDataSource.resumePool()
HikariDataSource.shutdown()
HikariDataSource.isInitializationFailFast()
HikariDataSource.setInitializationFailFast()
HikariDataSource.isJdbc4ConnectionTest()
HikariDataSource.setJdbc4ConnectionTest()
pull 1110 add currently configured maxConnections and minConnections to pool metrics.
pull 1100 remove hard-coded percentiles for Micrometer metrics.
pull 1108 maintain a strong reference to PoolStats for Micrometer gauges to prevent premature
garbage collection.
pull 1098 update to Micrometer 1.0.0.
Changes in 2.7.8
fixed 1095 fix breakage caused by sealed configuration with respect to special handling for the
metricsRegistry and metricsTrackerFactory properties, which are allowed to be alteredonce
after the pool has started (even after the configuration is sealed).
pull 1089 allowing anonymous subclasses of MetricRegistry. Changed checks for metrics libraries
from a class name check to the assignableFrom() API.
Changes in 2.7.7
fixed issue whereby configuration through the HikariConfigMXBean could not be altered due
to the sealed configuration change introduced in 2.7.5.
Changes in 2.7.6
issue 1064 fixed regression where HikariConfig.copyStateTo() propagated the "sealed" status
of the source configuration to the target configuration -- preventing further changes.
一般来说,连续两次大版本升级,应该是比较大的改变,大版本更新只是删除了几个废弃方法,另外MXbean的鸡肋功能也升了一个中版本。连接池就是要大道至简的,我个人觉得即使作者没啥可更新的了,作为开源软件或中间件的开发最好不要这么冲动升级版本的。
作者详细资料梳理
https://twitter.com/BrettWooldridge
https://github.com/brettwooldridge
https://stackoverflow.com/users/431356/brettw
https://blog.jooq.org/2017/02/21/jooq-tuesdays-brett-wooldridge-shows-what-it-takes-to-write-the-fastest-java-connection-pool/
领取专属 10元无门槛券
私享最新 技术干货