org.springframework.data.redis.connection
Interface RedisZSetCommands

All Known Subinterfaces:
RedisCommands, RedisConnection, StringRedisConnection
All Known Implementing Classes:
DefaultStringRedisConnection, JedisConnection, JredisConnection, LettuceConnection, SrpConnection

public interface RedisZSetCommands

ZSet(SortedSet)-specific commands supported by Redis.


Nested Class Summary
static class RedisZSetCommands.Aggregate
          Sort aggregation operations.
static interface RedisZSetCommands.Tuple
          ZSet tuple.
 
Method Summary
 Boolean zAdd(byte[] key, double score, byte[] value)
          Add value to a sorted set at key, or update its score if it already exists.
 Long zAdd(byte[] key, Set<RedisZSetCommands.Tuple> tuples)
          Add tuples to a sorted set at key, or update its score if it already exists.
 Long zCard(byte[] key)
          Get the size of sorted set with key.
 Long zCount(byte[] key, double min, double max)
          Count number of elements within sorted set with scores between min and max.
 Double zIncrBy(byte[] key, double increment, byte[] value)
          Increment the score of element with value in sorted set by increment.
 Long zInterStore(byte[] destKey, byte[]... sets)
          Intersect sorted sets and store result in destination key.
 Long zInterStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
          Intersect sorted sets and store result in destination key.
 Set<byte[]> zRange(byte[] key, long begin, long end)
          Get elements between begin and end from sorted set.
 Set<byte[]> zRangeByScore(byte[] key, double min, double max)
          Get elements where score is between min and max from sorted set.
 Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count)
          Get elements in range from begin to end where score is between min and max from sorted set.
 Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max)
          Get set of RedisZSetCommands.Tuples where score is between min and max from sorted set.
 Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
          Get set of RedisZSetCommands.Tuples in range from begin to end where score is between min and max from sorted set.
 Set<RedisZSetCommands.Tuple> zRangeWithScores(byte[] key, long begin, long end)
          Get set of RedisZSetCommands.Tuples between begin and end from sorted set.
 Long zRank(byte[] key, byte[] value)
          Determine the index of element with value in a sorted set.
 Long zRem(byte[] key, byte[]... values)
          Remove values from sorted set.
 Long zRemRange(byte[] key, long begin, long end)
          Remove elements in range between begin and end from sorted set with key.
 Long zRemRangeByScore(byte[] key, double min, double max)
          Remove elements with scores between min and max from sorted set with key.
 Set<byte[]> zRevRange(byte[] key, long begin, long end)
          Get elements in range from begin to end from sorted set ordered high -> low.
 Set<byte[]> zRevRangeByScore(byte[] key, double min, double max)
          Get elements where score is between min and max from sorted set ordered high -> low.
 Set<byte[]> zRevRangeByScore(byte[] key, double min, double max, long offset, long count)
          Get elements in range from begin to end where score is between min and max from sorted set ordered high -> low.
 Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max)
          Get set of RedisZSetCommands.Tuple where score is between min and max from sorted set ordered high -> low.
 Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
          Get set of RedisZSetCommands.Tuple in range from begin to end where score is between min and max from sorted set ordered high -> low.
 Set<RedisZSetCommands.Tuple> zRevRangeWithScores(byte[] key, long begin, long end)
          Get set of RedisZSetCommands.Tuples in range from begin to end from sorted set ordered high -> low.
 Long zRevRank(byte[] key, byte[] value)
          Determine the index of element with value in a sorted set when scored high to low.
 Double zScore(byte[] key, byte[] value)
          Get the score of element with value from sorted set with key key.
 Long zUnionStore(byte[] destKey, byte[]... sets)
          Union sorted sets and store result in destination key.
 Long zUnionStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
          Union sorted sets and store result in destination key.
 

Method Detail

zAdd

Boolean zAdd(byte[] key,
             double score,
             byte[] value)
Add value to a sorted set at key, or update its score if it already exists.

Parameters:
key -
score -
value -
Returns:
See Also:
http://redis.io/commands/zadd

zAdd

Long zAdd(byte[] key,
          Set<RedisZSetCommands.Tuple> tuples)
Add tuples to a sorted set at key, or update its score if it already exists.

Parameters:
key -
tuples -
Returns:
See Also:
http://redis.io/commands/zadd

zRem

Long zRem(byte[] key,
          byte[]... values)
Remove values from sorted set. Return number of removed elements.

Parameters:
key -
values -
Returns:
See Also:
http://redis.io/commands/zrem

zIncrBy

Double zIncrBy(byte[] key,
               double increment,
               byte[] value)
Increment the score of element with value in sorted set by increment.

Parameters:
key -
increment -
value -
Returns:
See Also:
http://redis.io/commands/zincrby

zRank

Long zRank(byte[] key,
           byte[] value)
Determine the index of element with value in a sorted set.

