Spring集成Redis实例入门
ShardedJedis实现分析
ShardedJedis是基于一致性哈希算法实现的分布式Redis集群客户端;ShardedJedis的设计分为以下几块:
1.对象池设计:Pool,ShardedJedisPool,ShardedJedisFactory
2.面向用户的操作封装:BinaryShardedJedis,BinaryShardedJedis
3.一致性哈希实现:Sharded
关于ShardedJedis设计,忽略了Jedis的设计细节,设计类图如下:
代码实现:
model对象:
package com.duobei.memcached.model;
import java.io.Serializable;
public class User implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String pass;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
}
相关推荐
聚合室 2020-11-16
零 2020-09-18
afanti 2020-09-16
Lzs 2020-10-23
Justhavefun 2020-10-22
jacktangj 2020-10-14
ChaITSimpleLove 2020-10-06
Andrea0 2020-09-18
周游列国之仕子 2020-09-15
88234852 2020-09-15
YClimb 2020-09-15
风雨断肠人 2020-09-04
卖口粥湛蓝的天空 2020-09-15
stulen 2020-09-15
pythonxuexi 2020-09-06
abfdada 2020-08-26
梦的天空 2020-08-25