12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
建站问答 时间:2024-12-01 19:12:29
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
redis循环遍历key的示例:@Testpublic void test12(){Jedis jedis = new Jedis("x.x.x.x", 6379);jedis.auth("xxx");long start = System.currentTimeMillis();String cursor
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
redis循环遍历key的示例:
@Test
public void test12(){
Jedis jedis = new Jedis("x.x.x.x", 6379);
jedis.auth("xxx");
long start = System.currentTimeMillis();
String cursor = "0";
do {
ScanParams scanParams = new ScanParams();
scanParams.match("hello*");
ScanResult
scan = jedis.scan(cursor, scanParams); List
result = scan.getResult(); result.forEach(x->{
System.out.println(x);
});
cursor = scan.getStringCursor();
}while (!StringUtils.equals("0",cursor));
long end = System.currentTimeMillis();
System.out.println(new Double(end-start)/1000d);
}
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19