com.lordofthejars.nosqlunit.redis.embedded
Class SortsetDatatypeOperations

java.lang.Object
  extended by com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations
      extended by com.lordofthejars.nosqlunit.redis.embedded.SortsetDatatypeOperations
All Implemented Interfaces:
RedisDatatypeOperations

public class SortsetDatatypeOperations
extends ExpirationDatatypeOperations
implements RedisDatatypeOperations


Nested Class Summary
protected static class SortsetDatatypeOperations.ScoredByteBuffer
           
 
Nested classes/interfaces inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations
ExpirationDatatypeOperations.TtlState
 
Field Summary
protected  com.google.common.collect.Multimap<ByteBuffer,SortsetDatatypeOperations.ScoredByteBuffer> sortset
           
protected static String ZSET
           
 
Fields inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations
expirationsInMillis, NO_EXPIRATION
 
Constructor Summary
SortsetDatatypeOperations()
           
 
Method Summary
 Long del(byte[]... keys)
           
 boolean exists(byte[] key)
           
 void flushAllKeys()
           
 long getNumberOfKeys()
           
protected  Set<ByteBuffer> intersactionElements(List<byte[]> keys)
           
 List<byte[]> keys()
           
 boolean renameKey(byte[] key, byte[] newKey)
           
 List<byte[]> sort(byte[] key)
           
 String type()
           
protected  Set<ByteBuffer> unionElements(List<byte[]> keys)
           
 Long zadd(byte[] key, double score, byte[] member)
           
 Long zadd(byte[] key, Map<Double,byte[]> scoreMembers)
          Add the specified member having the specifeid score to the sorted set stored at key.
 Long zcard(byte[] key)
          Return the sorted set cardinality (number of elements).
 Long zcount(byte[] key, byte[] min, byte[] max)
           
 Long zcount(byte[] key, double min, double max)
           
 Double zincrby(byte[] key, double score, byte[] member)
          If member already exists in the sorted set adds the increment to its score and updates the position of the element in the sorted set accordingly.
 Long zinterstore(byte[] dstkey, byte[]... sets)
          Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey.
 Long zinterstore(byte[] dstkey, redis.clients.jedis.ZParams params, byte[]... sets)
          Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey.
 Set<byte[]> zrange(byte[] key, int start, int end)
           
 Set<byte[]> zrangeByScore(byte[] key, byte[] min, byte[] max)
           
 Set<byte[]> zrangeByScore(byte[] key, byte[] min, byte[] max, int offset, int count)
           
 Set<byte[]> zrangeByScore(byte[] key, double min, double max)
          Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
 Set<byte[]> zrangeByScore(byte[] key, double min, double max, int offset, int count)
          Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max)
           
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max, int offset, int count)
           
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key, double min, double max)
          Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key, double min, double max, int offset, int count)
          Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeWithScores(byte[] key, int start, int end)
           
 Long zrank(byte[] key, byte[] member)
          Return the rank (or index) or member in the sorted set at key, with scores being ordered from low to high.
 Long zrem(byte[] key, byte[]... members)
          Remove the specified member from the sorted set value stored at key.
 Long zremrangeByRank(byte[] key, int start, int end)
          Remove all elements in the sorted set at key with rank between start and end.
 Long zremrangeByScore(byte[] key, byte[] start, byte[] end)
           
 Long zremrangeByScore(byte[] key, double start, double end)
          Remove all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
 Set<byte[]> zrevrange(byte[] key, int start, int end)
           
 Set<byte[]> zrevrangeByScore(byte[] key, byte[] max, byte[] min)
           
 Set<byte[]> zrevrangeByScore(byte[] key, byte[] max, byte[] min, int offset, int count)
           
 Set<byte[]> zrevrangeByScore(byte[] key, double max, double min)
           
 Set<byte[]> zrevrangeByScore(byte[] key, double max, double min, int offset, int count)
           
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min)
           
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min, int offset, int count)
           
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key, double max, double min)
           
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key, double max, double min, int offset, int count)
           
 Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeWithScores(byte[] key, int start, int end)
           
 Long zrevrank(byte[] key, byte[] member)
          Return the rank (or index) or member in the sorted set at key, with scores being ordered from high to low.
 Double zscore(byte[] key, byte[] member)
          Return the score of the specified element of the sorted set at key.
 Long zunionstore(byte[] dstkey, byte[]... sets)
          Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey.
 Long zunionstore(byte[] dstkey, redis.clients.jedis.ZParams params, byte[]... sets)
          Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey.
 
