Class RedisPipeline
- java.lang.Object
-
- com.blackrook.redis.RedisPipeline
-
- All Implemented Interfaces:
RedisDeferredCommands
public class RedisPipeline extends Object implements RedisDeferredCommands
A Redis Pipeline, created from a Redis Connection. Each call in this object queues the command and sends them all at once when completed.- Author:
- Matthew Tropiano
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(String key, String value)voidbitcount(String key)voidbitcount(String key, long start, long end)voidbitop(BitwiseOperation operation, String destkey, String key, String... keys)voidbitpos(String key, long bit)voidbitpos(String key, long bit, Long start, Long end)voidblpop(long timeout, String key, String... keys)voidbrpop(long timeout, String key, String... keys)voidbrpoplpush(long timeout, String source, String destination)voiddecr(String key)voiddecrby(String key, long decrement)voiddel(String key, String... keys)voiddump(String key)voidecho(String message)voideval(String scriptContent, String[] keys, Object... args)voidevalsha(String hash, String[] keys, Object... args)voidexists(String key)voidexpire(String key, long seconds)voidexpireat(String key, long timestamp)RedisObject[]finish()Send all pending commands in the pipeline and returns all of their return values.voidget(String key)voidgetbit(String key, long offset)voidgetrange(String key, long start, long end)voidgetset(String key, Number value)voidgetset(String key, String value)voidhdel(String key, String field, String... fields)voidhexists(String key, String field)voidhget(String key, String field)voidhgetall(String key)voidhincrby(String key, String field, long increment)voidhincrbyfloat(String key, String field, double increment)voidhkeys(String key)voidhlen(String key)voidhmget(String key, String field, String... fields)voidhmset(String key, KeyValue<String,Object>... pairs)voidhmset(String key, Object field, Object value, Object... fieldvalues)voidhmset(String key, String field, String value, String... fieldvalues)voidhset(String key, String field, Number value)voidhset(String key, String field, String value)voidhsetnx(String key, String field, Number value)voidhsetnx(String key, String field, String value)voidhvals(String key)voidincr(String key)voidincrby(String key, long increment)voidincrbyfloat(String key, double increment)voidkeys(String pattern)voidlindex(String key, long index)voidlinsert(String key, boolean before, String pivot, Number value)voidlinsert(String key, boolean before, String pivot, String value)voidllen(String key)voidlpop(String key)voidlpush(String key, String value, String... values)voidlpushx(String key, String value)voidlrange(String key, long start, long stop)voidlrem(String key, long count, String value)voidlset(String key, long index, String value)voidltrim(String key, long start, long stop)voidmget(String key, String... keys)voidmove(String key, long db)voidmset(KeyValue<String,Object>... pairs)LikeRedisDeferredCommands.mset(String, String, String...), but takes key-value pairs.voidmset(String key, String value, String... keyValues)voidmsetnx(KeyValue<String,Object>... pairs)LikeRedisDeferredCommands.msetnx(String, String, String...), but takes key-value pairs.voidmsetnx(String key, String value, String... keyValues)voidpersist(String key)voidpexpire(String key, long milliseconds)voidpexpireat(String key, long timestamp)voidpsetex(String key, long milliseconds, String value)voidpttl(String key)voidpublish(String channel, String message)voidrandomkey()voidrename(String key, String newkey)voidrenamenx(String key, String newkey)voidrestore(String key, long ttl, String serializedvalue)voidrpop(String key)voidrpoplpush(String source, String destination)voidrpush(String key, String value, String... values)voidrpushx(String key, String value)voidsadd(String key, Object member, Object... members)voidsadd(String key, String member, String... members)voidscard(String key)voidscriptExists(String scriptHash, String... scriptHashes)voidscriptFlush()voidscriptKill(String hash)voidscriptLoad(File content)voidscriptLoad(InputStream content)voidscriptLoad(String content)voidsdiff(String key, String... keys)voidsdiffstore(String destination, String key, String... keys)voidset(String key, Number value)voidset(String key, String value)voidsetbit(String key, long offset, long value)voidsetex(String key, long seconds, String value)voidsetnx(String key, String value)voidsetrange(String key, long offset, String value)voidsinter(String key, String... keys)voidsinterstore(String destination, String key, String... keys)voidsismember(String key, Number member)voidsismember(String key, String member)voidsmembers(String key)voidsmove(String source, String destination, String member)voidsort(String key, String pattern, SortOrder sortOrder, boolean alpha, Long limitOffset, Long limitCount, String storeKey, String... getPatterns)protected StringspecialDouble(double d)Converts some of Java's primitive doubles to Redis interval values.voidspop(String key)voidsrandmember(String key)voidsrandmember(String key, long count)voidsrem(String key, Object member, Object... members)voidsrem(String key, String member, String... members)voidstrlen(String key)voidsunion(String key, String... keys)voidsunionstore(String destination, String key, String... keys)voidttl(String key)voidtype(String key)voidzadd(String key, double score, Number member)voidzadd(String key, double score, String member)voidzadd(String key, KeyValue<Double,String>... pairs)voidzcard(String key)voidzcount(String key, double min, double max)Likezcount(String, String, String), except it accepts doubles for min and max, not strings.voidzcount(String key, String min, String max)voidzincrby(String key, double increment, String member)voidzinterstore(String destination, double[] weights, Aggregation aggregation, String key, String... keys)voidzinterstore(String destination, double[] weights, String key, String... keys)LikeRedisDeferredCommands.zinterstore(String, double[], Aggregation, String, String...), except it does no aggregation of scores.voidzinterstore(String destination, Aggregation aggregation, String key, String... keys)LikeRedisDeferredCommands.zinterstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores.voidzinterstore(String destination, String key, String... keys)LikeRedisDeferredCommands.zinterstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores, and does no aggregation of scores.voidzlexcount(String key, double min, double max)LikeRedisDeferredCommands.zlexcount(String, String, String), except it accepts doubles for min and max, not strings.voidzlexcount(String key, String min, String max)voidzrange(String key, long start, long stop, boolean withScores)voidzrangebylex(String key, double min, double max)Likezrangebylex(String, String, String), except it accepts doubles for min and max, not strings, with no limit.voidzrangebylex(String key, double min, double max, Long limitOffset, Long limitCount)Likezrangebylex(String, String, String, Long, Long), except it accepts doubles for min and max, not strings.voidzrangebylex(String key, String min, String max)Likezrangebylex(String, String, String, Long, Long), with no limit.voidzrangebylex(String key, String min, String max, Long limitOffset, Long limitCount)voidzrangebyscore(String key, double min, double max, boolean withScores)LikeRedisDeferredCommands.zrangebyscore(String, String, String, boolean), except it accepts doubles for min and max, not strings.voidzrangebyscore(String key, double min, double max, boolean withScores, Long limitOffset, Long limitCount)LikeRedisDeferredCommands.zrangebyscore(String, String, String, boolean, Long, Long), except it accepts doubles for min and max, not strings.voidzrangebyscore(String key, String min, String max, boolean withScores)LikeRedisDeferredCommands.zrangebyscore(String, String, String, boolean, Long, Long), except specifies no limit.voidzrangebyscore(String key, String min, String max, boolean withScores, Long limitOffset, Long limitCount)voidzrank(String key, Number member)voidzrank(String key, String member)voidzrem(String key, Number member, Number... members)voidzrem(String key, String member, String... members)voidzremrangebylex(String key, double min, double max)LikeRedisDeferredCommands.zrangebylex(String, String, String), except it accepts doubles for min and max.voidzremrangebylex(String key, String min, String max)voidzremrangebyrank(String key, long start, long stop)voidzremrangebyscore(String key, double min, double max)Likezremrangebyscore(String, String, String), except it accepts doubles for min and max, not strings.voidzremrangebyscore(String key, String min, String max)voidzrevrange(String key, long start, long stop, boolean withScores)voidzrevrangebyscore(String key, double min, double max, boolean withScores)LikeRedisDeferredCommands.zrevrangebyscore(String, String, String, boolean), except it accepts doubles for min and max, not strings.voidzrevrangebyscore(String key, double min, double max, boolean withScores, Long limitOffset, Long limitCount)LikeRedisDeferredCommands.zrevrangebyscore(String, String, String, boolean, Long, Long), except it accepts doubles for min and max, not strings.voidzrevrangebyscore(String key, String min, String max, boolean withScores)LikeRedisDeferredCommands.zrevrangebyscore(String, String, String, boolean, Long, Long), except specifies no limit.voidzrevrangebyscore(String key, String min, String max, boolean withScores, Long limitOffset, Long limitCount)voidzrevrank(String key, String member)voidzscore(String key, String member)voidzunionstore(String destination, double[] weights, Aggregation aggregation, String key, String... keys)voidzunionstore(String destination, double[] weights, String key, String... keys)LikeRedisDeferredCommands.zunionstore(String, double[], Aggregation, String, String...), except it does no aggregation of scores.voidzunionstore(String destination, Aggregation aggregation, String key, String... keys)LikeRedisDeferredCommands.zunionstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores.voidzunionstore(String destination, String key, String... keys)LikeRedisDeferredCommands.zunionstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores, and does no aggregation of scores.
-
-
-
Method Detail
-
finish
public RedisObject[] finish()
Send all pending commands in the pipeline and returns all of their return values.- Returns:
- an array of Redis objects whose contents are in the order of the commands issued.
-
echo
public void echo(String message)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/echo:
Available since 1.0.0.
- Specified by:
echoin interfaceRedisDeferredCommands
-
del
public void del(String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/del:
Available since 1.0.0.
Time complexity: O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).
Removes the specified keys. A key is ignored if it does not exist.
- Specified by:
delin interfaceRedisDeferredCommands- Parameters:
key- the first key to delete.keys- the additional keys to delete.
-
dump
public void dump(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/dump:
Available since 2.6.0.
Time complexity: O(1) to access the key and additional O(N*M) to serialized it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1).
Serialize the value stored at key in a Redis-specific format and return it to the user. The returned value can be synthesized back into a Redis key using the
RedisDeferredCommands.restore(java.lang.String, long, java.lang.String)command.- Specified by:
dumpin interfaceRedisDeferredCommands
-
exists
public void exists(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/exists:
Available since 1.0.0.
Time complexity: O(1)
Returns if
keyexists.- Specified by:
existsin interfaceRedisDeferredCommands
-
expire
public void expire(String key, long seconds)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/expire:
Available since 1.0.0.
Time complexity: O(1)
Set a timeout on
key. After the timeout has expired, the key will automatically be deleted. A key with an associated timeout is often said to be volatile in Redis terminology.- Specified by:
expirein interfaceRedisDeferredCommands- Parameters:
key- the key to expire.seconds- the time-to-live in seconds.
-
expireat
public void expireat(String key, long timestamp)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/expireat:
Available since 1.2.0.
Time complexity: O(1)
expireat has the same effect and semantic as
RedisDeferredCommands.expire(java.lang.String, long), but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970).- Specified by:
expireatin interfaceRedisDeferredCommands- Parameters:
key- the key to expire.timestamp- the timestamp in from-Epoch milliseconds.
-
keys
public void keys(String pattern)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/keys:
Available since 1.0.0.
Time complexity: O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length.
Returns all keys matching
pattern.- Specified by:
keysin interfaceRedisDeferredCommands- Parameters:
pattern- a wildcard pattern for matching key names.
-
move
public void move(String key, long db)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/move:
Available since 1.0.0.
Time complexity: O(1)
Move
keyfrom the currently selected database to the specified destination database. Whenkeyalready exists in the destination database, or it does not exist in the source database, it does nothing. It is possible to use MOVE as a locking primitive because of this.- Specified by:
movein interfaceRedisDeferredCommands- Parameters:
key- the key to move.db- the target database.
-
persist
public void persist(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/persist:
Available since 2.2.0.
Time complexity: O(1)
Remove the existing timeout on
key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).- Specified by:
persistin interfaceRedisDeferredCommands- Parameters:
key- the key to persist (remove TTL).
-
pexpire
public void pexpire(String key, long milliseconds)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/pexpire:
Available since 2.6.0.
Time complexity: O(1)
This command works exactly like
RedisDeferredCommands.expire(java.lang.String, long)but the time to live of the key is specified in milliseconds instead of seconds.- Specified by:
pexpirein interfaceRedisDeferredCommands- Parameters:
key- the key to expire.milliseconds- the time-to-live in milliseconds.
-
pexpireat
public void pexpireat(String key, long timestamp)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/pexpireat:
Available since 2.6.0.
Time complexity: O(1)
PEXPIREAT has the same effect and semantic as
RedisDeferredCommands.expireat(java.lang.String, long), but the Unix time at which the key will expire is specified in milliseconds instead of seconds.- Specified by:
pexpireatin interfaceRedisDeferredCommands- Parameters:
key- the key to expire.timestamp- the timestamp in from-Epoch milliseconds.
-
pttl
public void pttl(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/pttl:
Available since 2.6.0.
Time complexity: O(1)
Like
RedisDeferredCommands.ttl(java.lang.String), this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.- Specified by:
pttlin interfaceRedisDeferredCommands- Parameters:
key- the key to inspect.
-
publish
public void publish(String channel, String message)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/publish:
Available since 2.0.0.
Time complexity: O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
Posts a message to the given channel.
- Specified by:
publishin interfaceRedisDeferredCommands
-
randomkey
public void randomkey()
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/randomkey:
Available since 1.0.0.
Time complexity: O(1)
Return a random key from the currently selected database.
- Specified by:
randomkeyin interfaceRedisDeferredCommands
-
rename
public void rename(String key, String newkey)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/rename:
Available since 1.0.0.
Time complexity: O(1)
Renames
keytonewkey. It returns an error when the source and destination names are the same, or whenkeydoes not exist. Ifnewkeyalready exists it is overwritten, when this happensRedisDeferredCommands.rename(java.lang.String, java.lang.String)executes an implicitRedisDeferredCommands.del(java.lang.String, java.lang.String...)operation, so if the deleted key contains a very big value it may cause high latency even ifRedisDeferredCommands.rename(java.lang.String, java.lang.String)itself is usually a constant-time operation.- Specified by:
renamein interfaceRedisDeferredCommands- Parameters:
key- the old name.newkey- the new name.
-
renamenx
public void renamenx(String key, String newkey)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/renamenx:
Available since 1.0.0.
Time complexity: O(1)
Renames
keytonewkeyifnewkeydoes not yet exist. It returns an error under the same conditions asRedisDeferredCommands.rename(java.lang.String, java.lang.String).- Specified by:
renamenxin interfaceRedisDeferredCommands- Parameters:
key- the old name.newkey- the new name.
-
restore
public void restore(String key, long ttl, String serializedvalue)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/restore:
Available since 2.6.0.
Time complexity: O(1) to create the new key and additional O(N*M) to recostruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).
Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via
RedisDeferredCommands.dump(java.lang.String)).- Specified by:
restorein interfaceRedisDeferredCommands- Parameters:
key- the key to restore.ttl- the time-to-live in milliseconds.serializedvalue- the serialized value (from aRedisDeferredCommands.dump(java.lang.String)call).
-
sort
public void sort(String key, String pattern, SortOrder sortOrder, boolean alpha, Long limitOffset, Long limitCount, String storeKey, String... getPatterns)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sort:
Available since 1.0.0.
Time complexity: O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is currently O(N) as there is a copy step that will be avoided in next releases.
Returns or stores the elements contained in the list, set, or sorted set at
key. By default, sorting is numeric and elements are compared by their value interpreted as double precision floating point number.- Specified by:
sortin interfaceRedisDeferredCommands- Parameters:
key- the key to sort the contents of.pattern- if not null,sortOrder- if true, sort descending. if false or null, sort ascending.alpha- if true, sort lexicographically, not by a score.limitOffset- if not null, the starting offset into the list (0-based).limitCount- if not null, the amount of objects from the offset to sort. else, return all the way to the end.storeKey- if not null, this is the key to store the result in.getPatterns- the patterns for finding the sort score.
-
ttl
public void ttl(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/ttl:
Available since 1.0.0.
Time complexity: O(1)
Returns the remaining time to live of a key that has a timeout. This introspection capability allows a Redis client to check how many seconds a given key will continue to be part of the dataset.
- Specified by:
ttlin interfaceRedisDeferredCommands- Parameters:
key- the key to inspect.
-
type
public void type(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/type:
Available since 1.0.0.
Time complexity: O(1)
Returns the string representation of the type of the value stored at
key.- Specified by:
typein interfaceRedisDeferredCommands
-
append
public void append(String key, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/append:
Available since 2.0.0.
Time complexity: O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.
If
keyalready exists and is a string, this command appends thevalueat the end of the string. Ifkeydoes not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.- Specified by:
appendin interfaceRedisDeferredCommands
-
bitcount
public void bitcount(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/bitcount:
Available since 2.6.0.
Time complexity: O(N)
Count the number of set bits (population counting) in a string.
- Specified by:
bitcountin interfaceRedisDeferredCommands
-
bitcount
public void bitcount(String key, long start, long end)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/bitcount:
Available since 2.6.0.
Time complexity: O(N)
Count the number of set bits (population counting) in a string between a start and end bit.
- Specified by:
bitcountin interfaceRedisDeferredCommands
-
bitop
public void bitop(BitwiseOperation operation, String destkey, String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/bitop:
Available since 2.6.0.
Time complexity: O(N)
Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. equal to the size of the longest input string.
- Specified by:
bitopin interfaceRedisDeferredCommands
-
bitpos
public void bitpos(String key, long bit)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/bitpos:
Available since 2.8.7.
Time complexity: O(N)
Return the position of the first bit set to 1 or 0 in a string.
- Specified by:
bitposin interfaceRedisDeferredCommands
-
bitpos
public void bitpos(String key, long bit, Long start, Long end)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/bitpos:
Available since 2.8.7.
Time complexity: O(N)
Return the position of the first bit set to 1 or 0 in a string.
- Specified by:
bitposin interfaceRedisDeferredCommands
-
decr
public void decr(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/decr:
Available since 1.0.0.
Time complexity: O(1)
Decrements the number stored at
keyby one. If the key does not exist, it is set to0before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.- Specified by:
decrin interfaceRedisDeferredCommands
-
decrby
public void decrby(String key, long decrement)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/decrby:
Available since 1.0.0.
Time complexity: O(1)
Decrements the number stored at
keybydecrement. If the key does not exist, it is set to0before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.- Specified by:
decrbyin interfaceRedisDeferredCommands
-
get
public void get(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/get:
Available since 1.0.0.
Time complexity: O(1)
Get the value of
key. If the key does not exist the special valuenullis returned. An error is returned if the value stored atkeyis not a string, because GET only handles string values. does not exist.- Specified by:
getin interfaceRedisDeferredCommands
-
getbit
public void getbit(String key, long offset)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/getbit:
Available since 2.2.0.
Time complexity: O(1)
Returns the bit value at offset in the string value stored at key.
- Specified by:
getbitin interfaceRedisDeferredCommands
-
getrange
public void getrange(String key, long start, long end)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/getrange:
Available since 2.4.0.
Time complexity: O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. it is called
SUBSTRin Redis versions<= 2.0.- Specified by:
getrangein interfaceRedisDeferredCommands
-
getset
public void getset(String key, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/getset:
Available since 1.0.0.
Time complexity: O(1)
Atomically sets
keytovalueand returns the old value stored atkey. Returns an error whenkeyexists but does not hold a string value.- Specified by:
getsetin interfaceRedisDeferredCommands
-
getset
public void getset(String key, Number value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/getset:
Available since 1.0.0.
Time complexity: O(1)
Atomically sets
keytovalueand returns the old value stored atkey. Returns an error whenkeyexists but does not hold a string value.- Specified by:
getsetin interfaceRedisDeferredCommands
-
incr
public void incr(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/incr:
Available since 1.0.0.
Time complexity: O(1)
Increments the number stored at
keyby one. If the key does not exist, it is set to0before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.- Specified by:
incrin interfaceRedisDeferredCommands
-
incrby
public void incrby(String key, long increment)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/incrby:
Available since 1.0.0.
Time complexity: O(1)
Increments the number stored at
keybyincrement. If the key does not exist, it is set to0before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers.- Specified by:
incrbyin interfaceRedisDeferredCommands
-
incrbyfloat
public void incrbyfloat(String key, double increment)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/incrbyfloat:
Available since 2.6.0.
Time complexity: O(1)
Increment the string representing a floating point number stored at
keyby the specifiedincrement. If the key does not exist, it is set to0before performing the operation. An error is returned if one of the following conditions occur:- Specified by:
incrbyfloatin interfaceRedisDeferredCommands
-
mget
public void mget(String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/mget:
Available since 1.0.0.
Time complexity: O(N) where N is the number of keys to retrieve.
Returns the values of all specified keys. For every key that does not hold a string value or does not exist, the special value
nilis returned. Because of this, the operation never fails.- Specified by:
mgetin interfaceRedisDeferredCommands
-
mset
public void mset(String key, String value, String... keyValues)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/mset:
Available since 1.0.1.
Time complexity: O(N) where N is the number of keys to set.
Sets the given keys to their respective values.
MSETreplaces existing values with new values, just as regular SET. SeeRedisDeferredCommands.msetnx(java.lang.String, java.lang.String, java.lang.String...)if you don't want to overwrite existing values.- Specified by:
msetin interfaceRedisDeferredCommands
-
mset
public void mset(KeyValue<String,Object>... pairs)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.mset(String, String, String...), but takes key-value pairs.- Specified by:
msetin interfaceRedisDeferredCommands
-
msetnx
public void msetnx(String key, String value, String... keyValues)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/msetnx:
Available since 1.0.1.
Time complexity: O(N) where N is the number of keys to set.
Sets the given keys to their respective values.
MSETNXwill not perform any operation at all even if just a single key already exists.- Specified by:
msetnxin interfaceRedisDeferredCommands
-
msetnx
public void msetnx(KeyValue<String,Object>... pairs)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.msetnx(String, String, String...), but takes key-value pairs.- Specified by:
msetnxin interfaceRedisDeferredCommands
-
psetex
public void psetex(String key, long milliseconds, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/psetex:
Available since 2.6.0.
Time complexity: O(1)
PSETEXworks exactly likeRedisDeferredCommands.setex(String, long, String)with the sole difference that the expire time is specified in milliseconds instead of seconds.- Specified by:
psetexin interfaceRedisDeferredCommands
-
set
public void set(String key, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/set:
Available since 1.0.0.
Time complexity: O(1)
Set
keyto hold the stringvalue. Ifkeyalready holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successfulSEToperation.- Specified by:
setin interfaceRedisDeferredCommands
-
set
public void set(String key, Number value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/set:
Available since 1.0.0.
Time complexity: O(1)
Set
keyto hold the stringvalue. Ifkeyalready holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successfulSEToperation.- Specified by:
setin interfaceRedisDeferredCommands
-
setbit
public void setbit(String key, long offset, long value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/setbit:
Available since 2.2.0.
Time complexity: O(1)
Sets or clears the bit at offset in the string value stored at key.
- Specified by:
setbitin interfaceRedisDeferredCommands
-
setex
public void setex(String key, long seconds, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/setex:
Available since 2.0.0.
Time complexity: O(1)
Set
keyto hold the stringvalueand setkeyto timeout after a given number of seconds. This command is equivalent to executing the following commands:- Specified by:
setexin interfaceRedisDeferredCommands
-
setnx
public void setnx(String key, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/setnx:
Available since 1.0.0.
Time complexity: O(1)
Set
keyto hold stringvalueifkeydoes not exist. In that case, it is equal toRedisDeferredCommands.set(String, String). Whenkeyalready holds a value, no operation is performed.SETNXis short for "SET if N ot e X ists".- Specified by:
setnxin interfaceRedisDeferredCommands
-
setrange
public void setrange(String key, long offset, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/setrange:
Available since 2.2.0.
Time complexity: O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument.
Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. If the offset is larger than the current length of the string at key, the string is padded with zero-bytes to make offset fit. Non-existing keys are considered as empty strings, so this command will make sure it holds a string large enough to be able to set value at offset.
- Specified by:
setrangein interfaceRedisDeferredCommands
-
strlen
public void strlen(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/strlen:
Available since 2.2.0.
Time complexity: O(1)
Returns the length of the string value stored at
key. An error is returned whenkeyholds a non-string value.- Specified by:
strlenin interfaceRedisDeferredCommands
-
hdel
public void hdel(String key, String field, String... fields)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hdel:
Available since 2.0.0.
Time complexity: O(N) where N is the number of fields to be removed.
Removes the specified fields from the hash stored at
key. Specified fields that do not exist within this hash are ignored. Ifkeydoes not exist, it is treated as an empty hash and this command returns0. specified but non existing fields.- Specified by:
hdelin interfaceRedisDeferredCommands
-
hexists
public void hexists(String key, String field)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hexists:
Available since 2.0.0.
Time complexity: O(1)
Returns if
fieldis an existing field in the hash stored atkey.- Specified by:
hexistsin interfaceRedisDeferredCommands
-
hget
public void hget(String key, String field)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hget:
Available since 2.0.0.
Time complexity: O(1)
Returns the value associated with
fieldin the hash stored atkey. whenfieldis not present in the hash orkeydoes not exist.- Specified by:
hgetin interfaceRedisDeferredCommands
-
hgetall
public void hgetall(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hgetall:
Available since 2.0.0.
Time complexity: O(N) where N is the size of the hash.
Returns all fields and values of the hash stored at
key. In the returned value, every field name is followed by its value, so the length of the reply is twice the size of the hash. list whenkeydoes not exist.- Specified by:
hgetallin interfaceRedisDeferredCommands
-
hincrby
public void hincrby(String key, String field, long increment)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hincrby:
Available since 2.0.0.
Time complexity: O(1)
Increments the number stored at
fieldin the hash stored atkeybyincrement. Ifkeydoes not exist, a new key holding a hash is created. Iffielddoes not exist the value is set to0before the operation is performed.- Specified by:
hincrbyin interfaceRedisDeferredCommands
-
hincrbyfloat
public void hincrbyfloat(String key, String field, double increment)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hincrbyfloat:
Available since 2.6.0.
Time complexity: O(1)
Increment the specified
fieldof an hash stored atkey, and representing a floating point number, by the specifiedincrement. If the field does not exist, it is set to0before performing the operation.- Specified by:
hincrbyfloatin interfaceRedisDeferredCommands
-
hkeys
public void hkeys(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hkeys:
Available since 2.0.0.
Time complexity: O(N) where N is the size of the hash.
Returns all field names in the hash stored at
key.- Specified by:
hkeysin interfaceRedisDeferredCommands
-
hlen
public void hlen(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hlen:
Available since 2.0.0.
Time complexity: O(1)
Returns the number of fields contained in the hash stored at
key.- Specified by:
hlenin interfaceRedisDeferredCommands
-
hmget
public void hmget(String key, String field, String... fields)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hmget:
Available since 2.0.0.
Time complexity: O(N) where N is the number of fields being requested.
Returns the values associated with the specified
fieldsin the hash stored atkey.- Specified by:
hmgetin interfaceRedisDeferredCommands
-
hmset
public void hmset(String key, String field, String value, String... fieldvalues)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hmset:
Available since 2.0.0.
Time complexity: O(N) where N is the number of fields being set.
Sets the specified fields to their respective values in the hash stored at
key. This command overwrites any existing fields in the hash. Ifkeydoes not exist, a new key holding a hash is created.Parameters should alternate between field, value, field, value ...
- Specified by:
hmsetin interfaceRedisDeferredCommands
-
hmset
public void hmset(String key, Object field, Object value, Object... fieldvalues)
From http://redis.io/commands/hmset:
Available since 2.0.0.
Time complexity: O(N) where N is the number of fields being set.
Sets the specified fields to their respective values in the hash stored at
key. This command overwrites any existing fields in the hash. Ifkeydoes not exist, a new key holding a hash is created.Parameters should alternate between field, value, field, value ...
- Parameters:
key- the key to use.field- the first field.value- the first value.fieldvalues- the subsequent fields and values.
-
hmset
public void hmset(String key, KeyValue<String,Object>... pairs)
From http://redis.io/commands/hmset:
Available since 2.0.0.
Time complexity: O(N) where N is the number of fields being set.
Sets the specified fields to their respective values in the hash stored at
key. This command overwrites any existing fields in the hash. Ifkeydoes not exist, a new key holding a hash is created.- Parameters:
key- the key to use.pairs- the field-value pairs to set on the hash.
-
hset
public void hset(String key, String field, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hset:
Available since 2.0.0.
Time complexity: O(1)
Sets
fieldin the hash stored atkeytovalue. Ifkeydoes not exist, a new key holding a hash is created. Iffieldalready exists in the hash, it is overwritten.- Specified by:
hsetin interfaceRedisDeferredCommands
-
hset
public void hset(String key, String field, Number value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hset:
Available since 2.0.0.
Time complexity: O(1)
Sets
fieldin the hash stored atkeytovalue. Ifkeydoes not exist, a new key holding a hash is created. Iffieldalready exists in the hash, it is overwritten.- Specified by:
hsetin interfaceRedisDeferredCommands
-
hsetnx
public void hsetnx(String key, String field, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hsetnx:
Available since 2.0.0.
Time complexity: O(1)
Sets
fieldin the hash stored atkeytovalue, only iffielddoes not yet exist. Ifkeydoes not exist, a new key holding a hash is created. Iffieldalready exists, this operation has no effect.- Specified by:
hsetnxin interfaceRedisDeferredCommands
-
hsetnx
public void hsetnx(String key, String field, Number value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hsetnx:
Available since 2.0.0.
Time complexity: O(1)
Sets
fieldin the hash stored atkeytovalue, only iffielddoes not yet exist. Ifkeydoes not exist, a new key holding a hash is created. Iffieldalready exists, this operation has no effect.- Specified by:
hsetnxin interfaceRedisDeferredCommands
-
hvals
public void hvals(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/hvals:
Available since 2.0.0.
Time complexity: O(N) where N is the size of the hash.
Returns all values in the hash stored at
key.- Specified by:
hvalsin interfaceRedisDeferredCommands
-
blpop
public void blpop(long timeout, String key, String... keys)Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/blpop:
Available since 2.0.0.
Time complexity: O(1)
BLPOPis a blocking list pop primitive. It is the blocking version ofRedisDeferredCommands.lpop(String)because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the head of the first list that is non-empty, with the given keys being checked in the order that they are given. Atimeoutof zero can be used to block indefinitely. Timeout is in seconds.- Specified by:
blpopin interfaceRedisDeferredCommands
-
brpop
public void brpop(long timeout, String key, String... keys)Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/brpop:
Available since 2.0.0.
Time complexity: O(1)
BRPOPis a blocking list pop primitive. It is the blocking version ofRedisDeferredCommands.rpop(java.lang.String)because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given. Atimeoutof zero can be used to block indefinitely. Timeout is in seconds.- Specified by:
brpopin interfaceRedisDeferredCommands
-
brpoplpush
public void brpoplpush(long timeout, String source, String destination)Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/brpoplpush:
Available since 2.2.0.
Time complexity: O(1)
BRPOPLPUSHis the blocking variant ofRedisDeferredCommands.rpoplpush(String, String). Whensourcecontains elements, this command behaves exactly likeRedisDeferredCommands.rpoplpush(String, String). Whensourceis empty, Redis will block the connection until another client pushes to it or untiltimeoutis reached. Atimeoutof zero can be used to block indefinitely. Timeout is in seconds.- Specified by:
brpoplpushin interfaceRedisDeferredCommands
-
lindex
public void lindex(String key, long index)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/lindex:
Available since 1.0.0.
Time complexity: O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1).
Returns the element at index
indexin the list stored atkey. The index is zero-based, so0means the first element,1the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here,-1means the last element,-2means the penultimate and so forth.- Specified by:
lindexin interfaceRedisDeferredCommands
-
linsert
public void linsert(String key, boolean before, String pivot, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/linsert:
Available since 2.2.0.
Time complexity: O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N).
Inserts
valuein the list stored atkeyeither before or after the reference valuepivot. when the valuepivotwas not found.- Specified by:
linsertin interfaceRedisDeferredCommands
-
linsert
public void linsert(String key, boolean before, String pivot, Number value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/linsert:
Available since 2.2.0.
Time complexity: O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N).
Inserts
valuein the list stored atkeyeither before or after the reference valuepivot. when the valuepivotwas not found.- Specified by:
linsertin interfaceRedisDeferredCommands
-
llen
public void llen(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/llen:
Available since 1.0.0.
Time complexity: O(1)
Returns the length of the list stored at
key. Ifkeydoes not exist, it is interpreted as an empty list and0is returned. An error is returned when the value stored atkeyis not a list.- Specified by:
llenin interfaceRedisDeferredCommands
-
lpop
public void lpop(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/lpop:
Available since 1.0.0.
Time complexity: O(1)
Removes and returns the first element of the list stored at
key.- Specified by:
lpopin interfaceRedisDeferredCommands
-
lpush
public void lpush(String key, String value, String... values)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/lpush:
Available since 1.0.0.
Time complexity: O(1)
Insert all the specified values at the head of the list stored at
key. Ifkeydoes not exist, it is created as empty list before performing the push operations. Whenkeyholds a value that is not a list, an error is returned.- Specified by:
lpushin interfaceRedisDeferredCommands
-
lpushx
public void lpushx(String key, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/lpushx:
Available since 2.2.0.
Time complexity: O(1)
Inserts
valueat the head of the list stored atkey, only ifkeyalready exists and holds a list. In contrary toRedisDeferredCommands.lpush(java.lang.String, java.lang.String, java.lang.String...), no operation will be performed whenkeydoes not yet exist.- Specified by:
lpushxin interfaceRedisDeferredCommands
-
lrange
public void lrange(String key, long start, long stop)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/lrange:
Available since 1.0.0.
Time complexity: O(S+N) where S is the start offset and N is the number of elements in the specified range.
Returns the specified elements of the list stored at
key. The offsetsstartandstopare zero-based indexes, with0being the first element of the list (the head of the list),1being the next element and so on.- Specified by:
lrangein interfaceRedisDeferredCommands
-
lrem
public void lrem(String key, long count, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/lrem:
Available since 1.0.0.
Time complexity: O(N) where N is the length of the list.
Removes the first
countoccurrences of elements equal tovaluefrom the list stored atkey. Thecountargument influences the operation in the following ways:count > 0: Remove elements equal tovaluemoving from head to tail.count < 0: Remove elements equal tovaluemoving from tail to head.count = 0: Remove all elements equal tovalue.
- Specified by:
lremin interfaceRedisDeferredCommands
-
lset
public void lset(String key, long index, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/lset:
Available since 1.0.0.
Time complexity: O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1).
Sets the list element at
indextovalue. For more information on theindexargument, seeRedisDeferredCommands.lindex(String, long).- Specified by:
lsetin interfaceRedisDeferredCommands
-
ltrim
public void ltrim(String key, long start, long stop)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/ltrim:
Available since 1.0.0.
Time complexity: O(N) where N is the number of elements to be removed by the operation.
Trim an existing list so that it will contain only the specified range of elements specified. Both
startandstopare zero-based indexes, where0is the first element of the list (the head),1the next element and so on.- Specified by:
ltrimin interfaceRedisDeferredCommands
-
rpop
public void rpop(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/rpop:
Available since 1.0.0.
Time complexity: O(1)
Removes and returns the last element of the list stored at
key.- Specified by:
rpopin interfaceRedisDeferredCommands
-
rpoplpush
public void rpoplpush(String source, String destination)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/rpoplpush:
Available since 1.2.0.
Time complexity: O(1)
Atomically returns and removes the last element (tail) of the list stored at
source, and pushes the element at the first element (head) of the list stored atdestination.- Specified by:
rpoplpushin interfaceRedisDeferredCommands
-
rpush
public void rpush(String key, String value, String... values)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/rpush:
Available since 1.0.0.
Time complexity: O(1)
Insert all the specified values at the tail of the list stored at
key. Ifkeydoes not exist, it is created as empty list before performing the push operation. Whenkeyholds a value that is not a list, an error is returned.- Specified by:
rpushin interfaceRedisDeferredCommands
-
rpushx
public void rpushx(String key, String value)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/rpushx:
Available since 2.2.0.
Time complexity: O(1)
Inserts
valueat the tail of the list stored atkey, only ifkeyalready exists and holds a list. In contrary toRedisDeferredCommands.rpush(java.lang.String, java.lang.String, java.lang.String...), no operation will be performed whenkeydoes not yet exist.- Specified by:
rpushxin interfaceRedisDeferredCommands
-
eval
public void eval(String scriptContent, String[] keys, Object... args)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/eval:
Available since 2.6.0.
Time complexity: Depends on the script that is executed.
Evaluates a Lua script. The keys specified in
keysshould be used as a hint for Redis as to what keys are touched during the script call.- Specified by:
evalin interfaceRedisDeferredCommands
-
evalsha
public void evalsha(String hash, String[] keys, Object... args)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/evalsha:
Available since 2.6.0.
Time complexity: Depends on the script that is executed.
Evaluates a script cached on the server side by its SHA1 digest. Scripts are cached on the server side using the
RedisDeferredCommands.scriptLoad(String)command. The command is otherwise identical toRedisDeferredCommands.eval(String, String[], Object...).- Specified by:
evalshain interfaceRedisDeferredCommands
-
scriptExists
public void scriptExists(String scriptHash, String... scriptHashes)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/script-exists:
Available since 2.6.0.
Time complexity: O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).
Returns information about the existence of the scripts in the script cache. SHA1 digest arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, true is returned, otherwise false is returned.
- Specified by:
scriptExistsin interfaceRedisDeferredCommands
-
scriptFlush
public void scriptFlush()
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/script-flush:
Available since 2.6.0.
Time complexity: O(N) with N being the number of scripts in cache
Flush the Lua scripts cache.
- Specified by:
scriptFlushin interfaceRedisDeferredCommands
-
scriptKill
public void scriptKill(String hash)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/script-kill:
Available since 2.6.0.
Time complexity: O(1)
Kills the currently executing Lua script, assuming no write operation was yet performed by the script.
- Specified by:
scriptKillin interfaceRedisDeferredCommands
-
scriptLoad
public void scriptLoad(String content)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/script-load:
Available since 2.6.0.
Time complexity: O(N) with N being the length in bytes of the script body.
Load a script into the scripts cache, without executing it. After the specified command is loaded into the script cache it will be callable using
RedisDeferredCommands.evalsha(String, String[], Object...)with the correct SHA1 digest of the script, exactly like after the first successful invocation ofRedisDeferredCommands.eval(String, String[], Object...).- Specified by:
scriptLoadin interfaceRedisDeferredCommands
-
scriptLoad
public void scriptLoad(File content) throws IOException
From http://redis.io/commands/script-load:
Available since 2.6.0.
Time complexity: O(N) with N being the length in bytes of the script body.
Load a script into the scripts cache from the specified file without executing it. After the specified command is loaded into the script cache it will be callable using
evalsha(String, String[], Object...)with the correct SHA1 digest of the script, exactly like after the first successful invocation ofeval(String, String[], Object...).- Specified by:
scriptLoadin interfaceRedisDeferredCommands- Throws:
IOException
-
scriptLoad
public void scriptLoad(InputStream content) throws IOException
From http://redis.io/commands/script-load:
Available since 2.6.0.
Time complexity: O(N) with N being the length in bytes of the script body.
Load a script into the scripts cache from the specified input stream (until the end is reached) without executing it. The stream is not closed after read. After the specified command is loaded into the script cache it will be callable using
evalsha(String, String[], Object...)with the correct SHA1 digest of the script, exactly like after the first successful invocation ofeval(String, String[], Object...).- Specified by:
scriptLoadin interfaceRedisDeferredCommands- Throws:
IOException
-
sadd
public void sadd(String key, String member, String... members)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sadd:
Available since 1.0.0.
Time complexity: O(N) where N is the number of members to be added.
Add the specified members to the set stored at
key. Specified members that are already a member of this set are ignored. Ifkeydoes not exist, a new set is created before adding the specified members.- Specified by:
saddin interfaceRedisDeferredCommands
-
sadd
public void sadd(String key, Object member, Object... members)
From http://redis.io/commands/sadd:
Available since 1.0.0.
Time complexity: O(N) where N is the number of members to be added.
Add the specified members to the set stored at
key. Specified members that are already a member of this set are ignored. Ifkeydoes not exist, a new set is created before adding the specified members.- Specified by:
saddin interfaceRedisDeferredCommands
-
scard
public void scard(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/scard:
Available since 1.0.0.
Time complexity: O(1)
Returns the set cardinality (number of elements) of the set stored at
key.- Specified by:
scardin interfaceRedisDeferredCommands
-
sdiff
public void sdiff(String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sdiff:
Available since 1.0.0.
Time complexity: O(N) where N is the total number of elements in all given sets.
Returns the members of the set resulting from the difference between the first set and all the successive sets.
- Specified by:
sdiffin interfaceRedisDeferredCommands
-
sdiffstore
public void sdiffstore(String destination, String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sdiffstore:
Available since 1.0.0.
Time complexity: O(N) where N is the total number of elements in all given sets.
This command is equal to SDIFF, but instead of returning the resulting set, it is stored in
destination.- Specified by:
sdiffstorein interfaceRedisDeferredCommands
-
sinter
public void sinter(String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sinter:
Available since 1.0.0.
Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.
Returns the members of the set resulting from the intersection of all the given sets.
- Specified by:
sinterin interfaceRedisDeferredCommands
-
sinterstore
public void sinterstore(String destination, String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sinterstore:
Available since 1.0.0.
Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.
This command is equal to SINTER, but instead of returning the resulting set, it is stored in
destination.- Specified by:
sinterstorein interfaceRedisDeferredCommands
-
sismember
public void sismember(String key, String member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sismember:
Available since 1.0.0.
Time complexity: O(1)
Returns if
memberis a member of the set stored atkey.- Specified by:
sismemberin interfaceRedisDeferredCommands
-
sismember
public void sismember(String key, Number member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sismember:
Available since 1.0.0.
Time complexity: O(1)
Returns if
memberis a member of the set stored atkey.- Specified by:
sismemberin interfaceRedisDeferredCommands
-
smembers
public void smembers(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/smembers:
Available since 1.0.0.
Time complexity: O(N) where N is the set cardinality.
Returns all the members of the set value stored at
key.- Specified by:
smembersin interfaceRedisDeferredCommands
-
smove
public void smove(String source, String destination, String member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/smove:
Available since 1.0.0.
Time complexity: O(1)
Move
memberfrom the set atsourceto the set atdestination. This operation is atomic. In every given moment the element will appear to be a member ofsourceordestinationfor other clients.- Specified by:
smovein interfaceRedisDeferredCommands
-
spop
public void spop(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/spop:
Available since 1.0.0.
Time complexity: O(1)
Removes and returns a random element from the set value stored at
key.- Specified by:
spopin interfaceRedisDeferredCommands
-
srandmember
public void srandmember(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/srandmember:
Available since 1.0.0.
Time complexity: O(1).
When called with just the
keyargument, return a random element from the set value stored atkey.- Specified by:
srandmemberin interfaceRedisDeferredCommands
-
srandmember
public void srandmember(String key, long count)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/srandmember:
Available since 1.0.0.
Time complexity: O(N) where N is the absolute value of the passed count.
When called with just the
keyargument, return a random element from the set value stored atkey.- Specified by:
srandmemberin interfaceRedisDeferredCommands
-
srem
public void srem(String key, String member, String... members)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/srem:
Available since 1.0.0.
Time complexity: O(N) where N is the number of members to be removed.
Remove the specified members from the set stored at
key. Specified members that are not a member of this set are ignored. Ifkeydoes not exist, it is treated as an empty set and this command returns0.- Specified by:
sremin interfaceRedisDeferredCommands
-
srem
public void srem(String key, Object member, Object... members)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/srem:
Available since 1.0.0.
Time complexity: O(N) where N is the number of members to be removed.
Remove the specified members from the set stored at
key. Specified members that are not a member of this set are ignored. Ifkeydoes not exist, it is treated as an empty set and this command returns0.- Specified by:
sremin interfaceRedisDeferredCommands
-
sunion
public void sunion(String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sunion:
Available since 1.0.0.
Time complexity: O(N) where N is the total number of elements in all given sets.
Returns the members of the set resulting from the union of all the given sets.
- Specified by:
sunionin interfaceRedisDeferredCommands
-
sunionstore
public void sunionstore(String destination, String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/sunionstore:
Available since 1.0.0.
Time complexity: O(N) where N is the total number of elements in all given sets.
This command is equal to SUNION, but instead of returning the resulting set, it is stored in
destination.- Specified by:
sunionstorein interfaceRedisDeferredCommands
-
zadd
public void zadd(String key, double score, String member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zadd:
Available since 1.2.0.
Time complexity: O(log(N)) where N is the number of elements in the sorted set.
Adds all the specified members with the specified scores to the sorted set stored at
key. It is possible to specify multiple score/member pairs. If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering. Ifkeydoes not exist, a new sorted set with the specified members as sole members is created, like if the sorted set was empty. If the key exists but does not hold a sorted set, an error is returned.- Specified by:
zaddin interfaceRedisDeferredCommands
-
zadd
public void zadd(String key, double score, Number member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zadd:
Available since 1.2.0.
Time complexity: O(log(N)) where N is the number of elements in the sorted set.
Adds all the specified members with the specified scores to the sorted set stored at
key. It is possible to specify multiple score/member pairs. If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering. Ifkeydoes not exist, a new sorted set with the specified members as sole members is created, like if the sorted set was empty. If the key exists but does not hold a sorted set, an error is returned.- Specified by:
zaddin interfaceRedisDeferredCommands
-
zadd
public void zadd(String key, KeyValue<Double,String>... pairs)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zadd:
Available since 1.2.0.
Time complexity: O(log(N)) where N is the number of elements in the sorted set.
Adds all the specified members with the specified scores to the sorted set stored at
key. It is possible to specify multiple score/member pairs. If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering. Ifkeydoes not exist, a new sorted set with the specified members as sole members is created, like if the sorted set was empty. If the key exists but does not hold a sorted set, an error is returned.- Specified by:
zaddin interfaceRedisDeferredCommands
-
zcard
public void zcard(String key)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zcard:
Available since 1.2.0.
Time complexity: O(1)
Returns the sorted set cardinality (number of elements) of the sorted set stored at
key.- Specified by:
zcardin interfaceRedisDeferredCommands
-
zcount
public void zcount(String key, String min, String max)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zcount:
Available since 2.0.0.
Time complexity: O(log(N)) with N being the number of elements in the sorted set.
Returns the number of elements in the sorted set at
keywith a score betweenminandmax.The arguments
minandmaxare Strings so they can accept special ranges.- Specified by:
zcountin interfaceRedisDeferredCommands
-
zcount
public void zcount(String key, double min, double max)
Likezcount(String, String, String), except it accepts doubles for min and max, not strings.- Specified by:
zcountin interfaceRedisDeferredCommands
-
zincrby
public void zincrby(String key, double increment, String member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zincrby:
Available since 1.2.0.
Time complexity: O(log(N)) where N is the number of elements in the sorted set.
Increments the score of
memberin the sorted set stored atkeybyincrement. Ifmemberdoes not exist in the sorted set, it is added withincrementas its score (as if its previous score was0.0). Ifkeydoes not exist, a new sorted set with the specifiedmemberas its sole member is created.- Specified by:
zincrbyin interfaceRedisDeferredCommands
-
zrange
public void zrange(String key, long start, long stop, boolean withScores)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrange:
Available since 1.2.0.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
Returns the specified range of elements in the sorted set stored at
key. The elements are considered to be ordered from the lowest to the highest score. Lexicographical order is used for elements with equal score.- Specified by:
zrangein interfaceRedisDeferredCommands
-
zrangebyscore
public void zrangebyscore(String key, String min, String max, boolean withScores, Long limitOffset, Long limitCount)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrangebyscore:
Available since 1.0.5.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).
Returns all the elements in the sorted set at
keywith a score betweenminandmax(including elements with score equal tominormax). The elements are considered to be ordered from low to high scores.The optional
LIMITargument can be used to only get a range of the matching elements (similar to SELECT LIMIT offset, count in SQL). Keep in mind that ifoffsetis large, the sorted set needs to be traversed foroffsetelements before getting to the elements to return, which can add up to O(N) time complexity.The arguments
minandmaxare Strings so they can accept special ranges.- Specified by:
zrangebyscorein interfaceRedisDeferredCommands
-
zrangebyscore
public void zrangebyscore(String key, double min, double max, boolean withScores)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zrangebyscore(String, String, String, boolean), except it accepts doubles for min and max, not strings.- Specified by:
zrangebyscorein interfaceRedisDeferredCommands
-
zrangebyscore
public void zrangebyscore(String key, String min, String max, boolean withScores)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zrangebyscore(String, String, String, boolean, Long, Long), except specifies no limit.- Specified by:
zrangebyscorein interfaceRedisDeferredCommands
-
zrangebyscore
public void zrangebyscore(String key, double min, double max, boolean withScores, Long limitOffset, Long limitCount)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zrangebyscore(String, String, String, boolean, Long, Long), except it accepts doubles for min and max, not strings.- Specified by:
zrangebyscorein interfaceRedisDeferredCommands
-
zrank
public void zrank(String key, String member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrank:
Available since 2.0.0.
Time complexity: O(log(N))
Returns the rank of
memberin the sorted set stored atkey, with the scores ordered from low to high. The rank (or index) is 0-based, which means that the member with the lowest score has rank0. Ifmemberdoes not exist in the sorted set orkeydoes not exist,null.- Specified by:
zrankin interfaceRedisDeferredCommands
-
zrank
public void zrank(String key, Number member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrank:
Available since 2.0.0.
Time complexity: O(log(N))
Returns the rank of
memberin the sorted set stored atkey, with the scores ordered from low to high. The rank (or index) is 0-based, which means that the member with the lowest score has rank0. Ifmemberdoes not exist in the sorted set orkeydoes not exist,null.- Specified by:
zrankin interfaceRedisDeferredCommands
-
zrem
public void zrem(String key, String member, String... members)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrem:
Available since 1.2.0.
Time complexity: O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed.
Removes the specified members from the sorted set stored at
key. Non existing members are ignored.- Specified by:
zremin interfaceRedisDeferredCommands
-
zrem
public void zrem(String key, Number member, Number... members)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrem:
Available since 1.2.0.
Time complexity: O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed.
Removes the specified members from the sorted set stored at
key. Non existing members are ignored.- Specified by:
zremin interfaceRedisDeferredCommands
-
zremrangebyrank
public void zremrangebyrank(String key, long start, long stop)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zremrangebyrank:
Available since 2.0.0.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
Removes all elements in the sorted set stored at
keywith rank betweenstartandstop. Bothstartandstopare0-based indexes with0being the element with the lowest score. These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score. For example:-1is the element with the highest score,-2the element with the second highest score and so forth.- Specified by:
zremrangebyrankin interfaceRedisDeferredCommands
-
zremrangebyscore
public void zremrangebyscore(String key, String min, String max)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zremrangebyscore:
Available since 1.2.0.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
Removes all elements in the sorted set stored at
keywith a score betweenminandmax(inclusive).The arguments
minandmaxare Strings so they can accept special ranges.- Specified by:
zremrangebyscorein interfaceRedisDeferredCommands
-
zremrangebyscore
public void zremrangebyscore(String key, double min, double max)
Likezremrangebyscore(String, String, String), except it accepts doubles for min and max, not strings.- Specified by:
zremrangebyscorein interfaceRedisDeferredCommands
-
zrevrank
public void zrevrank(String key, String member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrevrank:
Available since 2.0.0.
Time complexity: O(log(N))
Returns the rank of
memberin the sorted set stored atkey, with the scores ordered from high to low. The rank (or index) is 0-based, which means that the member with the highest score has rank0. Ifmemberdoes not exist in the sorted set orkeydoes not exist,null.- Specified by:
zrevrankin interfaceRedisDeferredCommands
-
zrevrange
public void zrevrange(String key, long start, long stop, boolean withScores)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrevrange:
Available since 1.2.0.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
Returns the specified range of elements in the sorted set stored at
key. The elements are considered to be ordered from the highest to the lowest score. Descending lexicographical order is used for elements with equal score.- Specified by:
zrevrangein interfaceRedisDeferredCommands
-
zrevrangebyscore
public void zrevrangebyscore(String key, String min, String max, boolean withScores, Long limitOffset, Long limitCount)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrevrangebyscore:
Available since 2.2.0.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
Returns all the elements in the sorted set at key with a score between
maxandmin(including elements with score equal to max or min). In contrary to the default ordering of sorted sets, for this command the elements are considered to be ordered from high to low scores.The optional
LIMITargument can be used to only get a range of the matching elements (similar to SELECT LIMIT offset, count in SQL). Keep in mind that ifoffsetis large, the sorted set needs to be traversed foroffsetelements before getting to the elements to return, which can add up to O(N) time complexity.The arguments
minandmaxare Strings so they can accept special ranges.- Specified by:
zrevrangebyscorein interfaceRedisDeferredCommands
-
zrevrangebyscore
public void zrevrangebyscore(String key, double min, double max, boolean withScores)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zrevrangebyscore(String, String, String, boolean), except it accepts doubles for min and max, not strings.- Specified by:
zrevrangebyscorein interfaceRedisDeferredCommands
-
zrevrangebyscore
public void zrevrangebyscore(String key, String min, String max, boolean withScores)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zrevrangebyscore(String, String, String, boolean, Long, Long), except specifies no limit.- Specified by:
zrevrangebyscorein interfaceRedisDeferredCommands
-
zrevrangebyscore
public void zrevrangebyscore(String key, double min, double max, boolean withScores, Long limitOffset, Long limitCount)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zrevrangebyscore(String, String, String, boolean, Long, Long), except it accepts doubles for min and max, not strings.- Specified by:
zrevrangebyscorein interfaceRedisDeferredCommands
-
zscore
public void zscore(String key, String member)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zscore:
Available since 1.2.0.
Time complexity: O(1)
Returns the score of
memberin the sorted set atkey.- Specified by:
zscorein interfaceRedisDeferredCommands
-
zinterstore
public void zinterstore(String destination, double[] weights, Aggregation aggregation, String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zinterstore:
Available since 2.0.0.
Time complexity: O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.
Computes the intersection of
numkeyssorted sets given by the specified keys, and stores the result indestination. It is mandatory to provide the number of input keys (numkeys) before passing the input keys and the other (optional) arguments.- Specified by:
zinterstorein interfaceRedisDeferredCommands
-
zinterstore
public void zinterstore(String destination, Aggregation aggregation, String key, String... keys)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zinterstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores.Equivalent to:
zinterstore(destination, null, aggregation, key, keys)- Specified by:
zinterstorein interfaceRedisDeferredCommands
-
zinterstore
public void zinterstore(String destination, double[] weights, String key, String... keys)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zinterstore(String, double[], Aggregation, String, String...), except it does no aggregation of scores.Equivalent to:
zinterstore(destination, weights, null, key, keys)- Specified by:
zinterstorein interfaceRedisDeferredCommands
-
zinterstore
public void zinterstore(String destination, String key, String... keys)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zinterstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores, and does no aggregation of scores.Equivalent to:
zinterstore(destination, null, null, key, keys)- Specified by:
zinterstorein interfaceRedisDeferredCommands
-
zunionstore
public void zunionstore(String destination, double[] weights, Aggregation aggregation, String key, String... keys)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zunionstore:
Available since 2.0.0.
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.
Computes the union of
numkeyssorted sets given by the specified keys, and stores the result indestination. It is mandatory to provide the number of input keys (numkeys) before passing the input keys and the other (optional) arguments.- Specified by:
zunionstorein interfaceRedisDeferredCommands
-
zunionstore
public void zunionstore(String destination, Aggregation aggregation, String key, String... keys)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zunionstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores.Equivalent to:
zunionstore(destination, null, aggregation, key, keys)- Specified by:
zunionstorein interfaceRedisDeferredCommands
-
zunionstore
public void zunionstore(String destination, double[] weights, String key, String... keys)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zunionstore(String, double[], Aggregation, String, String...), except it does no aggregation of scores.Equivalent to:
zunionstore(destination, weights, null, key, keys)- Specified by:
zunionstorein interfaceRedisDeferredCommands
-
zunionstore
public void zunionstore(String destination, String key, String... keys)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zunionstore(String, double[], Aggregation, String, String...), except no weights are applied to the source value scores, and does no aggregation of scores.Equivalent to:
zunionstore(destination, null, null, key, keys)- Specified by:
zunionstorein interfaceRedisDeferredCommands
-
zlexcount
public void zlexcount(String key, String min, String max)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zlexcount:
Available since 2.8.9.
Time complexity: O(log(N)) with N being the number of elements in the sorted set.
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at
keywith a value betweenminandmax.The arguments
minandmaxare Strings so they can accept special ranges.- Specified by:
zlexcountin interfaceRedisDeferredCommands
-
zlexcount
public void zlexcount(String key, double min, double max)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zlexcount(String, String, String), except it accepts doubles for min and max, not strings.- Specified by:
zlexcountin interfaceRedisDeferredCommands
-
zrangebylex
public void zrangebylex(String key, String min, String max, Long limitOffset, Long limitCount)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zrangebylex:
Available since 2.8.9.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at
keywith a value betweenminandmax.The optional
LIMITargument can be used to only get a range of the matching elements (similar to SELECT LIMIT offset, count in SQL). Keep in mind that ifoffsetis large, the sorted set needs to be traversed foroffsetelements before getting to the elements to return, which can add up to O(N) time complexity.The arguments
minandmaxare Strings so they can accept special ranges.- Specified by:
zrangebylexin interfaceRedisDeferredCommands
-
zrangebylex
public void zrangebylex(String key, double min, double max, Long limitOffset, Long limitCount)
Likezrangebylex(String, String, String, Long, Long), except it accepts doubles for min and max, not strings.- Specified by:
zrangebylexin interfaceRedisDeferredCommands
-
zrangebylex
public void zrangebylex(String key, String min, String max)
Likezrangebylex(String, String, String, Long, Long), with no limit.- Specified by:
zrangebylexin interfaceRedisDeferredCommands
-
zrangebylex
public void zrangebylex(String key, double min, double max)
Likezrangebylex(String, String, String), except it accepts doubles for min and max, not strings, with no limit.- Specified by:
zrangebylexin interfaceRedisDeferredCommands
-
zremrangebylex
public void zremrangebylex(String key, String min, String max)
Description copied from interface:RedisDeferredCommandsFrom http://redis.io/commands/zremrangebylex:
Available since 2.8.9.
Time complexity: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation.
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at
keybetween the lexicographical range specified byminandmax.The arguments
minandmaxare Strings so they can accept special ranges.- Specified by:
zremrangebylexin interfaceRedisDeferredCommands
-
zremrangebylex
public void zremrangebylex(String key, double min, double max)
Description copied from interface:RedisDeferredCommandsLikeRedisDeferredCommands.zrangebylex(String, String, String), except it accepts doubles for min and max.- Specified by:
zremrangebylexin interfaceRedisDeferredCommands
-
specialDouble
protected String specialDouble(double d)
Converts some of Java's primitive doubles to Redis interval values.Double.NEGATIVE_INFINITYconverts to "-".Double.POSITIVE_INFINITYconverts to "+".- All others convert to their string representation.
- Parameters:
d- the input double.- Returns:
- the string representation of the value.
-
-