ShardedJedisPool详解
来源:互联网 发布:mac版flashcs6汉化包 编辑:程序博客网 时间:2024/06/05 03:43
ShardedJedisPool类有四个构造函数
public ShardedJedisPool(final GenericObjectPoolConfig poolConfig, List<JedisShardInfo> shards) { this(poolConfig, shards, Hashing.MURMUR_HASH); } public ShardedJedisPool(final GenericObjectPoolConfig poolConfig, List<JedisShardInfo> shards, Hashing algo) { this(poolConfig, shards, algo, null); } public ShardedJedisPool(final GenericObjectPoolConfig poolConfig, List<JedisShardInfo> shards, Pattern keyTagPattern) { this(poolConfig, shards, Hashing.MURMUR_HASH, keyTagPattern); } public ShardedJedisPool(final GenericObjectPoolConfig poolConfig, List<JedisShardInfo> shards, Hashing algo, Pattern keyTagPattern) { super(poolConfig, new ShardedJedisFactory(shards, algo, keyTagPattern)); }
其实,最后都是调用父类的构造函数
super(poolConfig, new ShardedJedisFactory(shards, algo, keyTagPattern));
输入参数说明:
final GenericObjectPoolConfig poolConfig:pool的一些设置(maxTotal、maxIdle、minIdle)List<JedisShardInfo> shards:为Redis实例的IP、端口以及超时时间等信息Hashing algo:根据Key计算hash值,从而决定具体存入那个Redis实例Pattern keyTagPattern:Key标签模式,默认是取{}中内容去计算对应Hash值,当key='{key1_0}_0_0'时,**此时将根据’key1_0'来计算对应hash值,而不是根据{key1_0}_0_0来计算hash值**,从而决定将存入到哪个Redis实例中,如果需要将数据进行排序,将要利用这个构造函数,因为只有将需要排序的数据存入同一个Redis实例中,排序才是准确的。
0 0
- ShardedJedisPool详解
- ShardedJedisPool
- shardedjedispool使用
- ShardedJedisPool的使用
- ShardedJedisPool的使用
- 【redis、jedis】使用ShardedJedisPool异常
- redis客户端-redis.clients.jedis.ShardedJedisPool
- ShardedJedisPool的连接池参数如何设置
- jedis分布式之 ShardedJedisPool (一致性Hash分片算法)
- 客户端分片使用ShardedJedisPool,设置DB和超时时间
- 使用jedis的JedisCluster做服务端集群,ShardedJedisPool做客户端分片
- redis-系列之一JedisPool(非切片链接池)和ShardedJedisPool(切片链接池)有什么区别
- spring与redis整合(一)--采用原生的jedis(ShardedJedisPool)
- 【Redis】spring-data-redis与JedisPool的区别、使用ShardedJedisPool与spring集成的实现及一致性哈希分析
- spring-data-redis与JedisPool的区别、使用ShardedJedisPool与spring集成的实现及一致性哈希分析
- 分布式缓存技术redis学习系列(五)——spring-data-redis与JedisPool的区别、使用ShardedJedisPool与spring集成的实现及一致性哈希分析
- 分布式缓存技术redis学习系列(五)——spring-data-redis与JedisPool的区别、使用ShardedJedisPool与spring集成的实现及一致性哈希分析
- 分布式缓存技术redis学习系列(五)——spring-data-redis与JedisPool的区别、使用ShardedJedisPool与spring集成的实现及一致性哈希分析
- cocos2d-js-----Uncaught TypeError: Cannot read property 'style' of null
- [leetcode 252] Meeting Rooms
- LeetCode 095 Unique Binary Search Trees II
- C/C++ 之 char*,const char*和string 三者转换
- JDBC核心类
- ShardedJedisPool详解
- spring MVC项目中,欢迎页首页根路径到底是怎么设置的
- 设计之路:如何进行软件需求分析?
- Install plantuml on Mac OSX
- Linux基础学习笔记一
- Jpush使用总结
- HDU 1251 (统计难题) 字典树模板&&map实现
- spring事务(Transaction )报 marked as rollback-only异常的原因及解决方法
- hadoop学习笔记之<Call From localhost/127.0.0.1 to localhost:9000 failed...>