Methods inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations
addExpirationAt, addExpirationTime, remainingTime, removeExpiration, renameTtlKey, timedoutState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.lordofthejars.nosqlunit.redis.embedded.RedisDatatypeOperations
addExpirationAt, addExpirationTime, remainingTime, removeExpiration, timedoutState
 

Field Detail

ZSET

protected static final String ZSET
See Also:
Constant Field Values

sortset

protected com.google.common.collect.Multimap<ByteBuffer,SortsetDatatypeOperations.ScoredByteBuffer> sortset
Constructor Detail

SortsetDatatypeOperations

public SortsetDatatypeOperations()
Method Detail

zadd

public Long zadd(byte[] key,
                 double score,
                 byte[] member)

zadd

public Long zadd(byte[] key,
                 Map<Double,byte[]> scoreMembers)
Add the specified member having the specifeid score to the sorted set stored at key. If member is already a member of the sorted set the score is updated, and the element reinserted in the right position to ensure sorting. If key does not exist a new sorted set with the specified member as sole member is crated. If the key exists but does not hold a sorted set value an error is returned.

The score value can be the string representation of a double precision floating point number.

Parameters:
key -
score -
member -
Returns:
Integer reply, specifically: 1 if the new element was added 0 if the element was already a member of the sorted set and the score was updated

zcard

public Long zcard(byte[] key)
Return the sorted set cardinality (number of elements). If the key does not exist 0 is returned, like for empty sorted sets.

Time complexity O(1)

Parameters:
key -
Returns:
the cardinality (number of elements) of the set as an integer.

zcount

public Long zcount(byte[] key,
                   double min,
                   double max)

zcount

public Long zcount(byte[] key,
                   byte[] min,
                   byte[] max)

zincrby

public Double zincrby(byte[] key,
                      double score,
                      byte[] member)
If member already exists in the sorted set adds the increment to its score and updates the position of the element in the sorted set accordingly. If member does not already exist in the sorted set it is added with increment as score (that is, like if the previous score was virtually zero). If key does not exist a new sorted set with the specified member as sole member is crated. If the key exists but does not hold a sorted set value an error is returned.

The score value can be the string representation of a double precision floating point number. It's possible to provide a negative value to perform a decrement.

For an introduction to sorted sets check the Introduction to Redis data types page.

Time complexity O(log(N)) with N being the number of elements in the sorted set

Parameters:
key -
score -
member -
Returns:
The new score

zunionstore

