public class RedisUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
RedisUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkList(List<String> keyList,
List<String> valueList)
判断key-value对List是否为空.
|
static IJedisPool |
createJedisPool(String server,
int timeout)
创建连接池.
|
static IJedisPool |
createJedisPool(String server,
int timeout,
int maxActive,
String password)
创建连接池.
|
static redis.clients.jedis.ZParams.Aggregate |
getAggregate(redis.clients.jedis.ZParams params)
返回AGGREGATE参数选项.
|
static int[] |
getDefaultWeights(String... sets)
返回WEIGHTS选项的默认值.
|
static Double |
getFirstScore(Set<redis.clients.jedis.Tuple> set)
获取第一个元素的score.
|
static List<Double> |
getWeights(redis.clients.jedis.ZParams params)
返回WEIGHTS参数列表.
|
static List<Map.Entry<String,Double>> |
toEntryList(Set<redis.clients.jedis.Tuple> set)
将有序集转成List.
|
static Set<Double> |
tupleToScores(Set<redis.clients.jedis.Tuple> set)
将有序集中元素对应的score转成Double,保存到集合中.
|
static Set<String> |
tupleToString(Set<redis.clients.jedis.Tuple> set)
将有序集的元素转成String,保存到集合中.
|
public static IJedisPool createJedisPool(String server, int timeout)
server - 服务器timeout - 超时时间public static IJedisPool createJedisPool(String server, int timeout, int maxActive, String password)
server - 服务器timeout - 超时时间maxActive - 最大连接数public static boolean checkList(List<String> keyList, List<String> valueList)
keyList - key列表valueList - value列表public static redis.clients.jedis.ZParams.Aggregate getAggregate(redis.clients.jedis.ZParams params)
params - 参数public static List<Double> getWeights(redis.clients.jedis.ZParams params)
params - 参数public static int[] getDefaultWeights(String... sets)
sets - public static Double getFirstScore(Set<redis.clients.jedis.Tuple> set)
set - public static List<Map.Entry<String,Double>> toEntryList(Set<redis.clients.jedis.Tuple> set)
set - 有序集public static Set<String> tupleToString(Set<redis.clients.jedis.Tuple> set)
set - Copyright © 2018–2020. All rights reserved.