Example usage for org.springframework.data.redis.connection RedisConnection zRevRangeByScoreWithScores

List of usage examples for org.springframework.data.redis.connection RedisConnection zRevRangeByScoreWithScores

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection zRevRangeByScoreWithScores.

Prototype

@Nullable
default Set<Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max) 

Source Link

Document

Get set of Tuple where score is between min and max from sorted set ordered from high to low.

Usage

From source file:com.mauersu.util.redis.DefaultZSetOperations.java

public Set<TypedTuple<V>> reverseRangeByScoreWithScores(K key, final double min, final double max) {
    final byte[] rawKey = rawKey(key);

    Set<Tuple> rawValues = execute(new RedisCallback<Set<Tuple>>() {

        public Set<Tuple> doInRedis(RedisConnection connection) {
            connection.select(dbIndex);//  www.jav  a  2 s  . c  o m
            return connection.zRevRangeByScoreWithScores(rawKey, min, max);

        }
    }, true);

    return deserializeTupleValues(rawValues);
}

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Get set of {@link Tuple} where score is between {@code min} and {@code max} from sorted set ordered from high to
 * low./*  w  ww  .j av a2 s .  c  om*/
 * <p>
 * See http://redis.io/commands/zrevrange
 * 
 * @param key key
 * @param min min
 * @param max max
 * @return Set<Tuple>
 */
public static Set<Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, min, max);
        }
    });
}

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Get set of {@link Tuple} in range from {@code Limit#offset} to {@code Limit#count} where score is between
 * {@code Range#min} and {@code Range#max} from sorted set ordered high -> low.
 * //from   w ww .j a  va 2 s  .c  om
 * @param key key
 * @param range range
 * @param limit limit
 * @return Set<Tuple>
 * @since 1.6
 */
public static Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, range, limit);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Get set of {@link Tuple} where score is between {@code min} and {@code max} from sorted set ordered from high to
 * low./*w w w.ja  v  a 2 s .  c  o  m*/
 * <p>
 * See http://redis.io/commands/zrevrange
 * 
 * @param key key
 * @param min min
 * @param max max
 * @return Set<Tuple>
 */
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, min, max);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Get set of {@link Tuple} in range from {@code Limit#offset} to {@code Limit#count} where score is between
 * {@code Range#min} and {@code Range#max} from sorted set ordered high -> low.
 * /*from  ww w. j a va 2 s  .  co m*/
 * @param key key
 * @param range range
 * @param limit limit
 * @return Set<Tuple>
 * @since 1.6
 */
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, range, limit);
        }
    });
}