public Long zunionstore(byte[] dstkey,
                        byte[]... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey. It is mandatory to provide the number of input keys N, before passing the input keys and the other (optional) arguments.

As the terms imply, the ZINTERSTORE command requires an element to be present in each of the given inputs to be inserted in the result. The ZUNIONSTORE command inserts all elements across all inputs.

Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means that the score of each element in the sorted set is first multiplied by this weight before being passed to the aggregation. When this option is not given, all weights default to 1.

With the AGGREGATE option, it's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.

Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set

Parameters:
dstkey -
sets -
Returns:
Integer reply, specifically the number of elements in the sorted set at dstkey
See Also:
#zunionstore(String, String...), #zunionstore(String, ZParams, String...), #zinterstore(String, String...), #zinterstore(String, ZParams, String...)

zunionstore

public Long zunionstore(byte[] dstkey,
                        redis.clients.jedis.ZParams params,
                        byte[]... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey. It is mandatory to provide the number of input keys N, before passing the input keys and the other (optional) arguments.

As the terms imply, the ZINTERSTORE command requires an element to be present in each of the given inputs to be inserted in the result. The ZUNIONSTORE command inserts all elements across all inputs.

Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means that the score of each element in the sorted set is first multiplied by this weight before being passed to the aggregation. When this option is not given, all weights default to 1.

With the AGGREGATE option, it's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.

Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set

Parameters:
dstkey -
sets -
params -
Returns:
Integer reply, specifically the number of elements in the sorted set at dstkey
See Also:
#zunionstore(String, String...), #zunionstore(String, ZParams, String...), #zinterstore(String, String...), #zinterstore(String, ZParams, String...)

zinterstore

public Long zinterstore(byte[] dstkey,
                        byte[]... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey. It is mandatory to provide the number of input keys N, before passing the input keys and the other (optional) arguments.

As the terms imply, the ZINTERSTORE command requires an element to be present in each of the given inputs to be inserted in the result. The ZUNIONSTORE command inserts all elements across all inputs.

Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means that the score of each element in the sorted set is first multiplied by this weight before being passed to the aggregation. When this option is not given, all weights default to 1.

With the AGGREGATE option, it's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.

Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set

Parameters:
dstkey -
sets -
Returns:
Integer reply, specifically the number of elements in the sorted set at dstkey
See Also:
#zunionstore(String, String...), #zunionstore(String, ZParams, String...), #zinterstore(String, String...), #zinterstore(String, ZParams, String...)

zinterstore

public Long zinterstore(byte[] dstkey,
                        redis.clients.jedis.ZParams params,
                        byte[]... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at dstkey. It is mandatory to provide the number of input keys N, before passing the input keys and the other (optional) arguments.

As the terms imply, the ZINTERSTORE command requires an element to be present in each of the given inputs to be inserted in the result. The ZUNIONSTORE command inserts all elements across all inputs.

Using the WEIGHTS option, it is possible to add weight to each input sorted set. This means that the score of each element in the sorted set is first multiplied by this weight before being passed to the aggregation. When this option is not given, all weights default to 1.

With the AGGREGATE option, it's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.

Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set

Parameters:
dstkey -
sets -
params -
Returns:
Integer reply, specifically the number of elements in the sorted set at dstkey
See Also:
#zunionstore(String, String...), #zunionstore(String, ZParams, String...), #zinterstore(String, String...), #zinterstore(String, ZParams, String...)

zrange

public Set<byte[]> zrange(byte[] key,
                          int start,
                          int end)

zrangeWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeWithScores(byte[] key,
                                                                        int start,
                                                                        int end)

zrangeByScore

public Set<byte[]> zrangeByScore(byte[] key,
                                 double min,
                                 double max)
Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).

The elements having the same score are returned sorted lexicographically as ASCII strings (this follows from a property of Redis sorted sets and does not involve further computation).

Using the optional LIMIT it's possible to get only a range of the matching elements in an SQL-alike way. Note that if offset is large the commands needs to traverse the list for offset elements and this adds up to the O(M) figure.

The ZCOUNT command is similar to ZRANGEBYSCORE but instead of returning the actual elements in the specified interval, it just returns the number of matching elements.

Exclusive intervals and infinity

min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".

Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:

ZRANGEBYSCORE zset (1.3 5

Will return all the values with score > 1.3 and <= 5, while for instance:

ZRANGEBYSCORE zset (5 (10

Will return all the values with score > 5 and < 10 (5 and 10 excluded).

Time complexity:

O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))

Parameters:
key -
min -
max -
Returns:
Multi bulk reply specifically a list of elements in the specified score range.
See Also:
zrangeByScore(byte[], double, double), zrangeByScore(byte[], double, double, int, int), zrangeByScoreWithScores(byte[], double, double), zrangeByScoreWithScores(byte[], double, double, int, int), zcount(byte[], double, double)

zrangeByScore

public Set<byte[]> zrangeByScore(byte[] key,
                                 byte[] min,
                                 byte[] max)

zrangeByScore

public Set<byte[]> zrangeByScore(byte[] key,
                                 double min,
                                 double max,
                                 int offset,
                                 int count)
Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).

The elements having the same score are returned sorted lexicographically as ASCII strings (this follows from a property of Redis sorted sets and does not involve further computation).

Using the optional LIMIT it's possible to get only a range of the matching elements in an SQL-alike way. Note that if offset is large the commands needs to traverse the list for offset elements and this adds up to the O(M) figure.

The ZCOUNT command is similar to ZRANGEBYSCORE but instead of returning the actual elements in the specified interval, it just returns the number of matching elements.

Exclusive intervals and infinity

min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".

Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:

ZRANGEBYSCORE zset (1.3 5

Will return all the values with score > 1.3 and <= 5, while for instance:

ZRANGEBYSCORE zset (5 (10

Will return all the values with score > 5 and < 10 (5 and 10 excluded).

Time complexity:

O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))

Parameters:
key -
min -
max -
Returns:
Multi bulk reply specifically a list of elements in the specified score range.
See Also:
zrangeByScore(byte[], double, double), zrangeByScore(byte[], double, double, int, int), zrangeByScoreWithScores(byte[], double, double), zrangeByScoreWithScores(byte[], double, double, int, int), zcount(byte[], double, double)

zrangeByScore

public Set<byte[]> zrangeByScore(byte[] key,
                                 byte[] min,
                                 byte[] max,
                                 int offset,
                                 int count)

zrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key,
                                                                               double min,
                                                                               double max)
Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).

The elements having the same score are returned sorted lexicographically as ASCII strings (this follows from a property of Redis sorted sets and does not involve further computation).

Using the optional LIMIT it's possible to get only a range of the matching elements in an SQL-alike way. Note that if offset is large the commands needs to traverse the list for offset elements and this adds up to the O(M) figure.

The ZCOUNT command is similar to ZRANGEBYSCORE but instead of returning the actual elements in the specified interval, it just returns the number of matching elements.

Exclusive intervals and infinity

min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".

Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:

ZRANGEBYSCORE zset (1.3 5

Will return all the values with score > 1.3 and <= 5, while for instance:

ZRANGEBYSCORE zset (5 (10

Will return all the values with score > 5 and < 10 (5 and 10 excluded).

Time complexity:

O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))

Parameters:
key -
min -
max -
Returns:
Multi bulk reply specifically a list of elements in the specified score range.
See Also:
zrangeByScore(byte[], double, double), zrangeByScore(byte[], double, double, int, int), zrangeByScoreWithScores(byte[], double, double), zrangeByScoreWithScores(byte[], double, double, int, int), zcount(byte[], double, double)

zrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key,
                                                                               byte[] min,
                                                                               byte[] max)

zrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key,
                                                                               double min,
                                                                               double max,
                                                                               int offset,
                                                                               int count)
Return the all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).

