@Override public Set<Tuple> zRangeWithScores(byte[] key, long start, long end) { Assert.notNull(key, "Key must not be null!"); try { return JedisConverters.toTupleSet(connection.getCluster().zrangeWithScores(key, start, end)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
public Set<Tuple> zrangeWithScores(String key, long start, long end) { return jedisCluster.zrangeWithScores(key, start, end); }
@Override public Set<Tuple> zrangeWithScores(byte[] bytes, long l, long l1) { return cluster.zrangeWithScores(bytes, l, l1); }
public Set<Tuple> zrangeWithScores(byte[] key, long start, long end) { return jedisCluster.zrangeWithScores(key, start, end); }
@Override public Set<Tuple> zrangeWithScores(String key, int page, int limit) { long start = (page - 1) * limit; long end = start + limit; Set<Tuple> bs = jedisCluster.zrangeWithScores(SafeEncoder.encode(key), start, end); return bs; }
public Set<Tuple> zrangeWithScores(String key, long start, long end) { try { return cluster.zrangeWithScores(key, start, end); } catch (JedisException e) { LoggerUtils.error("", e); throw new JedisException(e); } }
@Override public Set<Tuple> zRangeWithScores(byte[] key, long start, long end) { Assert.notNull(key, "Key must not be null!"); try { return JedisConverters.toTupleSet(connection.getCluster().zrangeWithScores(key, start, end)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Set<Tuple> zRangeWithScores(byte[] key, long start, long end) { Assert.notNull(key, "Key must not be null!"); try { return JedisConverters.toTupleSet(connection.getCluster().zrangeWithScores(key, start, end)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public <T> Map<T, Double> zrangeWithScores(final String key, final long start, final long end, final TypeReference<T> type) { Assert.hasText(key); Assert.notNull(type); try { final Set<Tuple> tuples = cluster.zrangeWithScores(key, start, end); if (!CollectionUtils.isEmpty(tuples)) { final Map<T, Double> newValues = Maps.newHashMap(); for (Tuple tuple : tuples) { newValues.put(parseObject(tuple.getElement(), type), tuple.getScore()); } return newValues; } return Collections.emptyMap(); } catch (final Throwable e) { throw new RedisClientException(e.getMessage(), e); } }
/** * 返回 key 中,指定区间内的成员。(从小到大) (包含score) */ public Set<Tuple> zrangeWithScores(Object key, int start, int end) { if (null == key) { return null; } if (cluster) { return convertTupleToTupl(jedisCluster.zrangeWithScores(serializeKey(key), start, end)); } else { return convertTupleToTupl(jedisOperator.zrangeWithScores(serializeKey(key), start, end)); } }