redis集群(jedis)批量删除同一前缀

public Set<String> getByPrefix(String key) {
Set<String> setResult = new HashSet<>();
try {
ShardedJedis jedis = redisDataSource.getJedisClient();
Iterator<Jedis> jedisIterator = jedis.getAllShards().iterator();
while(jedisIterator.hasNext()){
setResult = jedisIterator.next().keys(key+"*");
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return setResult;
}
上一篇:saltstack/salt的state.sls的使用


下一篇:初次实践数据库--SQL Server2016