ShardedJedisPool是如何选择对应的库的?
答案:1 悬赏:10 手机版
解决时间 2021-03-18 21:09
- 提问者网友:放下
- 2021-03-18 02:38
ShardedJedisPool是如何选择对应的库的?
最佳答案
- 五星知识达人网友:几近狂妄
- 2021-03-18 03:14
Collection collection=shardedJedis.getAllShards();
Iterator jedis = collection.iterator();
while(jedis.hasNext()){
jedis.next().select(redisIndex);
}
ShardedJedisPipeline pipeline = shardedJedis.pipelined();
if (fields.length > 0) {
for (int i = 0; i < fields.length; i++) {
pipeline.hset(key,fields[i],values[i]);
}
pipeline.sync();
}
Iterator
while(jedis.hasNext()){
jedis.next().select(redisIndex);
}
ShardedJedisPipeline pipeline = shardedJedis.pipelined();
if (fields.length > 0) {
for (int i = 0; i < fields.length; i++) {
pipeline.hset(key,fields[i],values[i]);
}
pipeline.sync();
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