jedis的hscan方法使用方法
jedis的hscan方法使用方法(java)
?
解決方法:
1.hscan核心方法:
public Map<String, Integer> getAll(String hashKey, int iterSize) {
?Jedis jedis = null;
?Map<String, Integer> mapList=new HashMap<String, Integer>();
?try {
? ?int cursor = 0;
? ?ScanParams scanParams = new ScanParams().match("*").count(iterSize > 0 ? iterSize : 1000);
? ?ScanResult<Entry<String, String>> scanResult;
? ?jedis = Redis.getJedis();
jedis.select(0);
? ?do {
? ? ? ??http://www.yayihouse.com/yayishuwu/chapter/1821
? ? ? ? } while (cursor > 0);
?}catch (Exception e) {
? ? ?logger.error(e.getLocalizedMessage(), e);
? ? ?return null;
? ? ?}finally{
// 返還到連接池
if (jedis != null) {
jedis.close();
?
}
}
? ?return mapList;
?}
?
2.使用方法
Map<String, Integer> delHash = getAll("rd_sms_global_blacklist", 1000);
總結(jié)
以上是生活随笔為你收集整理的jedis的hscan方法使用方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机在会计专业的作用论文开题报告,会计
- 下一篇: openlayes调用arcgis wm