Available Methods
- close ( )
- set ( )
- del ( )
- get ( )
- exists ( )
- expire ( )
- select ( )
- hset ( )
- rpush ( )
- publish ( )
- hget ( )
- lpush ( )
- incr ( )
- sadd ( )
- hdel ( )
- lrange ( )
- setex ( )
- keys ( )
- auth ( )
- hgetAll ( )
- flushAll ( )
- pipelined ( )
- srem ( )
- hmset ( )
- smembers ( )
- scard ( )
- setnx ( )
- connect ( )
- decr ( )
- eval ( )
- multi ( )
- sort ( )
- sismember ( )
- zrangeByScore ( )
- zadd ( )
- hvals ( )
- lpop ( )
- zrange ( )
- rpop ( )
- incrBy ( )
- hmget ( )
- hkeys ( )
- llen ( )
- watch ( )
- brpop ( )
- zrem ( )
- ttl ( )
- linsert ( )
- mget ( )
- configSet ( )
- hexists ( )
- spop ( )
- decrBy ( )
- sdiffstore ( )
- setrange ( )
- zscore ( )
- ltrim ( )
- hlen ( )
- scan ( )
- getSet ( )
- zrevrangeByScoreWithScores ( )
- append ( )
- sdiff ( )
- zcard ( )
- lindex ( )
- subscribe ( )
- rename ( )
- sinter ( )
- lrem ( )
- clientSetname ( )
- persist ( )
- sendCommand ( )
- zrangeWithScores ( )
- zscan ( )
- psubscribe ( )
- zrevrank ( )
- mset ( )
- zrevrangeByScore ( )
- slowlogGet ( )
- flushDB ( )
- sunionstore ( )
- strlen ( )
- disconnect ( )
Related Classes
- java.util.Arrays
- java.util.Collections
- java.util.Date
- java.util.concurrent.TimeUnit
- org.junit.Before
- java.util.UUID
- java.net.URI
- java.util.Map.Entry
- org.junit.Assert
- java.util.Optional
- javax.servlet.http.HttpServletRequest
- com.google.gson.Gson
- org.springframework.context.annotation.Bean
- org.json.JSONObject
- org.apache.commons.lang3.StringUtils
- org.apache.commons.io.IOUtils
- com.google.common.collect.Lists
- org.apache.commons.lang.StringUtils
- org.springframework.util.StringUtils
- com.alibaba.fastjson.JSON
- javax.ws.rs.core.Response
- com.alibaba.fastjson.JSONObject
- redis.clients.jedis.JedisPool
- redis.clients.jedis.JedisPoolConfig
- org.apache.commons.pool2.impl.GenericObjectPoolConfig
Java Code Examples for redis.clients.jedis.Jedis#zrangeWithScores()
The following examples show how to use
redis.clients.jedis.Jedis#zrangeWithScores() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JedisUtil.java From scaffold-cloud with MIT License | 6 votes |
/** * 获取所有sorted set中的成员以及分值 * * @param key 键值 * @return 排序的map */ public static LinkedHashMap<String, Double> zgetAll(String key) { LinkedHashMap<String, Double> result = null; Jedis jedis = null; try { jedis = getResource(); result = new LinkedHashMap<>(); Set<Tuple> sortedSet = jedis.zrangeWithScores(key, 0, -1); for (Tuple tuple : sortedSet) { result.put(tuple.getElement(), tuple.getScore()); } } catch (Exception e) { logger.warn("zrangeWithScores {} = {}", key, e); } finally { close(jedis); } return result; }
Example 2
Source File: JedisUtil.java From scaffold-cloud with MIT License | 6 votes |
/** * 获取所有sorted set中的排名第一的成员 * * @param key 键值 * @return 排序的map */ public static LinkedHashMap<String, Double> zgetFirst(String key) { LinkedHashMap<String, Double> result = null; Jedis jedis = null; try { jedis = getResource(); result = new LinkedHashMap<>(); Set<Tuple> sortedSet = jedis.zrangeWithScores(key, 0, 0); for (Tuple tuple : sortedSet) { result.put(tuple.getElement(), tuple.getScore()); } } catch (Exception e) { logger.warn("zrangeWithScores {} = {}", key, e); } finally { close(jedis); } return result; }
Example 3
Source File: JedisUtil.java From scaffold-cloud with MIT License | 5 votes |
/** * 获取sortedset中的 索引范围的 * * @param key * @param start * @param end * @return */ public static Set<Tuple> zrangeWithScore(String key, Long start, Long end) { Set<Tuple> result = null; Jedis jedis = null; try { jedis = getResource(); result = jedis.zrangeWithScores(key, start, end); } catch (Exception e) { logger.warn("zrangeWithScore key = {}, start = {}, end = {}", key, start, end, e); } finally { close(jedis); } return result; }
Example 4
Source File: Main.java From JavaBase with MIT License | 4 votes |
private void transferZSet(String key, Jedis originJedis, Jedis targetJedis) { Set<Tuple> tuples = originJedis.zrangeWithScores(key, 0, -1); Map<String, Double> collect = tuples.stream() .collect(Collectors.toMap(Tuple::getElement, Tuple::getScore)); targetJedis.zadd(key, collect); }
Example 5
Source File: DefaultRedis.java From craft-atom with MIT License | 4 votes |
private Map<String, Double> zrangewithscores0(Jedis j, String key, long start, long stop) { Set<Tuple> set = j.zrangeWithScores(key, start, stop); Map<String, Double> map = convert4zrangewithscores(set); return map; }