redis 批量查询数据和批量查询优化
- 2020-04-25 20:34:00
- admin 原创
- 7311
redis 批量查询数据
public List<String> get(List<String> keys){
return redisTemplate.opsForValue.muliGet(keys)
}
reids管道
public List<Object> batchGet(List<String> keys){
List<Object> result=redisTemplate.executePipelined(
new RedisCallback<String>{
public String doInRedis(RedisConnection connection) throws Exception
StringRedisConnection src=(StringRedisConnection )connection;
for(String key:keys){
src.get(key);
}
return null;
}
)
return result;
}
发表评论
文章分类
联系方式
联系人: | 郑州-小万 |
---|---|
电话: | 13803993919 |
Email: | 1027060531@qq.com |
QQ: | 1027060531 |
网址: | www.wanhejia.com |
Update Required
To play the media you will need to either update your browser to a recent version or update your Flash plugin.