Parameters:
key -
value -
Returns:
See Also:
http://redis.io/commands/zrank

zRevRank

Long zRevRank(byte[] key,
              byte[] value)
Determine the index of element with value in a sorted set when scored high to low.

Parameters:
key -
value -
Returns:
See Also:
http://redis.io/commands/zrevrank

zRange

Set<byte[]> zRange(byte[] key,
                   long begin,
                   long end)
Get elements between begin and end from sorted set.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrange

zRangeWithScores

Set<RedisZSetCommands.Tuple> zRangeWithScores(byte[] key,
                                              long begin,
                                              long end)
Get set of RedisZSetCommands.Tuples between begin and end from sorted set.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrange

zRangeByScore

Set<byte[]> zRangeByScore(byte[] key,
                          double min,
                          double max)
Get elements where score is between min and max from sorted set.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRangeByScoreWithScores

Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key,
                                                     double min,
                                                     double max)
Get set of RedisZSetCommands.Tuples where score is between min and max from sorted set.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRangeByScore

Set<byte[]> zRangeByScore(byte[] key,
                          double min,
                          double max,
                          long offset,
                          long count)
Get elements in range from begin to end where score is between min and max from sorted set.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRangeByScoreWithScores

Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key,
                                                     double min,
                                                     double max,
                                                     long offset,
                                                     long count)
Get set of RedisZSetCommands.Tuples in range from begin to end where score is between min and max from sorted set.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRevRange

Set<byte[]> zRevRange(byte[] key,
                      long begin,
                      long end)
Get elements in range from begin to end from sorted set ordered high -> low.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrevrange

zRevRangeWithScores

Set<RedisZSetCommands.Tuple> zRevRangeWithScores(byte[] key,
                                                 long begin,
                                                 long end)
Get set of RedisZSetCommands.Tuples in range from begin to end from sorted set ordered high -> low.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrevrange

zRevRangeByScore

Set<byte[]> zRevRangeByScore(byte[] key,
                             double min,
                             double max)
Get elements where score is between min and max from sorted set ordered high -> low.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrevrange

zRevRangeByScoreWithScores

Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key,
                                                        double min,
                                                        double max)
Get set of RedisZSetCommands.Tuple where score is between min and max from sorted set ordered high -> low.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrevrange

zRevRangeByScore

Set<byte[]> zRevRangeByScore(byte[] key,
                             double min,
                             double max,
                             long offset,
                             long count)
Get elements in range from begin to end where score is between min and max from sorted set ordered high -> low.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrevrangebyscore

zRevRangeByScoreWithScores

Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key,
                                                        double min,
                                                        double max,
                                                        long offset,
                                                        long count)
Get set of RedisZSetCommands.Tuple in range from begin to end where score is between min and max from sorted set ordered high -> low.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zrevrangebyscore

zCount

Long zCount(byte[] key,
            double min,
            double max)
Count number of elements within sorted set with scores between min and max.

Parameters:
key -
min -
max -
Returns:
See Also:
http://redis.io/commands/zcount

zCard

Long zCard(byte[] key)
Get the size of sorted set with key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/zcard

zScore

Double zScore(byte[] key,
              byte[] value)
Get the score of element with value from sorted set with key key.

Parameters:
key -
value -
Returns:
See Also:
http://redis.io/commands/zrem

zRemRange

Long zRemRange(byte[] key,
               long begin,
               long end)
Remove elements in range between begin and end from sorted set with key.

Parameters:
key -
begin -
end -
Returns:
See Also:
http://redis.io/commands/zremrange

zRemRangeByScore

Long zRemRangeByScore(byte[] key,
                      double min,
                      double max)
Remove elements with scores between min and max from sorted set with key.

Parameters:
key -
min -
max -
Returns:
See Also:
http://redis.io/commands/zremrangebyscore

zUnionStore

Long zUnionStore(byte[] destKey,
                 byte[]... sets)
Union sorted sets and store result in destination key.

Parameters:
destKey -
sets -
Returns:
See Also:
http://redis.io/commands/zunionstore

zUnionStore

Long zUnionStore(byte[] destKey,
                 RedisZSetCommands.Aggregate aggregate,
                 int[] weights,
                 byte[]... sets)
Union sorted sets and store result in destination key.

Parameters:
destKey -
aggregate -
weights -
sets -
Returns:
See Also:
http://redis.io/commands/zunionstore

zInterStore

Long zInterStore(byte[] destKey,
                 byte[]... sets)
Intersect sorted sets and store result in destination key.

Parameters:
destKey -
sets -
Returns:
See Also:
http://redis.io/commands/zinterstore

zInterStore

Long zInterStore(byte[] destKey,
                 RedisZSetCommands.Aggregate aggregate,
                 int[] weights,
                 byte[]... sets)
Intersect sorted sets and store result in destination key.

Parameters:
destKey -
sets -
Returns:
See Also:
http://redis.io/commands/zinterstore