The elements having the same score are returned sorted lexicographically as ASCII strings (this follows from a property of Redis sorted sets and does not involve further computation).

Using the optional LIMIT it's possible to get only a range of the matching elements in an SQL-alike way. Note that if offset is large the commands needs to traverse the list for offset elements and this adds up to the O(M) figure.

The ZCOUNT command is similar to ZRANGEBYSCORE but instead of returning the actual elements in the specified interval, it just returns the number of matching elements.

Exclusive intervals and infinity

min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".

Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:

ZRANGEBYSCORE zset (1.3 5

Will return all the values with score > 1.3 and <= 5, while for instance:

ZRANGEBYSCORE zset (5 (10

Will return all the values with score > 5 and < 10 (5 and 10 excluded).

Time complexity:

O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))

Parameters:
key -
min -
max -
Returns:
Multi bulk reply specifically a list of elements in the specified score range.
See Also:
zrangeByScore(byte[], double, double), zrangeByScore(byte[], double, double, int, int), zrangeByScoreWithScores(byte[], double, double), zrangeByScoreWithScores(byte[], double, double, int, int), zcount(byte[], double, double)

zrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrangeByScoreWithScores(byte[] key,
                                                                               byte[] min,
                                                                               byte[] max,
                                                                               int offset,
                                                                               int count)

zrank

public Long zrank(byte[] key,
                  byte[] member)
Return the rank (or index) or member in the sorted set at key, with scores being ordered from low to high.

When the given member does not exist in the sorted set, the special value 'nil' is returned. The returned rank (or index) of the member is 0-based for both commands.

Time complexity:

O(log(N))

Parameters:
key -
member -
Returns:
Integer reply or a nil bulk reply, specifically: the rank of the element as an integer reply if the element exists. A nil bulk reply if there is no such element.
See Also:
zrevrank(byte[], byte[])

zrem

public Long zrem(byte[] key,
                 byte[]... members)
Remove the specified member from the sorted set value stored at key. If member was not a member of the set no operation is performed. If key does not not hold a set value an error is returned.

Parameters:
key -
members -
Returns:
The number of members removed from the sorted set, not including non existing members.

zremrangeByRank

public Long zremrangeByRank(byte[] key,
                            int start,
                            int end)
Remove all elements in the sorted set at key with rank between start and end. Start and end are 0-based with rank 0 being the element with the lowest score. Both start and end can be negative numbers, where they indicate offsets starting at the element with the highest rank. For example: -1 is the element with the highest score, -2 the element with the second highest score and so forth.

Time complexity: O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements removed by the operation


zremrangeByScore

public Long zremrangeByScore(byte[] key,
                             double start,
                             double end)
Remove all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).

Time complexity:

Parameters:
key -
start -
end -
Returns:
Integer reply, specifically the number of elements removed.

zremrangeByScore

public Long zremrangeByScore(byte[] key,
                             byte[] start,
                             byte[] end)

zrevrange

public Set<byte[]> zrevrange(byte[] key,
                             int start,
                             int end)

zrevrangeWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeWithScores(byte[] key,
                                                                           int start,
                                                                           int end)

zrevrangeByScore

public Set<byte[]> zrevrangeByScore(byte[] key,
                                    double max,
                                    double min)

zrevrangeByScore

public Set<byte[]> zrevrangeByScore(byte[] key,
                                    byte[] max,
                                    byte[] min)

zrevrangeByScore

public Set<byte[]> zrevrangeByScore(byte[] key,
                                    double max,
                                    double min,
                                    int offset,
                                    int count)

zrevrangeByScore

public Set<byte[]> zrevrangeByScore(byte[] key,
                                    byte[] max,
                                    byte[] min,
                                    int offset,
                                    int count)

zrevrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key,
                                                                                  double max,
                                                                                  double min)

zrevrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key,
                                                                                  double max,
                                                                                  double min,
                                                                                  int offset,
                                                                                  int count)

zrevrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key,
                                                                                  byte[] max,
                                                                                  byte[] min)

zrevrangeByScoreWithScores

public Set<SortsetDatatypeOperations.ScoredByteBuffer> zrevrangeByScoreWithScores(byte[] key,
                                                                                  byte[] max,
                                                                                  byte[] min,
                                                                                  int offset,
                                                                                  int count)

zrevrank

public Long zrevrank(byte[] key,
                     byte[] member)
Return the rank (or index) or member in the sorted set at key, with scores being ordered from high to low.

When the given member does not exist in the sorted set, the special value 'nil' is returned. The returned rank (or index) of the member is 0-based for both commands.

Time complexity:

Parameters:
key -
member -
Returns:
Integer reply or a nil bulk reply, specifically: the rank of the element as an integer reply if the element exists. A nil bulk reply if there is no such element.
See Also:
zrank(byte[], byte[])

zscore

public Double zscore(byte[] key,
                     byte[] member)
Return the score of the specified element of the sorted set at key. If the specified element does not exist in the sorted set, or the key does not exist at all, a special 'nil' value is returned.

Parameters:
key -
member -
Returns:
the score

getNumberOfKeys

public long getNumberOfKeys()
Specified by:
getNumberOfKeys in interface RedisDatatypeOperations

flushAllKeys

public void flushAllKeys()
Specified by:
flushAllKeys in interface RedisDatatypeOperations

unionElements

protected Set<ByteBuffer> unionElements(List<byte[]> keys)

intersactionElements

protected Set<ByteBuffer> intersactionElements(List<byte[]> keys)

del

public Long del(byte[]... keys)
Specified by:
del in interface RedisDatatypeOperations

exists

public boolean exists(byte[] key)
Specified by:
exists in interface RedisDatatypeOperations

renameKey

public boolean renameKey(byte[] key,
                         byte[] newKey)
Specified by:
renameKey in interface RedisDatatypeOperations

keys

public List<byte[]> keys()
Specified by:
keys in interface RedisDatatypeOperations

type

public String type()
Specified by:
type in interface RedisDatatypeOperations

sort

public List<byte[]> sort(byte[] key)
Specified by:
sort in interface RedisDatatypeOperations


Copyright © 2012. All Rights Reserved.