public class Jedis extends java.lang.Object implements ServerCommands, DatabaseCommands, JedisCommands, JedisBinaryCommands, ControlCommands, ControlBinaryCommands, ClusterCommands, ModuleCommands, GenericControlCommands, SentinelCommands, java.io.Closeable
Modifier and Type | Field and Description |
---|---|
protected Connection |
connection |
protected static byte[][] |
DUMMY_ARRAY |
Constructor and Description |
---|
Jedis() |
Jedis(Connection connection) |
Jedis(HostAndPort hp) |
Jedis(HostAndPort hostPort,
JedisClientConfig config) |
Jedis(JedisSocketFactory jedisSocketFactory) |
Jedis(JedisSocketFactory jedisSocketFactory,
JedisClientConfig clientConfig) |
Jedis(java.lang.String url)
This constructor only accepts a URI string.
|
Jedis(java.lang.String host,
int port) |
Jedis(java.lang.String host,
int port,
boolean ssl) |
Jedis(java.lang.String host,
int port,
boolean ssl,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.lang.String host,
int port,
int timeout) |
Jedis(java.lang.String host,
int port,
int timeout,
boolean ssl) |
Jedis(java.lang.String host,
int port,
int timeout,
boolean ssl,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.lang.String host,
int port,
int connectionTimeout,
int soTimeout) |
Jedis(java.lang.String host,
int port,
int connectionTimeout,
int soTimeout,
boolean ssl) |
Jedis(java.lang.String host,
int port,
int connectionTimeout,
int soTimeout,
boolean ssl,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.lang.String host,
int port,
int connectionTimeout,
int soTimeout,
int infiniteSoTimeout) |
Jedis(java.lang.String host,
int port,
int connectionTimeout,
int soTimeout,
int infiniteSoTimeout,
boolean ssl,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.lang.String host,
int port,
JedisClientConfig config) |
Jedis(java.net.URI uri) |
Jedis(java.net.URI uri,
int timeout) |
Jedis(java.net.URI uri,
int connectionTimeout,
int soTimeout) |
Jedis(java.net.URI uri,
int connectionTimeout,
int soTimeout,
int infiniteSoTimeout,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.net.URI uri,
int connectionTimeout,
int soTimeout,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.net.URI uri,
int timeout,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.net.URI uri,
JedisClientConfig config) |
Jedis(java.net.URI uri,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
aclCat()
Show the available ACL categories.
|
java.util.List<byte[]> |
aclCat(byte[] category)
Show the available ACLs for a given category.
|
java.util.List<java.lang.String> |
aclCat(java.lang.String category)
Show the available ACLs for a given category.
|
java.util.List<byte[]> |
aclCatBinary()
Show the available ACL categories.
|
long |
aclDelUser(byte[]... names)
Delete the specified user, from the ACL.
|
long |
aclDelUser(java.lang.String... names)
Delete the specified user, from the ACL.
|
java.lang.String |
aclDryRun(java.lang.String username,
CommandArguments commandArgs) |
java.lang.String |
aclDryRun(java.lang.String username,
java.lang.String command,
java.lang.String... args) |
byte[] |
aclDryRunBinary(byte[] username,
byte[] command,
byte[]... args) |
byte[] |
aclDryRunBinary(byte[] username,
CommandArguments commandArgs) |
java.lang.String |
aclGenPass()
Generate a random password
|
java.lang.String |
aclGenPass(int bits)
Generate a random password
|
byte[] |
aclGenPassBinary()
Generate a random password
|
byte[] |
aclGenPassBinary(int bits)
Generate a random password
|
AccessControlUser |
aclGetUser(byte[] name)
The command returns all the rules defined for an existing ACL user.
|
AccessControlUser |
aclGetUser(java.lang.String name)
The command returns all the rules defined for an existing ACL user.
|
java.util.List<java.lang.String> |
aclList()
Returns the currently active ACL rules on the Redis Server
|
java.util.List<byte[]> |
aclListBinary()
Returns the currently active ACL rules on the Redis Server
|
java.lang.String |
aclLoad()
This function tells Redis to reload its external ACL rules,
when Redis is configured with an external ACL file
|
java.util.List<AccessControlLogEntry> |
aclLog()
Shows the recent ACL security events.
|
java.util.List<AccessControlLogEntry> |
aclLog(int limit)
Shows the recent limit ACL security events.
|
java.util.List<byte[]> |
aclLogBinary()
Shows the recent ACL security events.
|
java.util.List<byte[]> |
aclLogBinary(int limit)
Shows the recent limit ACL security events.
|
java.lang.String |
aclLogReset()
Reset the script event log
|
java.lang.String |
aclSave()
Save the currently defined in-memory ACL to disk.
|
java.lang.String |
aclSetUser(byte[] name)
Create an ACL for the specified user with the default rules.
|
java.lang.String |
aclSetUser(byte[] name,
byte[]... rules)
Create an ACL for the specified user, while specifying the rules.
|
java.lang.String |
aclSetUser(java.lang.String name)
Create an ACL for the specified user with the default rules.
|
java.lang.String |
aclSetUser(java.lang.String name,
java.lang.String... rules)
Create an ACL for the specified user, while specifying the rules.
|
java.util.List<java.lang.String> |
aclUsers()
Shows a list of all usernames currently configured with access control
lists (ACL).
|
java.util.List<byte[]> |
aclUsersBinary()
Shows a list of all usernames currently configured with access control
lists (ACL).
|
java.lang.String |
aclWhoAmI()
Returns the username used to authenticate the current connection.
|
byte[] |
aclWhoAmIBinary()
Returns the username used to authenticate the current connection.
|
long |
append(byte[] key,
byte[] value)
If the key already exists and is a string, this command appends the provided value at the end
of the string.
|
long |
append(java.lang.String key,
java.lang.String value)
If the key already exists and is a string, this command appends the provided value at the end
of the string.
|
java.lang.String |
asking() |
java.lang.String |
auth(java.lang.String password)
Request for authentication in a password protected Redis server.
|
java.lang.String |
auth(java.lang.String user,
java.lang.String password)
Request for authentication with a Redis Server that is using ACL where user are authenticated with
username and password.
|
java.lang.String |
bgrewriteaof()
Rewrite the append only file in background when it gets too big.
|
java.lang.String |
bgsave()
Asynchronously save the DB on disk.
|
java.lang.String |
bgsaveSchedule() |
long |
bitcount(byte[] key) |
long |
bitcount(byte[] key,
long start,
long end) |
long |
bitcount(byte[] key,
long start,
long end,
BitCountOption option) |
long |
bitcount(java.lang.String key)
Bitcount Command
Count the number of set bits (population counting) in a string.
|
long |
bitcount(java.lang.String key,
long start,
long end)
Bitcount Command
Count the number of set bits (population counting) in a string only in an interval start and end.
|
long |
bitcount(java.lang.String key,
long start,
long end,
BitCountOption option) |
java.util.List<java.lang.Long> |
bitfield(byte[] key,
byte[]... arguments) |
java.util.List<java.lang.Long> |
bitfield(java.lang.String key,
java.lang.String... arguments)
Bitfield Command
The command treats a Redis string as an array of bits, and is capable of addressing specific integer
fields of varying bit widths and arbitrary non (necessary) aligned offset.
|
java.util.List<java.lang.Long> |
bitfieldReadonly(byte[] key,
byte[]... arguments) |
java.util.List<java.lang.Long> |
bitfieldReadonly(java.lang.String key,
java.lang.String... arguments)
The readonly version of
BITFIELD |
long |
bitop(BitOP op,
byte[] destKey,
byte[]... srcKeys) |
long |
bitop(BitOP op,
java.lang.String destKey,
java.lang.String... srcKeys)
Bitop Command
Perform a bitwise operation between multiple keys (containing string values) and store the result in the destKey.
|
long |
bitpos(byte[] key,
boolean value) |
long |
bitpos(byte[] key,
boolean value,
BitPosParams params) |
long |
bitpos(java.lang.String key,
boolean value)
Bitpos Command
Return the position of the first bit set to 1 or 0 in a string.
|
long |
bitpos(java.lang.String key,
boolean value,
BitPosParams params)
Bitpos Command
Return the position of the first bit set to 1 or 0 in a string.
|
byte[] |
blmove(byte[] srcKey,
byte[] dstKey,
ListDirection from,
ListDirection to,
double timeout)
Pop an element from a list, push it to another list and return it; or block until one is available
|
java.lang.String |
blmove(java.lang.String srcKey,
java.lang.String dstKey,
ListDirection from,
ListDirection to,
double timeout)
Pop an element from a list, push it to another list and return it; or block until one is available
|
KeyValue<byte[],java.util.List<byte[]>> |
blmpop(double timeout,
ListDirection direction,
byte[]... keys) |
KeyValue<byte[],java.util.List<byte[]>> |
blmpop(double timeout,
ListDirection direction,
int count,
byte[]... keys) |
KeyValue<java.lang.String,java.util.List<java.lang.String>> |
blmpop(double timeout,
ListDirection direction,
int count,
java.lang.String... keys) |
KeyValue<java.lang.String,java.util.List<java.lang.String>> |
blmpop(double timeout,
ListDirection direction,
java.lang.String... keys) |
KeyValue<byte[],byte[]> |
blpop(double timeout,
byte[]... keys) |
KeyValue<java.lang.String,java.lang.String> |
blpop(double timeout,
java.lang.String... keys)
The blocking version of
ListCommands.lpop(String) LPOP} because it blocks the connection
when there are no elements to pop from any of the given lists. |
KeyValue<java.lang.String,java.lang.String> |
blpop(double timeout,
java.lang.String key) |
java.util.List<byte[]> |
blpop(int timeout,
byte[]... keys)
BLPOP (and BRPOP) is a blocking list pop primitive.
|
java.util.List<java.lang.String> |
blpop(int timeout,
java.lang.String... keys)
BLPOP (and BRPOP) is a blocking list pop primitive.
|
java.util.List<java.lang.String> |
blpop(int timeout,
java.lang.String key) |
KeyValue<byte[],byte[]> |
brpop(double timeout,
byte[]... keys) |
KeyValue<java.lang.String,java.lang.String> |
brpop(double timeout,
java.lang.String... keys)
The blocking version of
ListCommands.rpop(String) RPOP} because it blocks the connection
when there are no elements to pop from any of the given lists. |
KeyValue<java.lang.String,java.lang.String> |
brpop(double timeout,
java.lang.String key) |
java.util.List<byte[]> |
brpop(int timeout,
byte[]... keys)
BLPOP (and BRPOP) is a blocking list pop primitive.
|
java.util.List<java.lang.String> |
brpop(int timeout,
java.lang.String... keys)
BLPOP (and BRPOP) is a blocking list pop primitive.
|
java.util.List<java.lang.String> |
brpop(int timeout,
java.lang.String key) |
byte[] |
brpoplpush(byte[] source,
byte[] destination,
int timeout)
Pop a value from a list, push it to another list and return it; or block until one is available
|
java.lang.String |
brpoplpush(java.lang.String source,
java.lang.String destination,
int timeout)
Pop a value from a list, push it to another list and return it; or block until one is available
|
KeyValue<byte[],java.util.List<Tuple>> |
bzmpop(double timeout,
SortedSetOption option,
byte[]... keys) |
KeyValue<byte[],java.util.List<Tuple>> |
bzmpop(double timeout,
SortedSetOption option,
int count,
byte[]... keys) |
KeyValue<java.lang.String,java.util.List<Tuple>> |
bzmpop(double timeout,
SortedSetOption option,
int count,
java.lang.String... keys) |
KeyValue<java.lang.String,java.util.List<Tuple>> |
bzmpop(double timeout,
SortedSetOption option,
java.lang.String... keys) |
KeyValue<byte[],Tuple> |
bzpopmax(double timeout,
byte[]... keys) |
KeyValue<java.lang.String,Tuple> |
bzpopmax(double timeout,
java.lang.String... keys)
The blocking version of
ZPOPMAX |
KeyValue<byte[],Tuple> |
bzpopmin(double timeout,
byte[]... keys) |
KeyValue<java.lang.String,Tuple> |
bzpopmin(double timeout,
java.lang.String... keys)
The blocking version of
ZPOPMIN |
protected void |
checkIsInMultiOrPipeline() |
java.lang.String |
clientGetname()
Returns the name of the current connection as set by CLIENT SETNAME
|
byte[] |
clientGetnameBinary()
Returns the name of the current connection as set by CLIENT SETNAME
|
long |
clientId()
Returns the ID of the current connection.
|
java.lang.String |
clientInfo()
Returns information and statistics about the current client connection
in a mostly human-readable format.
|
byte[] |
clientInfoBinary()
Returns information and statistics about the current client connection
in a mostly human-readable format.
|
java.lang.String |
clientKill(byte[] ipPort)
Close a given client connection.
|
long |
clientKill(ClientKillParams params)
Close a given client connection.
|
java.lang.String |
clientKill(java.lang.String ipPort)
Close a given client connection.
|
java.lang.String |
clientKill(java.lang.String ip,
int port)
Close a given client connection.
|
java.lang.String |
clientList()
Returns information and statistics about the client connections server
in a mostly human-readable format.
|
java.lang.String |
clientList(ClientType type)
Returns information and statistics about the client connections server
in a mostly human-readable format filter by client type.
|
java.lang.String |
clientList(long... clientIds)
Returns information and statistics about the client connections server
in a mostly human-readable format filter by client ids.
|
byte[] |
clientListBinary()
Returns information and statistics about the client connections server
in a mostly human-readable format.
|
byte[] |
clientListBinary(ClientType type)
Returns information and statistics about the client connections server
in a mostly human-readable format filter by client type.
|
byte[] |
clientListBinary(long... clientIds)
Returns information and statistics about the client connections server
in a mostly human-readable format filter by client ids.
|
java.lang.String |
clientNoEvictOff()
Turn off the client eviction mode for the current connection.
|
java.lang.String |
clientNoEvictOn()
Turn on the client eviction mode for the current connection.
|
java.lang.String |
clientNoTouchOff()
Turn off CLIENT NO-TOUCH
|
java.lang.String |
clientNoTouchOn()
Turn on CLIENT NO-TOUCH
|
java.lang.String |
clientPause(long timeout)
A connections control command able to suspend all the
Redis clients for the specified amount of time (in milliseconds)
|
java.lang.String |
clientPause(long timeout,
ClientPauseMode mode)
A connections control command able to suspend all the
Redis clients for the specified amount of time (in milliseconds)
|
java.lang.String |
clientSetInfo(ClientAttributeOption attr,
byte[] value)
client set info command
Since redis 7.2
|
java.lang.String |
clientSetInfo(ClientAttributeOption attr,
java.lang.String value)
client set info command
Since redis 7.2
|
java.lang.String |
clientSetname(byte[] name)
Assigns a name to the current connection.
|
java.lang.String |
clientSetname(java.lang.String name)
Assigns a name to the current connection.
|
long |
clientUnblock(long clientId)
Unblock a connection blocked in a blocking command from a different connection.
|
long |
clientUnblock(long clientId,
UnblockType unblockType)
Unblock a connection blocked in a blocking command from a different connection.
|
java.lang.String |
clientUnpause()
CLIENT UNPAUSE is used to resume command processing for all clients that were paused by CLIENT PAUSE.
|
void |
close() |
java.lang.String |
clusterAddSlots(int... slots) |
java.lang.String |
clusterAddSlotsRange(int... ranges)
Takes a list of slot ranges (specified by start and end slots) to assign to the node
|
java.lang.String |
clusterBumpEpoch()
Advance the cluster config epoch.
|
long |
clusterCountFailureReports(java.lang.String nodeId) |
long |
clusterCountKeysInSlot(int slot) |
java.lang.String |
clusterDelSlots(int... slots) |
java.lang.String |
clusterDelSlotsRange(int... ranges)
Takes a list of slot ranges (specified by start and end slots) to remove to the node.
|
java.lang.String |
clusterFailover() |
java.lang.String |
clusterFailover(ClusterFailoverOption failoverOption) |
java.lang.String |
clusterFlushSlots() |
java.lang.String |
clusterForget(java.lang.String nodeId) |
java.util.List<java.lang.String> |
clusterGetKeysInSlot(int slot,
int count) |
java.util.List<byte[]> |
clusterGetKeysInSlotBinary(int slot,
int count) |
java.lang.String |
clusterInfo() |
long |
clusterKeySlot(java.lang.String key) |
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
clusterLinks()
return the information of all such peer links as an array, where each array element is a map that contains
attributes and their values for an individual link.
|
java.lang.String |
clusterMeet(java.lang.String ip,
int port) |
java.lang.String |
clusterMyId() |
java.lang.String |
clusterMyShardId() |
java.lang.String |
clusterNodes() |
java.util.List<java.lang.String> |
clusterReplicas(java.lang.String nodeId) |
java.lang.String |
clusterReplicate(java.lang.String nodeId) |
java.lang.String |
clusterReset() |
java.lang.String |
clusterReset(ClusterResetType resetType)
resetType can be null for default behavior. |
java.lang.String |
clusterSaveConfig() |
java.lang.String |
clusterSetConfigEpoch(long configEpoch)
Set a specific config epoch in a fresh node.
|
java.lang.String |
clusterSetSlotImporting(int slot,
java.lang.String nodeId) |
java.lang.String |
clusterSetSlotMigrating(int slot,
java.lang.String nodeId) |
java.lang.String |
clusterSetSlotNode(int slot,
java.lang.String nodeId) |
java.lang.String |
clusterSetSlotStable(int slot) |
java.util.List<java.lang.String> |
clusterSlaves(java.lang.String nodeId)
Deprecated.
|
java.util.List<java.lang.Object> |
clusterSlots() |
long |
commandCount() |
java.util.Map<java.lang.String,CommandDocument> |
commandDocs(java.lang.String... commands) |
java.util.List<java.lang.String> |
commandGetKeys(java.lang.String... command) |
java.util.List<KeyValue<java.lang.String,java.util.List<java.lang.String>>> |
commandGetKeysAndFlags(java.lang.String... command) |
java.util.Map<java.lang.String,CommandInfo> |
commandInfo(java.lang.String... commands) |
java.util.List<java.lang.String> |
commandList() |
java.util.List<java.lang.String> |
commandListFilterBy(CommandListFilterByParams filterByParams) |
java.util.Map<byte[],byte[]> |
configGet(byte[]... patterns)
Used to read the configuration parameters of Redis server.
|
java.util.Map<byte[],byte[]> |
configGet(byte[] pattern)
Retrieve the configuration of a running Redis server.
|
java.util.Map<java.lang.String,java.lang.String> |
configGet(java.lang.String... patterns)
Used to read the configuration parameters of Redis server.
|
java.util.Map<java.lang.String,java.lang.String> |
configGet(java.lang.String pattern)
Retrieve the configuration of a running Redis server.
|
java.lang.String |
configResetStat()
Reset the stats returned by INFO
|
java.lang.String |
configRewrite()
The CONFIG REWRITE command rewrites the redis.conf file the server was started with, applying
the minimal changes needed to make it reflect the configuration currently used by the server,
which may be different compared to the original one because of the use of the CONFIG SET
command.
|
java.lang.String |
configSet(byte[]... parameterValues) |
java.lang.String |
configSet(byte[] parameter,
byte[] value)
Alter the configuration of a running Redis server.
|
java.lang.String |
configSet(java.util.Map<java.lang.String,java.lang.String> parameterValues) |
java.lang.String |
configSet(java.lang.String... parameterValues) |
java.lang.String |
configSet(java.lang.String parameter,
java.lang.String value)
Alter the configuration of a running Redis server.
|
java.lang.String |
configSetBinary(java.util.Map<byte[],byte[]> parameterValues) |
void |
connect() |
boolean |
copy(byte[] srcKey,
byte[] dstKey,
boolean replace)
COPY source destination [DB destination-db] [REPLACE]
|
boolean |
copy(byte[] srcKey,
byte[] dstKey,
int db,
boolean replace)
COPY source destination [DB destination-db] [REPLACE]
|
boolean |
copy(java.lang.String srcKey,
java.lang.String dstKey,
boolean replace)
COPY source destination [REPLACE]
|
boolean |
copy(java.lang.String srcKey,
java.lang.String dstKey,
int db,
boolean replace)
COPY source destination [DB destination-db] [REPLACE]
|
long |
dbSize()
Return the number of keys in the currently selected database.
|
long |
decr(byte[] key)
Decrement the number stored at key by one.
|
long |
decr(java.lang.String key)
Decrement the number stored at key by one.
|
long |
decrBy(byte[] key,
long decrement)
DECRBY work just like
DECR but instead to decrement by 1 the
decrement is integer. |
long |
decrBy(java.lang.String key,
long decrement)
IDECRBY work just like
INCR but instead to decrement by 1 the
decrement is integer. |
long |
del(byte[]... keys)
Remove the specified keys.
|
long |
del(byte[] key) |
long |
del(java.lang.String... keys)
Remove the specified keys.
|
long |
del(java.lang.String key)
Del Command
Remove the specified key.
|
void |
disconnect()
Closing the socket will disconnect the server connection.
|
byte[] |
dump(byte[] key) |
byte[] |
dump(java.lang.String key)
Dump Command
Serialize the value stored at key in a Redis-specific format and return it to the user.
|
byte[] |
echo(byte[] string) |
java.lang.String |
echo(java.lang.String string) |
java.lang.Object |
eval(byte[] script) |
java.lang.Object |
eval(byte[] script,
int keyCount,
byte[]... params) |
java.lang.Object |
eval(byte[] script,
java.util.List<byte[]> keys,
java.util.List<byte[]> args)
Evaluates scripts using the Lua interpreter built into Redis starting from version 2.6.0.
|
java.lang.Object |
eval(java.lang.String script)
Eval Command
Use to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.
|
java.lang.Object |
eval(java.lang.String script,
int keyCount,
java.lang.String... params)
Eval Command
Use to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.
|
java.lang.Object |
eval(java.lang.String script,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
Eval Command
Use to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.
|
java.lang.Object |
evalReadonly(byte[] script,
java.util.List<byte[]> keys,
java.util.List<byte[]> args) |
java.lang.Object |
evalReadonly(java.lang.String script,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
Readonly version of
EVAL |
java.lang.Object |
evalsha(byte[] sha1) |
java.lang.Object |
evalsha(byte[] sha1,
int keyCount,
byte[]... params) |
java.lang.Object |
evalsha(byte[] sha1,
java.util.List<byte[]> keys,
java.util.List<byte[]> args) |
java.lang.Object |
evalsha(java.lang.String sha1)
EvalSha Command
Similar to
EVAL , but the script cached on the server
side by its SHA1 digest. |
java.lang.Object |
evalsha(java.lang.String sha1,
int keyCount,
java.lang.String... params)
EvalSha Command
Similar to
ScriptingKeyCommands.eval(String, int, String...) EVAL}, but the script cached on the server
side by its SHA1 digest. |
java.lang.Object |
evalsha(java.lang.String sha1,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
EvalSha Command
Similar to
ScriptingKeyCommands.eval(String, List, List) EVAL}, but the script cached on the server
side by its SHA1 digest. |
java.lang.Object |
evalshaReadonly(byte[] sha1,
java.util.List<byte[]> keys,
java.util.List<byte[]> args) |
java.lang.Object |
evalshaReadonly(java.lang.String sha1,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
Readonly version of
EVAL |
long |
exists(byte[]... keys)
Test if the specified keys exist.
|
boolean |
exists(byte[] key)
Test if the specified key exists.
|
long |
exists(java.lang.String... keys)
Test if the specified keys exist.
|
boolean |
exists(java.lang.String key)
Test if the specified key exists.
|
long |
expire(byte[] key,
long seconds)
Set a timeout on the specified key.
|
long |
expire(byte[] key,
long seconds,
ExpiryOption expiryOption) |
long |
expire(java.lang.String key,
long seconds)
Set a timeout on the specified key.
|
long |
expire(java.lang.String key,
long seconds,
ExpiryOption expiryOption)
Similar to
EXPIRE but with optional expiry setting. |
long |
expireAt(byte[] key,
long unixTime)
EXPIREAT works exactly like
EXPIRE but instead to get the
number of seconds representing the Time To Live of the key as a second argument (that is a
relative way of specifying the TTL), it takes an absolute one in the form of a UNIX timestamp
(Number of seconds elapsed since 1 Gen 1970). |
long |
expireAt(byte[] key,
long unixTime,
ExpiryOption expiryOption) |
long |
expireAt(java.lang.String key,
long unixTime)
EXPIREAT works exactly like
EXPIRE but instead to get the
number of seconds representing the Time To Live of the key as a second argument (that is a
relative way of specifying the TTL), it takes an absolute one in the form of a UNIX timestamp
(Number of seconds elapsed since 1 Gen 1970). |
long |
expireAt(java.lang.String key,
long unixTime,
ExpiryOption expiryOption)
Similar to
EXPIREAT but with ExpiryOption . |
long |
expireTime(byte[] key) |
long |
expireTime(java.lang.String key)
Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire.
|
java.lang.String |
failover() |
java.lang.String |
failover(FailoverParams failoverParams) |
java.lang.String |
failoverAbort() |
java.lang.Object |
fcall(byte[] name,
java.util.List<byte[]> keys,
java.util.List<byte[]> args)
Invoke a function.
|
java.lang.Object |
fcall(java.lang.String name,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
Invoke a function.
|
java.lang.Object |
fcallReadonly(byte[] name,
java.util.List<byte[]> keys,
java.util.List<byte[]> args) |
java.lang.Object |
fcallReadonly(java.lang.String name,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
This is a read-only variant of the
FCALL
command that cannot execute commands that modify data. |
java.lang.String |
flushAll()
Delete all the keys of all the existing databases, not just the currently selected one.
|
java.lang.String |
flushAll(FlushMode flushMode)
Delete all the keys of all the existing databases, not just the currently selected one.
|
java.lang.String |
flushDB()
Delete all the keys of the currently selected DB.
|
java.lang.String |
flushDB(FlushMode flushMode)
Delete all the keys of the currently selected DB.
|
java.lang.String |
functionDelete(byte[] libraryName)
This command deletes the library called library-name and all functions in it.
|
java.lang.String |
functionDelete(java.lang.String libraryName)
This command deletes the library called library-name and all functions in it.
|
byte[] |
functionDump()
Return the serialized payload of loaded libraries.
|
java.lang.String |
functionFlush()
Deletes all the libraries, unless called with the optional mode argument, the
'lazyfree-lazy-user-flush' configuration directive sets the effective behavior.
|
java.lang.String |
functionFlush(FlushMode mode)
Deletes all the libraries, unless called with the optional mode argument, the
'lazyfree-lazy-user-flush' configuration directive sets the effective behavior.
|
java.lang.String |
functionKill()
Kill a function that is currently executing.
|
java.util.List<LibraryInfo> |
functionList()
Return information about the functions and libraries.
|
java.util.List<java.lang.Object> |
functionList(byte[] libraryNamePattern)
Return information about the functions and libraries.
|
java.util.List<LibraryInfo> |
functionList(java.lang.String libraryNamePattern)
Return information about the functions and libraries.
|
java.util.List<java.lang.Object> |
functionListBinary()
Return information about the functions and libraries.
|
java.util.List<LibraryInfo> |
functionListWithCode()
Similar to
FUNCTION LIST but include the
libraries source implementation in the reply. |
java.util.List<java.lang.Object> |
functionListWithCode(byte[] libraryNamePattern)
Similar to
FUNCTION LIST but include the
libraries source implementation in the reply. |
java.util.List<LibraryInfo> |
functionListWithCode(java.lang.String libraryNamePattern)
Similar to
FUNCTION LIST but include the
libraries source implementation in the reply. |
java.util.List<java.lang.Object> |
functionListWithCodeBinary()
Similar to
FUNCTION LIST but include the
libraries source implementation in the reply. |
java.lang.String |
functionLoad(byte[] functionCode)
Load a library to Redis.
|
java.lang.String |
functionLoad(java.lang.String functionCode)
Load a library to Redis.
|
java.lang.String |
functionLoadReplace(byte[] functionCode)
Load a library to Redis.
|
java.lang.String |
functionLoadReplace(java.lang.String functionCode)
Load a library to Redis.
|
java.lang.String |
functionRestore(byte[] serializedValue)
Restore libraries from the serialized payload.
|
java.lang.String |
functionRestore(byte[] serializedValue,
FunctionRestorePolicy policy)
Restore libraries from the serialized payload.
|
FunctionStats |
functionStats()
Return information about the function that's currently running and information
about the available execution engines.
|
java.lang.Object |
functionStatsBinary()
Return information about the function that's currently running and information
about the available execution engines.
|
long |
geoadd(byte[] key,
double longitude,
double latitude,
byte[] member) |
long |
geoadd(byte[] key,
GeoAddParams params,
java.util.Map<byte[],GeoCoordinate> memberCoordinateMap) |
long |
geoadd(byte[] key,
java.util.Map<byte[],GeoCoordinate> memberCoordinateMap) |
long |
geoadd(java.lang.String key,
double longitude,
double latitude,
java.lang.String member)
Adds the specified geospatial item (longitude, latitude, member) to the specified key.
|
long |
geoadd(java.lang.String key,
GeoAddParams params,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
Adds the specified geospatial items (in memberCoordinateMap) to the specified key.
|
long |
geoadd(java.lang.String key,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
Adds the specified geospatial items (in memberCoordinateMap) to the specified key.
|
java.lang.Double |
geodist(byte[] key,
byte[] member1,
byte[] member2) |
java.lang.Double |
geodist(byte[] key,
byte[] member1,
byte[] member2,
GeoUnit unit) |
java.lang.Double |
geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2)
Return the distance between two members in the geospatial index represented by the sorted set.
|
java.lang.Double |
geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2,
GeoUnit unit)
Return the distance between two members in the geospatial index represented by the sorted set.
|
java.util.List<byte[]> |
geohash(byte[] key,
byte[]... members) |
java.util.List<java.lang.String> |
geohash(java.lang.String key,
java.lang.String... members)
Return valid Geohash strings representing the position of the given members.
|
java.util.List<GeoCoordinate> |
geopos(byte[] key,
byte[]... members) |
java.util.List<GeoCoordinate> |
geopos(java.lang.String key,
java.lang.String... members)
Return the positions (longitude,latitude) of all the specified members.
|
java.util.List<GeoRadiusResponse> |
georadius(byte[] key,
double longitude,
double latitude,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadius(byte[] key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.util.List<GeoRadiusResponse> |
georadius(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified with the center location and the radius.
|
java.util.List<GeoRadiusResponse> |
georadius(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified with the center location and the radius.
|
java.util.List<GeoRadiusResponse> |
georadiusByMember(byte[] key,
byte[] member,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadiusByMember(byte[] key,
byte[] member,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.util.List<GeoRadiusResponse> |
georadiusByMember(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit)
This command is exactly like
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set. |
java.util.List<GeoRadiusResponse> |
georadiusByMember(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param)
This command is exactly like
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set. |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(byte[] key,
byte[] member,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(byte[] key,
byte[] member,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit)
Readonly version of
GEORADIUSBYMEMBER |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Readonly version of
GEORADIUSBYMEMBER |
long |
georadiusByMemberStore(byte[] key,
byte[] member,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam) |
long |
georadiusByMemberStore(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
This command is exactly like
GEORADIUSBYMEMBER
but storing the results at the destination key (provided with storeParam ). |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(byte[] key,
double longitude,
double latitude,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(byte[] key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit)
Readonly version of
GEORADIUS , |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Readonly version of
GEORADIUS , |
long |
georadiusStore(byte[] key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam) |
long |
georadiusStore(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
This command is exactly like
GEORADIUS
but storing the results at the destination key (provided with storeParam ). |
java.util.List<GeoRadiusResponse> |
geosearch(byte[] key,
byte[] member,
double width,
double height,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
geosearch(byte[] key,
byte[] member,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
geosearch(byte[] key,
GeoCoordinate coord,
double width,
double height,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
geosearch(byte[] key,
GeoCoordinate coord,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
geosearch(byte[] key,
GeoSearchParam params) |
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
GeoCoordinate coord,
double width,
double height,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
GeoCoordinate coord,
double radius,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
GeoSearchParam params)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
java.lang.String member,
double width,
double height,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
long |
geosearchStore(byte[] dest,
byte[] src,
byte[] member,
double width,
double height,
GeoUnit unit) |
long |
geosearchStore(byte[] dest,
byte[] src,
byte[] member,
double radius,
GeoUnit unit) |
long |
geosearchStore(byte[] dest,
byte[] src,
GeoCoordinate coord,
double width,
double height,
GeoUnit unit) |
long |
geosearchStore(byte[] dest,
byte[] src,
GeoCoordinate coord,
double radius,
GeoUnit unit) |
long |
geosearchStore(byte[] dest,
byte[] src,
GeoSearchParam params) |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
GeoCoordinate coord,
double width,
double height,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
GeoCoordinate coord,
double radius,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
GeoSearchParam params)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
java.lang.String member,
double width,
double height,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
java.lang.String member,
double radius,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStoreStoreDist(byte[] dest,
byte[] src,
GeoSearchParam params) |
long |
geosearchStoreStoreDist(java.lang.String dest,
java.lang.String src,
GeoSearchParam params)
This command is exactly like
GEOSEARCHSTORE
but storing the results with their destinations from the center point. |
byte[] |
get(byte[] key)
Get the value of the specified key.
|
java.lang.String |
get(java.lang.String key)
Get the value of the specified key.
|
boolean |
getbit(byte[] key,
long offset)
Returns the bit value at offset in the string value stored at key
|
boolean |
getbit(java.lang.String key,
long offset)
Returns the bit value at offset in the string value stored at key
|
Connection |
getClient() |
Connection |
getConnection() |
int |
getDB() |
byte[] |
getDel(byte[] key)
Get the value of key and delete the key.
|
java.lang.String |
getDel(java.lang.String key)
Get the value of key and delete the key.
|
byte[] |
getEx(byte[] key,
GetExParams params) |
java.lang.String |
getEx(java.lang.String key,
GetExParams params)
GetEx Command
Get the value of key and optionally set its expiration.
|
protected static byte[][] |
getParamsWithBinary(java.util.List<byte[]> keys,
java.util.List<byte[]> args) |
byte[] |
getrange(byte[] key,
long startOffset,
long endOffset) |
java.lang.String |
getrange(java.lang.String key,
long startOffset,
long endOffset)
GetRange Command
Return the substring of the string value stored at key, determined by the offsets start
and end (both are inclusive).
|
byte[] |
getSet(byte[] key,
byte[] value)
GETSET is an atomic set this value and return the old value command.
|
java.lang.String |
getSet(java.lang.String key,
java.lang.String value)
GETSET is an atomic set this value and return the old value command.
|
long |
hdel(byte[] key,
byte[]... fields)
Remove the specified field from an hash stored at key.
|
long |
hdel(java.lang.String key,
java.lang.String... fields)
Remove the specified field(s) from a hash stored at key.
|
boolean |
hexists(byte[] key,
byte[] field)
Test for existence of a specified field in a hash.
|
boolean |
hexists(java.lang.String key,
java.lang.String field)
Test for existence of a specified field in a hash.
|
byte[] |
hget(byte[] key,
byte[] field)
If key holds a hash, retrieve the value associated to the specified field.
|
java.lang.String |
hget(java.lang.String key,
java.lang.String field)
If key holds a hash, retrieve the value associated to the specified field.
|
java.util.Map<byte[],byte[]> |
hgetAll(byte[] key)
Return all the fields and associated values in a hash.
|
java.util.Map<java.lang.String,java.lang.String> |
hgetAll(java.lang.String key)
Return all the fields and associated values in a hash.
|
long |
hincrBy(byte[] key,
byte[] field,
long value)
Increment the number stored at field in the hash at key by value.
|
long |
hincrBy(java.lang.String key,
java.lang.String field,
long value)
Increment the number stored at field in the hash at key by value.
|
double |
hincrByFloat(byte[] key,
byte[] field,
double value)
Increment the number stored at field in the hash at key by a double precision floating point
value.
|
double |
hincrByFloat(java.lang.String key,
java.lang.String field,
double value)
Increment the number stored at field in the hash at key by a double precision floating point
value.
|
java.util.Set<byte[]> |
hkeys(byte[] key)
Return all the fields in a hash.
|
java.util.Set<java.lang.String> |
hkeys(java.lang.String key)
Return all the fields in a hash.
|
long |
hlen(byte[] key)
Return the number of items in a hash.
|
long |
hlen(java.lang.String key)
Return the number of items in a hash.
|
java.util.List<byte[]> |
hmget(byte[] key,
byte[]... fields)
Retrieve the values associated to the specified fields.
|
java.util.List<java.lang.String> |
hmget(java.lang.String key,
java.lang.String... fields)
Retrieve the values associated to the specified fields.
|
java.lang.String |
hmset(byte[] key,
java.util.Map<byte[],byte[]> hash)
Set the respective fields to the respective values.
|
java.lang.String |
hmset(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> hash)
Set the respective fields to the respective values.
|
byte[] |
hrandfield(byte[] key)
Get one random field from a hash.
|
java.util.List<byte[]> |
hrandfield(byte[] key,
long count)
Get multiple random fields from a hash.
|
java.lang.String |
hrandfield(java.lang.String key)
Get one random field from a hash.
|
java.util.List<java.lang.String> |
hrandfield(java.lang.String key,
long count)
Get multiple random fields from a hash.
|
java.util.List<java.util.Map.Entry<byte[],byte[]>> |
hrandfieldWithValues(byte[] key,
long count)
Get one or multiple random fields with values from a hash.
|
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> |
hrandfieldWithValues(java.lang.String key,
long count)
Get one or multiple random fields with values from a hash.
|
ScanResult<java.util.Map.Entry<byte[],byte[]>> |
hscan(byte[] key,
byte[] cursor) |
ScanResult<java.util.Map.Entry<byte[],byte[]>> |
hscan(byte[] key,
byte[] cursor,
ScanParams params) |
ScanResult<java.util.Map.Entry<java.lang.String,java.lang.String>> |
hscan(java.lang.String key,
java.lang.String cursor,
ScanParams params) |
long |
hset(byte[] key,
byte[] field,
byte[] value)
Set the specified hash field to the specified value.
|
long |
hset(byte[] key,
java.util.Map<byte[],byte[]> hash) |
long |
hset(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> hash) |
long |
hset(java.lang.String key,
java.lang.String field,
java.lang.String value)
Set the specified hash field to the specified value.
|
long |
hsetnx(byte[] key,
byte[] field,
byte[] value)
Set the specified hash field to the specified value if the field not exists.
|
long |
hsetnx(java.lang.String key,
java.lang.String field,
java.lang.String value)
Set the specified hash field to the specified value if the field not exists.
|
long |
hstrlen(byte[] key,
byte[] field) |
long |
hstrlen(java.lang.String key,
java.lang.String field) |
java.util.List<byte[]> |
hvals(byte[] key)
Return all the values in a hash.
|
java.util.List<java.lang.String> |
hvals(java.lang.String key)
Return all the values in a hash.
|
long |
incr(byte[] key)
Increment the number stored at key by one.
|
long |
incr(java.lang.String key)
Increment the number stored at key by one.
|
long |
incrBy(byte[] key,
long increment)
INCRBY work just like
INCR but instead to increment by 1 the
increment is integer. |
long |
incrBy(java.lang.String key,
long increment)
INCRBY work just like
INCR but instead to increment by 1 the
increment is integer. |
double |
incrByFloat(byte[] key,
double increment)
INCRBYFLOAT work just like
incrBy(byte[], long) INCRBY} but increments by floats
instead of integers. |
double |
incrByFloat(java.lang.String key,
double increment)
INCRBYFLOAT
|
java.lang.String |
info()
Provide information and statistics about the server.
|
java.lang.String |
info(java.lang.String section)
The INFO command returns information and statistics about the server in a format that is simple
to parse by computers and easy to read by humans.
|
boolean |
isBroken() |
boolean |
isConnected() |
java.util.Set<byte[]> |
keys(byte[] pattern)
Returns all the keys matching the glob-style pattern as space separated strings.
|
java.util.Set<java.lang.String> |
keys(java.lang.String pattern)
Keys Command
Returns all the keys matching the glob-style pattern as space separated strings.
|
long |
lastsave()
Return the UNIX time stamp of the last successfully saving of the dataset on disk.
|
java.lang.String |
latencyDoctor()
The LATENCY DOCTOR command reports about different latency-related issues and advises about
possible remedies.
|
LCSMatchResult |
lcs(byte[] keyA,
byte[] keyB,
LCSParams params)
Calculate the longest common subsequence of keyA and keyB.
|
LCSMatchResult |
lcs(java.lang.String keyA,
java.lang.String keyB,
LCSParams params)
Calculate the longest common subsequence of keyA and keyB.
|
byte[] |
lindex(byte[] key,
long index)
Return the specified element of the list stored at the specified key.
|
java.lang.String |
lindex(java.lang.String key,
long index)
Return the specified element of the list stored at the specified key.
|
long |
linsert(byte[] key,
ListPosition where,
byte[] pivot,
byte[] value) |
long |
linsert(java.lang.String key,
ListPosition where,
java.lang.String pivot,
java.lang.String value)
Inserts element in the list stored at key either before or after the reference value pivot.
|
long |
llen(byte[] key)
Return the length of the list stored at the specified key.
|
long |
llen(java.lang.String key)
Return the length of the list stored at the specified key.
|
byte[] |
lmove(byte[] srcKey,
byte[] dstKey,
ListDirection from,
ListDirection to)
Pop an element from a list, push it to another list and return it
|
java.lang.String |
lmove(java.lang.String srcKey,
java.lang.String dstKey,
ListDirection from,
ListDirection to)
Pop an element from a list, push it to another list and return it
|
KeyValue<byte[],java.util.List<byte[]>> |
lmpop(ListDirection direction,
byte[]... keys) |
KeyValue<byte[],java.util.List<byte[]>> |
lmpop(ListDirection direction,
int count,
byte[]... keys) |
KeyValue<java.lang.String,java.util.List<java.lang.String>> |
lmpop(ListDirection direction,
int count,
java.lang.String... keys) |
KeyValue<java.lang.String,java.util.List<java.lang.String>> |
lmpop(ListDirection direction,
java.lang.String... keys) |
java.lang.String |
lolwut() |
java.lang.String |
lolwut(LolwutParams lolwutParams) |
byte[] |
lpop(byte[] key)
Atomically return and remove the first (LPOP) or last (RPOP) element of the list.
|
java.util.List<byte[]> |
lpop(byte[] key,
int count) |
java.lang.String |
lpop(java.lang.String key)
Atomically return and remove the first (LPOP) or last (RPOP) element of the list.
|
java.util.List<java.lang.String> |
lpop(java.lang.String key,
int count)
Atomically return and remove the first (LPOP) or last (RPOP) element of the list.
|
java.lang.Long |
lpos(byte[] key,
byte[] element)
Returns the index of the first matching element inside a redis list.
|
java.lang.Long |
lpos(byte[] key,
byte[] element,
LPosParams params)
In case there are multiple matches Rank option specifies the "rank" of the element to return.
|
java.util.List<java.lang.Long> |
lpos(byte[] key,
byte[] element,
LPosParams params,
long count)
Count will return list of position of all the first N matching elements.
|
java.lang.Long |
lpos(java.lang.String key,
java.lang.String element)
Returns the index of the first matching element inside a redis list.
|
java.lang.Long |
lpos(java.lang.String key,
java.lang.String element,
LPosParams params)
In case there are multiple matches Rank option specifies the "rank" of the element to return.
|
java.util.List<java.lang.Long> |
lpos(java.lang.String key,
java.lang.String element,
LPosParams params,
long count)
Returns the index of matching elements inside a Redis list.
|
long |
lpush(byte[] key,
byte[]... strings)
Add the string value to the head (LPUSH) or tail (RPUSH) of the list stored at key.
|
long |
lpush(java.lang.String key,
java.lang.String... strings)
Add the string value to the head (LPUSH) or tail (RPUSH) of the list stored at key.
|
long |
lpushx(byte[] key,
byte[]... strings) |
long |
lpushx(java.lang.String key,
java.lang.String... strings)
Inserts specified values at the head of the list stored at key.
|
java.util.List<byte[]> |
lrange(byte[] key,
long start,
long stop)
Return the specified elements of the list stored at the specified key.
|
java.util.List<java.lang.String> |
lrange(java.lang.String key,
long start,
long stop)
Return the specified elements of the list stored at the specified key.
|
long |
lrem(byte[] key,
long count,
byte[] value)
Remove the first count occurrences of the value element from the list.
|
long |
lrem(java.lang.String key,
long count,
java.lang.String value)
Remove the first count occurrences of the value element from the list.
|
java.lang.String |
lset(byte[] key,
long index,
byte[] value)
Set a new value as the element at index position of the List at key.
|
java.lang.String |
lset(java.lang.String key,
long index,
java.lang.String value)
Set a new value as the element at index position of the List at key.
|
java.lang.String |
ltrim(byte[] key,
long start,
long stop)
Trim an existing list so that it will contain only the specified range of elements specified.
|
java.lang.String |
ltrim(java.lang.String key,
long start,
long stop)
Trim an existing list so that it will contain only the specified range of elements specified.
|
java.lang.String |
memoryDoctor()
Reports about different memory-related issues that the Redis server experiences,
and advises about possible remedies.
|
byte[] |
memoryDoctorBinary()
Reports about different memory-related issues that the Redis server experiences,
and advises about possible remedies.
|
java.lang.String |
memoryPurge()
Attempts to purge dirty pages so these can be reclaimed by the allocator.
|
java.util.Map<java.lang.String,java.lang.Object> |
memoryStats()
Returns an Array reply about the memory usage of the server.
|
java.lang.Long |
memoryUsage(byte[] key)
Reports the number of bytes that a key and its value require to be stored in RAM.
|
java.lang.Long |
memoryUsage(byte[] key,
int samples)
Reports the number of bytes that a key and its value require to be stored in RAM.
|
java.lang.Long |
memoryUsage(java.lang.String key)
Memory Usage Command
Report the number of bytes that a key and its value require to be stored in RAM.
|
java.lang.Long |
memoryUsage(java.lang.String key,
int samples)
Memory Usage Command
Report the number of bytes that a key and its value require to be stored in RAM.
|
java.util.List<byte[]> |
mget(byte[]... keys)
Get the values of all the specified keys.
|
java.util.List<java.lang.String> |
mget(java.lang.String... keys)
Get the values of all the specified keys.
|
java.lang.String |
migrate(java.lang.String host,
int port,
byte[] key,
int timeout) |
java.lang.String |
migrate(java.lang.String host,
int port,
byte[] key,
int destinationDb,
int timeout)
Binary version of
MIGRATE . |
java.lang.String |
migrate(java.lang.String host,
int port,
int destinationDB,
int timeout,
MigrateParams params,
byte[]... keys)
Binary version of
MIGRATE . |
java.lang.String |
migrate(java.lang.String host,
int port,
int destinationDB,
int timeout,
MigrateParams params,
java.lang.String... keys)
Migrate Command
Atomically transfer a key from a source Redis instance to a destination Redis instance.
|
java.lang.String |
migrate(java.lang.String host,
int port,
int timeout,
MigrateParams params,
byte[]... keys) |
java.lang.String |
migrate(java.lang.String host,
int port,
int timeout,
MigrateParams params,
java.lang.String... keys)
Migrate Command
Atomically transfer a key from a source Redis instance to a destination Redis instance.
|
java.lang.String |
migrate(java.lang.String host,
int port,
java.lang.String key,
int timeout)
Migrate Command
Atomically transfer a key from a source Redis instance to a destination Redis instance.
|
java.lang.String |
migrate(java.lang.String host,
int port,
java.lang.String key,
int destinationDb,
int timeout)
Migrate Command
Atomically transfer a key from a source Redis instance to a destination Redis instance.
|
java.util.List<Module> |
moduleList()
Return information about the modules loaded to the server.
|
java.lang.String |
moduleLoad(java.lang.String path)
Load and initialize the Redis module from the dynamic library specified by the path argument.
|
java.lang.String |
moduleLoad(java.lang.String path,
java.lang.String... args)
Load and initialize the Redis module from the dynamic library specified by the path argument.
|
java.lang.String |
moduleLoadEx(java.lang.String path,
ModuleLoadExParams params)
Loads a module from a dynamic library at runtime with configuration directives.
|
java.lang.String |
moduleUnload(java.lang.String name)
Unload the module specified by name.
|
void |
monitor(JedisMonitor jedisMonitor)
Dump all the received requests in real time.
|
long |
move(byte[] key,
int dbIndex)
Move the specified key from the currently selected DB to the specified destination DB.
|
long |
move(java.lang.String key,
int dbIndex)
Move the specified key from the currently selected DB to the specified destination DB.
|
java.lang.String |
mset(byte[]... keysvalues)
Set the respective keys to the respective values.
|
java.lang.String |
mset(java.lang.String... keysvalues)
Set the respective keys to the respective values.
|
long |
msetnx(byte[]... keysvalues)
Set the respective keys to the respective values.
|
long |
msetnx(java.lang.String... keysvalues)
Set the respective keys to the respective values.
|
Transaction |
multi() |
byte[] |
objectEncoding(byte[] key)
Returns the internal encoding for the Redis object stored at
key . |
java.lang.String |
objectEncoding(java.lang.String key)
Object Encoding Command
Return the internal encoding for the Redis object stored at key.
|
java.lang.Long |
objectFreq(byte[] key)
Returns the logarithmic access frequency counter of a Redis object stored at
key . |
java.lang.Long |
objectFreq(java.lang.String key)
Object Freq Command
Return the logarithmic access frequency counter of a Redis object stored at key.
|
java.util.List<java.lang.String> |
objectHelp()
Returns the object subcommands and usages.
|
java.util.List<byte[]> |
objectHelpBinary()
Returns the object subcommands and usages.
|
java.lang.Long |
objectIdletime(byte[] key)
Returns the time in seconds since the last access to the value stored at
key . |
java.lang.Long |
objectIdletime(java.lang.String key)
Object IdleTime Command
Return the time in seconds since the last access to the value stored at key.
|
java.lang.Long |
objectRefcount(byte[] key)
Returns the reference count of the stored at
key . |
java.lang.Long |
objectRefcount(java.lang.String key)
Object Refcount Command
Return the reference count of the stored at key.
|
long |
persist(byte[] key)
Undo a
expire at turning the expire key into a normal key. |
long |
persist(java.lang.String key)
Undo a
expire at turning the expire key into a normal key. |
long |
pexpire(byte[] key,
long milliseconds)
Set a timeout on the specified key.
|
long |
pexpire(byte[] key,
long milliseconds,
ExpiryOption expiryOption) |
long |
pexpire(java.lang.String key,
long milliseconds)
PExpire Command
This command works exactly like
EXPIRE but the time
to live of the key is specified in milliseconds instead of seconds. |
long |
pexpire(java.lang.String key,
long milliseconds,
ExpiryOption expiryOption)
Similar to
EXPIRE but with optional expiry setting. |
long |
pexpireAt(byte[] key,
long millisecondsTimestamp) |
long |
pexpireAt(byte[] key,
long millisecondsTimestamp,
ExpiryOption expiryOption) |
long |
pexpireAt(java.lang.String key,
long millisecondsTimestamp)
This command works exactly like
EXPIREAT but
Unix time at which the key will expire is specified in milliseconds instead of seconds. |
long |
pexpireAt(java.lang.String key,
long millisecondsTimestamp,
ExpiryOption expiryOption)
|
long |
pexpireTime(byte[] key) |
long |
pexpireTime(java.lang.String key)
Similar to
EXPIRETIME but returns the absolute Unix expiration
timestamp in milliseconds instead of seconds. |
long |
pfadd(byte[] key,
byte[]... elements) |
long |
pfadd(java.lang.String key,
java.lang.String... elements) |
long |
pfcount(byte[]... keys) |
long |
pfcount(byte[] key) |
long |
pfcount(java.lang.String... keys) |
long |
pfcount(java.lang.String key) |
java.lang.String |
pfmerge(byte[] destkey,
byte[]... sourcekeys) |
java.lang.String |
pfmerge(java.lang.String destkey,
java.lang.String... sourcekeys) |
java.lang.String |
ping()
This command is often used to test if a connection is still alive, or to measure latency.
|
byte[] |
ping(byte[] message)
Works same as
ping() but returns argument message instead of PONG . |
java.lang.String |
ping(java.lang.String message)
Works same as
ping() but returns argument message instead of PONG. |
Pipeline |
pipelined() |
java.lang.String |
psetex(byte[] key,
long milliseconds,
byte[] value)
PSETEX works exactly like
setex(byte[], long, byte[]) with the sole difference
that the expire time is specified in milliseconds instead of seconds. |
java.lang.String |
psetex(java.lang.String key,
long milliseconds,
java.lang.String value)
PSETEX works exactly like
setex(String, long, String) with the sole difference
that the expire time is specified in milliseconds instead of seconds. |
void |
psubscribe(BinaryJedisPubSub jedisPubSub,
byte[]... patterns) |
void |
psubscribe(JedisPubSub jedisPubSub,
java.lang.String... patterns) |
long |
pttl(byte[] key) |
long |
pttl(java.lang.String key)
PTTL Command
The PTTL command returns the remaining time to live in milliseconds of a key that has an
EXPIRE set. |
long |
publish(byte[] channel,
byte[] message) |
long |
publish(java.lang.String channel,
java.lang.String message) |
java.util.List<java.lang.String> |
pubsubChannels() |
java.util.List<java.lang.String> |
pubsubChannels(java.lang.String pattern) |
java.lang.Long |
pubsubNumPat() |
java.util.Map<java.lang.String,java.lang.Long> |
pubsubNumSub(java.lang.String... channels) |
java.util.List<java.lang.String> |
pubsubShardChannels() |
java.util.List<java.lang.String> |
pubsubShardChannels(java.lang.String pattern) |
java.util.Map<java.lang.String,java.lang.Long> |
pubsubShardNumSub(java.lang.String... channels) |
byte[] |
randomBinaryKey()
Return a randomly selected key from the currently selected DB.
|
java.lang.String |
randomKey()
Return a randomly selected key from the currently selected DB.
|
java.lang.String |
readonly() |
java.lang.String |
readwrite() |
java.lang.String |
rename(byte[] oldkey,
byte[] newkey)
Atomically renames the key oldkey to newkey.
|
java.lang.String |
rename(java.lang.String oldkey,
java.lang.String newkey)
Atomically renames the key oldkey to newkey.
|
long |
renamenx(byte[] oldkey,
byte[] newkey)
Rename oldkey into newkey but fails if the destination key newkey already exists.
|
long |
renamenx(java.lang.String oldkey,
java.lang.String newkey)
Rename oldkey into newkey but fails if the destination key newkey already exists.
|
java.lang.String |
replicaof(java.lang.String host,
int port)
The REPLICAOF command can change the replication settings of a replica on the fly.
|
java.lang.String |
replicaofNoOne()
REPLICAOF NO ONE will stop replication, turning the server into a MASTER, but will not discard
the replication.
|
void |
resetState() |
java.lang.String |
restore(byte[] key,
long ttl,
byte[] serializedValue) |
java.lang.String |
restore(byte[] key,
long ttl,
byte[] serializedValue,
RestoreParams params) |
java.lang.String |
restore(java.lang.String key,
long ttl,
byte[] serializedValue)
Restore Command
Create a key associated with a value that is obtained by deserializing the provided serialized
value (obtained via
DUMP ). |
java.lang.String |
restore(java.lang.String key,
long ttl,
byte[] serializedValue,
RestoreParams params)
Restore Command
Create a key associated with a value that is obtained by deserializing the provided serialized
value (obtained via
DUMP ). |
java.util.List<java.lang.Object> |
role()
Provide information on the role of a Redis instance in the context of replication,
by returning if the instance is currently a master, slave, or sentinel.
|
java.util.List<java.lang.Object> |
roleBinary()
Provide information on the role of a Redis instance in the context of replication,
by returning if the instance is currently a master, slave, or sentinel.
|
byte[] |
rpop(byte[] key)
Atomically return and remove the first (LPOP) or last (RPOP) element of the list.
|
java.util.List<byte[]> |
rpop(byte[] key,
int count) |
java.lang.String |
rpop(java.lang.String key)
Atomically return and remove the first (LPOP) or last (RPOP) element of the list.
|
java.util.List<java.lang.String> |
rpop(java.lang.String key,
int count)
Atomically return and remove the first (LPOP) or last (RPOP) element of the list.
|
byte[] |
rpoplpush(byte[] srckey,
byte[] dstkey)
Atomically return and remove the last (tail) element of the srckey list, and push the element
as the first (head) element of the dstkey list.
|
java.lang.String |
rpoplpush(java.lang.String srckey,
java.lang.String dstkey)
Atomically return and remove the last (tail) element of the srckey list, and push the element
as the first (head) element of the dstkey list.
|
long |
rpush(byte[] key,
byte[]... strings)
Add the string value to the head (LPUSH) or tail (RPUSH) of the list stored at key.
|
long |
rpush(java.lang.String key,
java.lang.String... strings)
Add the string value to the head (LPUSH) or tail (RPUSH) of the list stored at key.
|
long |
rpushx(byte[] key,
byte[]... strings) |
long |
rpushx(java.lang.String key,
java.lang.String... strings)
Inserts specified values at the tail of the list stored at key.
|
long |
sadd(byte[] key,
byte[]... members)
Add the specified member to the set value stored at key.
|
long |
sadd(java.lang.String key,
java.lang.String... members)
Add the specified member to the set value stored at key.
|
java.lang.String |
save()
Synchronously save the DB on disk.
|
ScanResult<byte[]> |
scan(byte[] cursor) |
ScanResult<byte[]> |
scan(byte[] cursor,
ScanParams params) |
ScanResult<byte[]> |
scan(byte[] cursor,
ScanParams params,
byte[] type) |
ScanResult<java.lang.String> |
scan(java.lang.String cursor) |
ScanResult<java.lang.String> |
scan(java.lang.String cursor,
ScanParams params) |
ScanResult<java.lang.String> |
scan(java.lang.String cursor,
ScanParams params,
java.lang.String type) |
long |
scard(byte[] key)
Return the set cardinality (number of elements).
|
long |
scard(java.lang.String key)
Return the set cardinality (number of elements).
|
java.util.List<java.lang.Boolean> |
scriptExists(byte[]... sha1) |
java.lang.Boolean |
scriptExists(byte[] sha1) |
java.util.List<java.lang.Boolean> |
scriptExists(java.lang.String... sha1) |
java.lang.Boolean |
scriptExists(java.lang.String sha1) |
java.lang.String |
scriptFlush() |
java.lang.String |
scriptFlush(FlushMode flushMode) |
java.lang.String |
scriptKill() |
byte[] |
scriptLoad(byte[] script) |
java.lang.String |
scriptLoad(java.lang.String script) |
java.util.Set<byte[]> |
sdiff(byte[]... keys)
Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN
|
java.util.Set<java.lang.String> |
sdiff(java.lang.String... keys)
Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN
|
long |
sdiffstore(byte[] dstkey,
byte[]... keys)
This command works exactly like
SDIFF but instead of being returned
the resulting set is stored in dstkey. |
long |
sdiffstore(java.lang.String dstkey,
java.lang.String... keys)
This command works exactly like
SDIFF but instead of being
returned the resulting set is stored in dstkey. |
java.lang.String |
select(int index)
Select the DB with having the specified zero-based numeric index.
|
java.lang.Object |
sendBlockingCommand(ProtocolCommand cmd,
byte[]... args) |
java.lang.Object |
sendBlockingCommand(ProtocolCommand cmd,
java.lang.String... args) |
java.lang.Object |
sendCommand(ProtocolCommand cmd) |
java.lang.Object |
sendCommand(ProtocolCommand cmd,
byte[]... args) |
java.lang.Object |
sendCommand(ProtocolCommand cmd,
java.lang.String... args) |
java.lang.String |
sentinelFailover(java.lang.String masterName) |
java.util.List<java.lang.String> |
sentinelGetMasterAddrByName(java.lang.String masterName)
redis 127.0.0.1:26381> sentinel get-master-addr-by-name mymaster
1) "127.0.0.1"
2) "6379"
|
java.util.Map<java.lang.String,java.lang.String> |
sentinelMaster(java.lang.String masterName) |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
sentinelMasters()
redis 127.0.0.1:26381> sentinel masters
1) 1) "name"
2) "mymaster"
3) "ip"
4) "127.0.0.1"
5) "port"
6) "6379"
7) "runid"
8) "93d4d4e6e9c06d0eea36e27f31924ac26576081d"
9) "flags"
10) "master"
11) "pending-commands"
12) "0"
13) "last-ok-ping-reply"
14) "423"
15) "last-ping-reply"
16) "423"
17) "info-refresh"
18) "6107"
19) "num-slaves"
20) "1"
21) "num-other-sentinels"
22) "2"
23) "quorum"
24) "2"
|
java.lang.String |
sentinelMonitor(java.lang.String masterName,
java.lang.String ip,
int port,
int quorum) |
java.lang.String |
sentinelMyId() |
java.lang.String |
sentinelRemove(java.lang.String masterName) |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
sentinelReplicas(java.lang.String masterName) |
java.lang.Long |
sentinelReset(java.lang.String pattern)
redis 127.0.0.1:26381> sentinel reset mymaster
(integer) 1
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
sentinelSentinels(java.lang.String masterName) |
java.lang.String |
sentinelSet(java.lang.String masterName,
java.util.Map<java.lang.String,java.lang.String> parameterMap) |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
sentinelSlaves(java.lang.String masterName)
Deprecated.
|
java.lang.String |
set(byte[] key,
byte[] value)
Set the string value as value of the key.
|
java.lang.String |
set(byte[] key,
byte[] value,
SetParams params)
Set the string value as value of the key.
|
java.lang.String |
set(java.lang.String key,
java.lang.String value)
Set the string value as value of the key.
|
java.lang.String |
set(java.lang.String key,
java.lang.String value,
SetParams params)
Set the string value as value of the key.
|
boolean |
setbit(byte[] key,
long offset,
boolean value)
Sets or clears the bit at offset in the string value stored at key
|
boolean |
setbit(java.lang.String key,
long offset,
boolean value)
Sets or clears the bit at offset in the string value stored at key
|
protected void |
setDataSource(Pool<Jedis> jedisPool) |
java.lang.String |
setex(byte[] key,
long seconds,
byte[] value)
|
java.lang.String |
setex(java.lang.String key,
long seconds,
java.lang.String value)
|
byte[] |
setGet(byte[] key,
byte[] value) |
byte[] |
setGet(byte[] key,
byte[] value,
SetParams params) |
java.lang.String |
setGet(java.lang.String key,
java.lang.String value) |
java.lang.String |
setGet(java.lang.String key,
java.lang.String value,
SetParams params) |
long |
setnx(byte[] key,
byte[] value)
SETNX works exactly like
SET with the only difference that if
the key already exists no operation is performed. |
long |
setnx(java.lang.String key,
java.lang.String value)
SETNX works exactly like
SET with the only difference that if
the key already exists no operation is performed. |
long |
setrange(byte[] key,
long offset,
byte[] value) |
long |
setrange(java.lang.String key,
long offset,
java.lang.String value)
SetRange Command
GETRANGE overwrite part of the string stored at key, starting at the specified offset, for the entire
length of value.
|
void |
shutdown()
Synchronously save the DB on disk, then shutdown the server.
|
void |
shutdown(ShutdownParams shutdownParams) |
java.lang.String |
shutdownAbort() |
java.util.Set<byte[]> |
sinter(byte[]... keys)
Return the members of a set resulting from the intersection of all the sets hold at the
specified keys.
|
java.util.Set<java.lang.String> |
sinter(java.lang.String... keys)
Return the members of a set resulting from the intersection of all the sets hold at the
specified keys.
|
long |
sintercard(byte[]... keys)
This command works exactly like
SINTER but instead of returning
the result set, it returns just the cardinality of the result. |
long |
sintercard(int limit,
byte[]... keys)
This command works exactly like
SINTER but instead of returning
the result set, it returns just the cardinality of the result. |
long |
sintercard(int limit,
java.lang.String... keys)
This command works exactly like
SINTER but instead of returning
the result set, it returns just the cardinality of the result. |
long |
sintercard(java.lang.String... keys)
This command works exactly like
SINTER but instead of returning
the result set, it returns just the cardinality of the result. |
long |
sinterstore(byte[] dstkey,
byte[]... keys)
This command works exactly like
SINTER but instead of being
returned the resulting set is stored as dstkey. |
long |
sinterstore(java.lang.String dstkey,
java.lang.String... keys)
This command works exactly like
SINTER but instead of being
returned the resulting set is stored as dstkey. |
boolean |
sismember(byte[] key,
byte[] member)
Return true if member is a member of the set stored at key, otherwise false is returned.
|
boolean |
sismember(java.lang.String key,
java.lang.String member)
Return true if member is a member of the set stored at key, otherwise false is returned.
|
java.lang.String |
slaveof(java.lang.String host,
int port)
Deprecated.
|
java.lang.String |
slaveofNoOne()
Deprecated.
Use
replicaofNoOne() . |
java.util.List<Slowlog> |
slowlogGet() |
java.util.List<Slowlog> |
slowlogGet(long entries) |
java.util.List<java.lang.Object> |
slowlogGetBinary() |
java.util.List<java.lang.Object> |
slowlogGetBinary(long entries) |
long |
slowlogLen() |
java.lang.String |
slowlogReset() |
java.util.Set<byte[]> |
smembers(byte[] key)
Return all the members (elements) of the set value stored at key.
|
java.util.Set<java.lang.String> |
smembers(java.lang.String key)
Return all the members (elements) of the set value stored at key.
|
java.util.List<java.lang.Boolean> |
smismember(byte[] key,
byte[]... members)
Returns whether each member is a member of the set stored at key.
|
java.util.List<java.lang.Boolean> |
smismember(java.lang.String key,
java.lang.String... members)
Returns whether each member is a member of the set stored at key.
|
long |
smove(byte[] srckey,
byte[] dstkey,
byte[] member)
Move the specified member from the set at srckey to the set at dstkey.
|
long |
smove(java.lang.String srckey,
java.lang.String dstkey,
java.lang.String member)
Move the specified member from the set at srckey to the set at dstkey.
|
java.util.List<byte[]> |
sort(byte[] key)
Sort a Set or a List.
|
long |
sort(byte[] key,
byte[] dstkey)
Sort a Set or a List and Store the Result at dstkey.
|
java.util.List<byte[]> |
sort(byte[] key,
SortingParams sortingParams)
Sort a Set or a List accordingly to the specified parameters.
|
long |
sort(byte[] key,
SortingParams sortingParams,
byte[] dstkey)
Sort a Set or a List accordingly to the specified parameters and store the result at dstkey.
|
java.util.List<java.lang.String> |
sort(java.lang.String key)
Sort a Set or a List.
|
java.util.List<java.lang.String> |
sort(java.lang.String key,
SortingParams sortingParams)
Sort a Set or a List accordingly to the specified parameters.
|
long |
sort(java.lang.String key,
SortingParams sortingParams,
java.lang.String dstkey)
Sort a Set or a List accordingly to the specified parameters and store the result at dstkey.
|
long |
sort(java.lang.String key,
java.lang.String dstkey)
Sort a Set or a List and Store the Result at dstkey.
|
java.util.List<byte[]> |
sortReadonly(byte[] key,
SortingParams sortingParams) |
java.util.List<java.lang.String> |
sortReadonly(java.lang.String key,
SortingParams sortingParams)
Read-only variant of the
SORT command. |
byte[] |
spop(byte[] key)
Remove a random element from a Set returning it as return value.
|
java.util.Set<byte[]> |
spop(byte[] key,
long count) |
java.lang.String |
spop(java.lang.String key)
Remove a random element from a Set returning it as return value.
|
java.util.Set<java.lang.String> |
spop(java.lang.String key,
long count)
By default, the command
SetCommands.spop(String) pops a single member from the set. |
byte[] |
srandmember(byte[] key)
Return a random element from a Set, without removing the element.
|
java.util.List<byte[]> |
srandmember(byte[] key,
int count) |
java.lang.String |
srandmember(java.lang.String key)
Return a random element from a Set, without removing the element.
|
java.util.List<java.lang.String> |
srandmember(java.lang.String key,
int count)
Return a random elements from a Set, without removing the elements.
|
long |
srem(byte[] key,
byte[]... members)
Remove the specified member from the set value stored at key.
|
long |
srem(java.lang.String key,
java.lang.String... members)
Remove the specified member from the set value stored at key.
|
ScanResult<byte[]> |
sscan(byte[] key,
byte[] cursor) |
ScanResult<byte[]> |
sscan(byte[] key,
byte[] cursor,
ScanParams params) |
ScanResult<java.lang.String> |
sscan(java.lang.String key,
java.lang.String cursor,
ScanParams params) |
long |
strlen(byte[] key) |
long |
strlen(java.lang.String key)
StrLen Command
Return the length of the string value stored at key.
|
void |
subscribe(BinaryJedisPubSub jedisPubSub,
byte[]... channels) |
void |
subscribe(JedisPubSub jedisPubSub,
java.lang.String... channels) |
byte[] |
substr(byte[] key,
int start,
int end)
Return a subset of the string from offset start to offset end (both offsets are inclusive).
|
java.lang.String |
substr(java.lang.String key,
int start,
int end)
Return a subset of the string from offset start to offset end (both offsets are inclusive).
|
java.util.Set<byte[]> |
sunion(byte[]... keys)
Return the members of a set resulting from the union of all the sets hold at the specified
keys.
|
java.util.Set<java.lang.String> |
sunion(java.lang.String... keys)
Return the members of a set resulting from the union of all the sets hold at the specified
keys.
|
long |
sunionstore(byte[] dstkey,
byte[]... keys)
This command works exactly like
SUNION but instead of being
returned the resulting set is stored as dstkey. |
long |
sunionstore(java.lang.String dstkey,
java.lang.String... keys)
This command works exactly like
SUNION but instead of being
returned the resulting set is stored as dstkey. |
java.lang.String |
swapDB(int index1,
int index2)
This command swaps two Redis databases, so that immediately all the clients connected to a
given database will see the data of the other database, and the other way around.
|
java.util.List<java.lang.String> |
time() |
java.lang.String |
toString() |
long |
touch(byte[]... keys)
Alters the last access time of a key(s).
|
long |
touch(byte[] key) |
long |
touch(java.lang.String... keys)
Alters the last access time of a key(s).
|
long |
touch(java.lang.String key)
Touch Command
Alters the last access time of a key.
|
long |
ttl(byte[] key)
The TTL command returns the remaining time to live in seconds of a key that has an
EXPIRE set. |
long |
ttl(java.lang.String key)
The TTL command returns the remaining time to live in seconds of a key that has an
EXPIRE set. |
java.lang.String |
type(byte[] key)
Return the type of the value stored at key in form of a string.
|
java.lang.String |
type(java.lang.String key)
Return the type of the value stored at key in form of a string.
|
long |
unlink(byte[]... keys)
This command is very similar to DEL: it removes the specified keys.
|
long |
unlink(byte[] key) |
long |
unlink(java.lang.String... keys)
This command is very similar to DEL: it removes the specified keys.
|
long |
unlink(java.lang.String key)
Unlink Command
This command is very similar to
DEL : it removes the specified key. |
java.lang.String |
unwatch() |
KeyValue<java.lang.Long,java.lang.Long> |
waitAOF(long numLocal,
long numReplicas,
long timeout)
Blocks the current client until all the previous write commands are acknowledged as having been
fsynced to the AOF of the local Redis and/or at least the specified number of replicas.
|
long |
waitReplicas(int replicas,
long timeout)
Synchronous replication of Redis as described here: http://antirez.com/news/66.
|
java.lang.String |
watch(byte[]... keys) |
java.lang.String |
watch(java.lang.String... keys) |
long |
xack(byte[] key,
byte[] group,
byte[]... ids) |
long |
xack(java.lang.String key,
java.lang.String group,
StreamEntryID... ids)
XACK key group ID [ID ...]
|
byte[] |
xadd(byte[] key,
XAddParams params,
java.util.Map<byte[],byte[]> hash) |
StreamEntryID |
xadd(java.lang.String key,
StreamEntryID id,
java.util.Map<java.lang.String,java.lang.String> hash)
XADD key ID field string [field string ...]
|
StreamEntryID |
xadd(java.lang.String key,
XAddParams params,
java.util.Map<java.lang.String,java.lang.String> hash) |
java.util.List<java.lang.Object> |
xautoclaim(byte[] key,
byte[] groupName,
byte[] consumerName,
long minIdleTime,
byte[] start,
XAutoClaimParams params) |
java.util.Map.Entry<StreamEntryID,java.util.List<StreamEntry>> |
xautoclaim(java.lang.String key,
java.lang.String group,
java.lang.String consumerName,
long minIdleTime,
StreamEntryID start,
XAutoClaimParams params)
XAUTOCLAIM key group consumer min-idle-time start [COUNT count]
|
java.util.List<java.lang.Object> |
xautoclaimJustId(byte[] key,
byte[] groupName,
byte[] consumerName,
long minIdleTime,
byte[] start,
XAutoClaimParams params) |
java.util.Map.Entry<StreamEntryID,java.util.List<StreamEntryID>> |
xautoclaimJustId(java.lang.String key,
java.lang.String group,
java.lang.String consumerName,
long minIdleTime,
StreamEntryID start,
XAutoClaimParams params)
XAUTOCLAIM key group consumer min-idle-time start [COUNT count] JUSTID
|
java.util.List<byte[]> |
xclaim(byte[] key,
byte[] group,
byte[] consumerName,
long minIdleTime,
XClaimParams params,
byte[]... ids) |
java.util.List<StreamEntry> |
xclaim(java.lang.String key,
java.lang.String group,
java.lang.String consumerName,
long minIdleTime,
XClaimParams params,
StreamEntryID... ids)
{@code XCLAIM key group consumer min-idle-time
|
java.util.List<byte[]> |
xclaimJustId(byte[] key,
byte[] group,
byte[] consumerName,
long minIdleTime,
XClaimParams params,
byte[]... ids) |
java.util.List<StreamEntryID> |
xclaimJustId(java.lang.String key,
java.lang.String group,
java.lang.String consumerName,
long minIdleTime,
XClaimParams params,
StreamEntryID... ids)
{@code XCLAIM key group consumer min-idle-time
|
long |
xdel(byte[] key,
byte[]... ids) |
long |
xdel(java.lang.String key,
StreamEntryID... ids)
XDEL key ID [ID ...]
|
java.lang.String |
xgroupCreate(byte[] key,
byte[] consumer,
byte[] id,
boolean makeStream) |
java.lang.String |
xgroupCreate(java.lang.String key,
java.lang.String groupName,
StreamEntryID id,
boolean makeStream)
XGROUP CREATE key groupName <id or $> |
boolean |
xgroupCreateConsumer(byte[] key,
byte[] groupName,
byte[] consumerName) |
boolean |
xgroupCreateConsumer(java.lang.String key,
java.lang.String groupName,
java.lang.String consumerName)
XGROUP CREATECONSUMER key groupName consumerName
|
long |
xgroupDelConsumer(byte[] key,
byte[] groupName,
byte[] consumerName) |
long |
xgroupDelConsumer(java.lang.String key,
java.lang.String groupName,
java.lang.String consumerName)
XGROUP DELCONSUMER key groupName consumerName
|
long |
xgroupDestroy(byte[] key,
byte[] consumer) |
long |
xgroupDestroy(java.lang.String key,
java.lang.String groupName)
XGROUP DESTROY key groupName
|
java.lang.String |
xgroupSetID(byte[] key,
byte[] consumer,
byte[] id) |
java.lang.String |
xgroupSetID(java.lang.String key,
java.lang.String groupName,
StreamEntryID id)
XGROUP SETID key groupName <id or $> |
java.util.List<java.lang.Object> |
xinfoConsumers(byte[] key,
byte[] group) |
java.util.List<StreamConsumersInfo> |
xinfoConsumers(java.lang.String key,
java.lang.String group)
Introspection command used in order to retrieve different information about consumers in the group
|
java.util.List<StreamConsumerInfo> |
xinfoConsumers2(java.lang.String key,
java.lang.String group)
Introspection command used in order to retrieve different information about consumers in the group
|
java.util.List<java.lang.Object> |
xinfoGroups(byte[] key) |
java.util.List<StreamGroupInfo> |
xinfoGroups(java.lang.String key)
Introspection command used in order to retrieve different information about groups in the stream
|
java.lang.Object |
xinfoStream(byte[] key) |
StreamInfo |
xinfoStream(java.lang.String key)
Introspection command used in order to retrieve different information about the stream
|
java.lang.Object |
xinfoStreamFull(byte[] key)
Introspection command used in order to retrieve all information about the stream
|
java.lang.Object |
xinfoStreamFull(byte[] key,
int count)
Introspection command used in order to retrieve all information about the stream
|
StreamFullInfo |
xinfoStreamFull(java.lang.String key)
Introspection command used in order to retrieve all information about the stream
|
StreamFullInfo |
xinfoStreamFull(java.lang.String key,
int count)
Introspection command used in order to retrieve all information about the stream
|
long |
xlen(byte[] key) |
long |
xlen(java.lang.String key)
XLEN key
|
java.lang.Object |
xpending(byte[] key,
byte[] groupName) |
java.util.List<java.lang.Object> |
xpending(byte[] key,
byte[] groupName,
XPendingParams params) |
StreamPendingSummary |
xpending(java.lang.String key,
java.lang.String groupName)
XPENDING key group
|
java.util.List<StreamPendingEntry> |
xpending(java.lang.String key,
java.lang.String groupName,
XPendingParams params)
XPENDING key group [[IDLE min-idle-time] start end count [consumer]]
|
java.util.List<java.lang.Object> |
xrange(byte[] key,
byte[] start,
byte[] end) |
java.util.List<java.lang.Object> |
xrange(byte[] key,
byte[] start,
byte[] end,
int count) |
java.util.List<StreamEntry> |
xrange(java.lang.String key,
StreamEntryID start,
StreamEntryID end)
XRANGE key start end
|
java.util.List<StreamEntry> |
xrange(java.lang.String key,
StreamEntryID start,
StreamEntryID end,
int count)
XRANGE key start end COUNT count
|
java.util.List<StreamEntry> |
xrange(java.lang.String key,
java.lang.String start,
java.lang.String end) |
java.util.List<StreamEntry> |
xrange(java.lang.String key,
java.lang.String start,
java.lang.String end,
int count) |
java.util.List<java.lang.Object> |
xread(XReadParams xReadParams,
java.util.Map.Entry<byte[],byte[]>... streams) |
java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> |
xread(XReadParams xReadParams,
java.util.Map<java.lang.String,StreamEntryID> streams)
XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]
|
java.util.List<java.lang.Object> |
xreadGroup(byte[] groupName,
byte[] consumer,
XReadGroupParams xReadGroupParams,
java.util.Map.Entry<byte[],byte[]>... streams) |
java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> |
xreadGroup(java.lang.String groupName,
java.lang.String consumer,
XReadGroupParams xReadGroupParams,
java.util.Map<java.lang.String,StreamEntryID> streams)
XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]
|
java.util.List<java.lang.Object> |
xrevrange(byte[] key,
byte[] end,
byte[] start) |
java.util.List<java.lang.Object> |
xrevrange(byte[] key,
byte[] end,
byte[] start,
int count) |
java.util.List<StreamEntry> |
xrevrange(java.lang.String key,
StreamEntryID end,
StreamEntryID start)
XREVRANGE key end start
|
java.util.List<StreamEntry> |
xrevrange(java.lang.String key,
StreamEntryID end,
StreamEntryID start,
int count)
XREVRANGE key end start COUNT count
|
java.util.List<StreamEntry> |
xrevrange(java.lang.String key,
java.lang.String end,
java.lang.String start) |
java.util.List<StreamEntry> |
xrevrange(java.lang.String key,
java.lang.String end,
java.lang.String start,
int count) |
long |
xtrim(byte[] key,
long maxLen,
boolean approximateLength) |
long |
xtrim(byte[] key,
XTrimParams params) |
long |
xtrim(java.lang.String key,
long maxLen,
boolean approximateLength)
XTRIM key MAXLEN [~] count
|
long |
xtrim(java.lang.String key,
XTrimParams params)
XTRIM key MAXLEN|MINID [=|~] threshold [LIMIT count]
|
long |
zadd(byte[] key,
double score,
byte[] member)
Add the specified member having the specified score to the sorted set stored at key.
|
long |
zadd(byte[] key,
double score,
byte[] member,
ZAddParams params) |
long |
zadd(byte[] key,
java.util.Map<byte[],java.lang.Double> scoreMembers) |
long |
zadd(byte[] key,
java.util.Map<byte[],java.lang.Double> scoreMembers,
ZAddParams params) |
long |
zadd(java.lang.String key,
double score,
java.lang.String member)
Add the specified member having the specified score to the sorted set stored at key.
|
long |
zadd(java.lang.String key,
double score,
java.lang.String member,
ZAddParams params)
Similar to
ZADD but can be used with optional params. |
long |
zadd(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Double> scoreMembers)
Similar to
ZADD but for multiple members. |
long |
zadd(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Double> scoreMembers,
ZAddParams params)
Similar to
ZADD but can be used with optional params,
and fits for multiple members. |
java.lang.Double |
zaddIncr(byte[] key,
double score,
byte[] member,
ZAddParams params) |
java.lang.Double |
zaddIncr(java.lang.String key,
double score,
java.lang.String member,
ZAddParams params)
Increments the score of member in the sorted set stored at key by increment.
|
long |
zcard(byte[] key)
Return the sorted set cardinality (number of elements).
|
long |
zcard(java.lang.String 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) |
long |
zcount(java.lang.String key,
double min,
double max)
Return the number of elements in the sorted set at key with a score between min and max.
|
long |
zcount(java.lang.String key,
java.lang.String min,
java.lang.String max)
Similar to
ZCOUNT but with exclusive range. |
java.util.List<byte[]> |
zdiff(byte[]... keys) |
java.util.List<java.lang.String> |
zdiff(java.lang.String... keys)
Compute the difference between all the sets in the given keys.
|
long |
zdiffstore(byte[] dstkey,
byte[]... keys) |
long |
zdiffStore(byte[] dstkey,
byte[]... keys)
Deprecated.
|
long |
zdiffstore(java.lang.String dstkey,
java.lang.String... keys)
Compute the difference between all the sets in the given keys.
|
long |
zdiffStore(java.lang.String dstkey,
java.lang.String... keys)
Deprecated.
|
java.util.List<Tuple> |
zdiffWithScores(byte[]... keys) |
java.util.List<Tuple> |
zdiffWithScores(java.lang.String... keys)
Compute the difference between all the sets in the given keys.
|
double |
zincrby(byte[] key,
double increment,
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.
|
java.lang.Double |
zincrby(byte[] key,
double increment,
byte[] member,
ZIncrByParams params) |
double |
zincrby(java.lang.String key,
double increment,
java.lang.String 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.
|
java.lang.Double |
zincrby(java.lang.String key,
double increment,
java.lang.String member,
ZIncrByParams params)
Similar to
ZINCRBY but can be used with optionals params. |
java.util.List<byte[]> |
zinter(ZParams params,
byte[]... keys)
Intersect multiple sorted sets, This command is similar to ZINTERSTORE, but instead of storing
the resulting sorted set, it is returned to the connection.
|
java.util.List<java.lang.String> |
zinter(ZParams params,
java.lang.String... keys)
Intersect multiple sorted sets, This command is similar to ZINTERSTORE, but instead of storing
the resulting sorted set, it is returned to the connection.
|
long |
zintercard(byte[]... keys)
Similar to
ZINTER , but
instead of returning the result set, it returns just the cardinality of the result. |
long |
zintercard(long limit,
byte[]... keys)
Similar to
ZINTER , but
instead of returning the result set, it returns just the cardinality of the result. |
long |
zintercard(long limit,
java.lang.String... keys)
Similar to
ZINTER , but
instead of returning the result set, it returns just the cardinality of the result. |
long |
zintercard(java.lang.String... keys)
Similar to
ZINTER , but
instead of returning the result set, it returns just the cardinality of the result. |
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,
ZParams params,
byte[]... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
long |
zinterstore(java.lang.String dstkey,
java.lang.String... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
long |
zinterstore(java.lang.String dstkey,
ZParams params,
java.lang.String... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
java.util.List<Tuple> |
zinterWithScores(ZParams params,
byte[]... keys)
Intersect multiple sorted sets, This command is similar to ZINTERSTORE, but instead of storing
the resulting sorted set, it is returned to the connection.
|
java.util.List<Tuple> |
zinterWithScores(ZParams params,
java.lang.String... keys)
Intersect multiple sorted sets, This command is similar to ZINTERSTORE, but instead of storing
the resulting sorted set, it is returned to the connection.
|
long |
zlexcount(byte[] key,
byte[] min,
byte[] max) |
long |
zlexcount(java.lang.String key,
java.lang.String min,
java.lang.String max)
Return the number of elements in the sorted set at key with a value between min and max, when all
the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering.
|
KeyValue<byte[],java.util.List<Tuple>> |
zmpop(SortedSetOption option,
byte[]... keys) |
KeyValue<byte[],java.util.List<Tuple>> |
zmpop(SortedSetOption option,
int count,
byte[]... keys) |
KeyValue<java.lang.String,java.util.List<Tuple>> |
zmpop(SortedSetOption option,
int count,
java.lang.String... keys) |
KeyValue<java.lang.String,java.util.List<Tuple>> |
zmpop(SortedSetOption option,
java.lang.String... keys) |
java.util.List<java.lang.Double> |
zmscore(byte[] key,
byte[]... members)
Returns the scores associated with the specified members in the sorted set stored at key.
|
java.util.List<java.lang.Double> |
zmscore(java.lang.String key,
java.lang.String... members)
Returns the scores associated with the specified members in the sorted set stored at key.
|
Tuple |
zpopmax(byte[] key) |
java.util.List<Tuple> |
zpopmax(byte[] key,
int count) |
Tuple |
zpopmax(java.lang.String key)
Remove and return the member with the highest score in the sorted set stored at key.
|
java.util.List<Tuple> |
zpopmax(java.lang.String key,
int count)
Remove and return up to count members with the highest scores in the sorted set stored at key.
|
Tuple |
zpopmin(byte[] key) |
java.util.List<Tuple> |
zpopmin(byte[] key,
int count) |
Tuple |
zpopmin(java.lang.String key)
Remove and return the member with the lowest score in the sorted set stored at key.
|
java.util.List<Tuple> |
zpopmin(java.lang.String key,
int count)
Remove and return up to count members with the lowest scores in the sorted set stored at key.
|
byte[] |
zrandmember(byte[] key) |
java.util.List<byte[]> |
zrandmember(byte[] key,
long count) |
java.lang.String |
zrandmember(java.lang.String key)
Return a random element from the sorted set value stored at key.
|
java.util.List<java.lang.String> |
zrandmember(java.lang.String key,
long count)
Return an array of distinct elements.
|
java.util.List<Tuple> |
zrandmemberWithScores(byte[] key,
long count) |
java.util.List<Tuple> |
zrandmemberWithScores(java.lang.String key,
long count)
Similar to
ZRANDMEMBER but the replay will
include the scores with the result. |
java.util.List<byte[]> |
zrange(byte[] key,
long start,
long stop) |
java.util.List<byte[]> |
zrange(byte[] key,
ZRangeParams zRangeParams) |
java.util.List<java.lang.String> |
zrange(java.lang.String key,
long start,
long stop)
Returns the specified range of elements in the sorted set stored at key.
|
java.util.List<java.lang.String> |
zrange(java.lang.String key,
ZRangeParams zRangeParams)
Similar to
ZRANGE but can be used with additional params. |
java.util.List<byte[]> |
zrangeByLex(byte[] key,
byte[] min,
byte[] max) |
java.util.List<byte[]> |
zrangeByLex(byte[] key,
byte[] min,
byte[] max,
int offset,
int count) |
java.util.List<java.lang.String> |
zrangeByLex(java.lang.String key,
java.lang.String min,
java.lang.String max)
Return all the elements in the sorted set at key with a value between min and max, when all
the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering.
|
java.util.List<java.lang.String> |
zrangeByLex(java.lang.String key,
java.lang.String min,
java.lang.String max,
int offset,
int count)
Similar to
ZRANGE but with limit option. |
java.util.List<byte[]> |
zrangeByScore(byte[] key,
byte[] min,
byte[] max) |
java.util.List<byte[]> |
zrangeByScore(byte[] key,
byte[] min,
byte[] max,
int offset,
int count) |
java.util.List<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).
|
java.util.List<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).
|
java.util.List<java.lang.String> |
zrangeByScore(java.lang.String 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).
|
java.util.List<java.lang.String> |
zrangeByScore(java.lang.String 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).
|
java.util.List<java.lang.String> |
zrangeByScore(java.lang.String key,
java.lang.String min,
java.lang.String max)
Similar to
ZRANGE but with exclusive range. |
java.util.List<java.lang.String> |
zrangeByScore(java.lang.String key,
java.lang.String min,
java.lang.String max,
int offset,
int count)
Similar to
ZRANGE but with limit option, |
java.util.List<Tuple> |
zrangeByScoreWithScores(byte[] key,
byte[] min,
byte[] max) |
java.util.List<Tuple> |
zrangeByScoreWithScores(byte[] key,
byte[] min,
byte[] max,
int offset,
int count) |
java.util.List<Tuple> |
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).
|
java.util.List<Tuple> |
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).
|
java.util.List<Tuple> |
zrangeByScoreWithScores(java.lang.String 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).
|
java.util.List<Tuple> |
zrangeByScoreWithScores(java.lang.String 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).
|
java.util.List<Tuple> |
zrangeByScoreWithScores(java.lang.String key,
java.lang.String min,
java.lang.String max)
Similar to
ZRANGE but with exclusive range,
and return with scores. |
java.util.List<Tuple> |
zrangeByScoreWithScores(java.lang.String key,
java.lang.String min,
java.lang.String max,
int offset,
int count)
Similar to
ZRANGE but with exclusive range,
with limit options and return with scores. |
long |
zrangestore(byte[] dest,
byte[] src,
ZRangeParams zRangeParams) |
long |
zrangestore(java.lang.String dest,
java.lang.String src,
ZRangeParams zRangeParams)
Similar to
ZRANGE but stores the result in dest . |
java.util.List<Tuple> |
zrangeWithScores(byte[] key,
long start,
long stop) |
java.util.List<Tuple> |
zrangeWithScores(byte[] key,
ZRangeParams zRangeParams) |
java.util.List<Tuple> |
zrangeWithScores(java.lang.String key,
long start,
long stop)
Returns the specified range of elements in the sorted set stored at key with the scores.
|
java.util.List<Tuple> |
zrangeWithScores(java.lang.String key,
ZRangeParams zRangeParams)
Similar to
ZRANGE but can be used with additional params. |
java.lang.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.
|
java.lang.Long |
zrank(java.lang.String key,
java.lang.String member)
Return the rank (or index) of member in the sorted set at key, with scores being ordered from
low to high.
|
KeyValue<java.lang.Long,java.lang.Double> |
zrankWithScore(byte[] key,
byte[] member)
Returns the rank and the score of member in the sorted set stored at key, with the scores
ordered from low to high.
|
KeyValue<java.lang.Long,java.lang.Double> |
zrankWithScore(java.lang.String key,
java.lang.String member)
Returns the rank and the score of member in the sorted set stored at key, with the scores
ordered from low to high.
|
long |
zrem(byte[] key,
byte[]... members)
Remove the specified member from the sorted set value stored at key.
|
long |
zrem(java.lang.String key,
java.lang.String... members)
Remove the specified member from the sorted set value stored at key.
|
long |
zremrangeByLex(byte[] key,
byte[] min,
byte[] max) |
long |
zremrangeByLex(java.lang.String key,
java.lang.String min,
java.lang.String max)
Remove all elements in the sorted set stored at key between the lexicographical range specified by min and max,
when all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering.
|
long |
zremrangeByRank(byte[] key,
long start,
long stop)
Remove all elements in the sorted set at key with rank between start and end.
|
long |
zremrangeByRank(java.lang.String key,
long start,
long stop)
Remove all elements in the sorted set at key with rank between start and end.
|
long |
zremrangeByScore(byte[] key,
byte[] min,
byte[] max) |
long |
zremrangeByScore(byte[] key,
double min,
double max)
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).
|
long |
zremrangeByScore(java.lang.String key,
double min,
double max)
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).
|
long |
zremrangeByScore(java.lang.String key,
java.lang.String min,
java.lang.String max)
Similar to
ZREMRANGE but with limit option. |
java.util.List<byte[]> |
zrevrange(byte[] key,
long start,
long stop) |
java.util.List<java.lang.String> |
zrevrange(java.lang.String key,
long start,
long stop)
Returns the specified range of elements in the sorted set stored at key.
|
java.util.List<byte[]> |
zrevrangeByLex(byte[] key,
byte[] max,
byte[] min) |
java.util.List<byte[]> |
zrevrangeByLex(byte[] key,
byte[] max,
byte[] min,
int offset,
int count) |
java.util.List<java.lang.String> |
zrevrangeByLex(java.lang.String key,
java.lang.String max,
java.lang.String min)
Return all the elements in the sorted set at key with a value between max and min, when all
the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering.
|
java.util.List<java.lang.String> |
zrevrangeByLex(java.lang.String key,
java.lang.String max,
java.lang.String min,
int offset,
int count)
Similar to
ZRANGE but with limit option. |
java.util.List<byte[]> |
zrevrangeByScore(byte[] key,
byte[] max,
byte[] min) |
java.util.List<byte[]> |
zrevrangeByScore(byte[] key,
byte[] max,
byte[] min,
int offset,
int count) |
java.util.List<byte[]> |
zrevrangeByScore(byte[] key,
double max,
double min) |
java.util.List<byte[]> |
zrevrangeByScore(byte[] key,
double max,
double min,
int offset,
int count) |
java.util.List<java.lang.String> |
zrevrangeByScore(java.lang.String key,
double max,
double min)
Return all the elements in the sorted set at key with a score between max and min
(including elements with score equal to max or min).
|
java.util.List<java.lang.String> |
zrevrangeByScore(java.lang.String key,
double max,
double min,
int offset,
int count)
Similar to
ZRANGE but with limit option, |
java.util.List<java.lang.String> |
zrevrangeByScore(java.lang.String key,
java.lang.String max,
java.lang.String min)
Similar to
ZREVRANGE but with exclusive range. |
java.util.List<java.lang.String> |
zrevrangeByScore(java.lang.String key,
java.lang.String max,
java.lang.String min,
int offset,
int count)
Similar to
ZREVRANGE but with limit option, |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(byte[] key,
byte[] max,
byte[] min) |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(byte[] key,
byte[] max,
byte[] min,
int offset,
int count) |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(byte[] key,
double max,
double min) |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(byte[] key,
double max,
double min,
int offset,
int count) |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
double max,
double min)
Similar to
ZREVRANGE but return with scores. |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
double max,
double min,
int offset,
int count)
Similar to
ZREVRANGE but with
limit options and return with scores. |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
java.lang.String max,
java.lang.String min)
Similar to
ZREVRANGE but with exclusive range,
and return with scores. |
java.util.List<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
java.lang.String max,
java.lang.String min,
int offset,
int count)
Similar to
ZREVRANGE but with
exclusive range, with limit options and return with scores. |
java.util.List<Tuple> |
zrevrangeWithScores(byte[] key,
long start,
long stop) |
java.util.List<Tuple> |
zrevrangeWithScores(java.lang.String key,
long start,
long stop)
Similar to
ZREVRANGE but the reply will
include the scores of the returned elements. |
java.lang.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.
|
java.lang.Long |
zrevrank(java.lang.String key,
java.lang.String member)
Return the rank (or index) of member in the sorted set at key, with scores being ordered from
high to low.
|
KeyValue<java.lang.Long,java.lang.Double> |
zrevrankWithScore(byte[] key,
byte[] member)
Returns the rank and the score of member in the sorted set stored at key, with the scores
ordered from high to low.
|
KeyValue<java.lang.Long,java.lang.Double> |
zrevrankWithScore(java.lang.String key,
java.lang.String member)
Returns the rank and the score of member in the sorted set stored at key, with the scores
ordered from high to low.
|
ScanResult<Tuple> |
zscan(byte[] key,
byte[] cursor) |
ScanResult<Tuple> |
zscan(byte[] key,
byte[] cursor,
ScanParams params) |
ScanResult<Tuple> |
zscan(java.lang.String key,
java.lang.String cursor,
ScanParams params) |
java.lang.Double |
zscore(byte[] key,
byte[] member)
Return the score of the specified element of the sorted set at key.
|
java.lang.Double |
zscore(java.lang.String key,
java.lang.String member)
Return the score of the specified element of the sorted set at key.
|
java.util.List<byte[]> |
zunion(ZParams params,
byte[]... keys)
Add multiple sorted sets, This command is similar to ZUNIONSTORE, but instead of storing the
resulting sorted set, it is returned to the connection.
|
java.util.List<java.lang.String> |
zunion(ZParams params,
java.lang.String... keys)
Add multiple sorted sets, This command is similar to ZUNIONSTORE, but instead of storing the
resulting sorted set, it is returned to the connection.
|
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,
ZParams params,
byte[]... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
long |
zunionstore(java.lang.String dstkey,
java.lang.String... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
long |
zunionstore(java.lang.String dstkey,
ZParams params,
java.lang.String... sets)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
java.util.List<Tuple> |
zunionWithScores(ZParams params,
byte[]... keys)
Add multiple sorted sets with scores, This command is similar to ZUNIONSTORE, but instead of
storing the resulting sorted set, it is returned to the connection.
|
java.util.List<Tuple> |
zunionWithScores(ZParams params,
java.lang.String... keys)
Add multiple sorted sets with scores, This command is similar to ZUNIONSTORE, but instead of
storing the resulting sorted set, it is returned to the connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
shutdown
hscan
sscan
zscan
xadd
xadd
protected final Connection connection
protected static final byte[][] DUMMY_ARRAY
public Jedis()
public Jedis(java.lang.String url)
JedisURIHelper.isValid(java.net.URI)
can be
used before this.url
- public Jedis(HostAndPort hp)
public Jedis(java.lang.String host, int port)
public Jedis(java.lang.String host, int port, JedisClientConfig config)
public Jedis(HostAndPort hostPort, JedisClientConfig config)
public Jedis(java.lang.String host, int port, boolean ssl)
public Jedis(java.lang.String host, int port, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.lang.String host, int port, int timeout)
public Jedis(java.lang.String host, int port, int timeout, boolean ssl)
public Jedis(java.lang.String host, int port, int timeout, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.lang.String host, int port, int connectionTimeout, int soTimeout)
public Jedis(java.lang.String host, int port, int connectionTimeout, int soTimeout, int infiniteSoTimeout)
public Jedis(java.lang.String host, int port, int connectionTimeout, int soTimeout, boolean ssl)
public Jedis(java.lang.String host, int port, int connectionTimeout, int soTimeout, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.lang.String host, int port, int connectionTimeout, int soTimeout, int infiniteSoTimeout, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.net.URI uri)
public Jedis(java.net.URI uri, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.net.URI uri, int timeout)
public Jedis(java.net.URI uri, int timeout, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.net.URI uri, int connectionTimeout, int soTimeout)
public Jedis(java.net.URI uri, int connectionTimeout, int soTimeout, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.net.URI uri, int connectionTimeout, int soTimeout, int infiniteSoTimeout, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
public Jedis(java.net.URI uri, JedisClientConfig config)
public Jedis(JedisSocketFactory jedisSocketFactory)
public Jedis(JedisSocketFactory jedisSocketFactory, JedisClientConfig clientConfig)
public Jedis(Connection connection)
public java.lang.String toString()
toString
in class java.lang.Object
public Connection getClient()
public Connection getConnection()
public void connect()
public void disconnect()
public boolean isConnected()
public boolean isBroken()
public void resetState()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public Transaction multi()
public Pipeline pipelined()
protected void checkIsInMultiOrPipeline()
public int getDB()
public java.lang.String ping()
ServerCommands
ping
in interface ServerCommands
PONG
public byte[] ping(byte[] message)
ping()
but returns argument message instead of PONG
.message
- public java.lang.String select(int index)
select
in interface DatabaseCommands
index
- public java.lang.String swapDB(int index1, int index2)
DatabaseCommands
swapDB
in interface DatabaseCommands
public java.lang.String flushDB()
flushDB
in interface DatabaseCommands
flushDB
in interface ServerCommands
public java.lang.String flushDB(FlushMode flushMode)
flushDB
in interface DatabaseCommands
flushDB
in interface ServerCommands
flushMode
- public java.lang.String flushAll()
flushAll
in interface ServerCommands
public java.lang.String flushAll(FlushMode flushMode)
flushAll
in interface ServerCommands
flushMode
- public boolean copy(byte[] srcKey, byte[] dstKey, int db, boolean replace)
copy
in interface DatabaseCommands
srcKey
- the source key.dstKey
- the destination key.db
- replace
- DatabaseCommands.copy(String, String, int, boolean)
public boolean copy(byte[] srcKey, byte[] dstKey, boolean replace)
copy
in interface KeyBinaryCommands
srcKey
- the source key.dstKey
- the destination key.replace
- public java.lang.String set(byte[] key, byte[] value)
Time complexity: O(1)
set
in interface StringBinaryCommands
key
- value
- public java.lang.String set(byte[] key, byte[] value, SetParams params)
set
in interface StringBinaryCommands
key
- value
- params
- NX|XX, NX -- Only set the key if it does not already exist. XX -- Only set the
key if it already exists. EX|PX, expire time units: EX = seconds; PX = millisecondsOK
if SET
was executed correctly, or null
if the SET
operation was not performed because the user specified the NX or XX option
but the condition was not met.public byte[] get(byte[] key)
Time complexity: O(1)
get
in interface StringBinaryCommands
key
- public byte[] setGet(byte[] key, byte[] value)
setGet
in interface StringBinaryCommands
public byte[] setGet(byte[] key, byte[] value, SetParams params)
setGet
in interface StringBinaryCommands
public byte[] getDel(byte[] key)
Time complexity: O(1)
getDel
in interface StringBinaryCommands
key
- public byte[] getEx(byte[] key, GetExParams params)
getEx
in interface StringBinaryCommands
public long exists(byte[]... keys)
exists
in interface KeyBinaryCommands
keys
- public boolean exists(byte[] key)
exists
in interface KeyBinaryCommands
key
- true
if the key exists, otherwise false
public long del(byte[]... keys)
del
in interface KeyBinaryCommands
keys
- public long del(byte[] key)
del
in interface KeyBinaryCommands
public long unlink(byte[]... keys)
Time complexity: O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.
unlink
in interface KeyBinaryCommands
keys
- public long unlink(byte[] key)
unlink
in interface KeyBinaryCommands
public java.lang.String type(byte[] key)
type
in interface KeyBinaryCommands
key
- public java.util.Set<byte[]> keys(byte[] pattern)
Note that while the time complexity for this operation is O(n) the constant times are pretty low. For example Redis running on an entry level laptop can scan a 1 million keys database in 40 milliseconds. Still it's better to consider this one of the slow commands that may ruin the DB performance if not used with care.
In other words this command is intended only for debugging and special operations like creating a script to change the DB schema. Don't use it in your normal code. Use Redis Sets in order to group together a subset of objects.
Glob style patterns examples:
Use \ to escape special chars if you want to match them verbatim.
Time complexity: O(n) (with n being the number of keys in the DB, and assuming keys and pattern of limited length)
keys
in interface KeyBinaryCommands
pattern
- public byte[] randomBinaryKey()
Time complexity: O(1)
randomBinaryKey
in interface KeyBinaryCommands
public java.lang.String rename(byte[] oldkey, byte[] newkey)
Time complexity: O(1)
rename
in interface KeyBinaryCommands
oldkey
- newkey
- public long renamenx(byte[] oldkey, byte[] newkey)
Time complexity: O(1)
renamenx
in interface KeyBinaryCommands
oldkey
- newkey
- public long dbSize()
dbSize
in interface DatabaseCommands
public long expire(byte[] key, long seconds)
Volatile keys are stored on disk like the other keys, the timeout is persistent too like all the other aspects of the dataset. Saving a dataset containing expires and stopping the server does not stop the flow of time as Redis stores on disk the time when the key will no longer be available as Unix time, and not the remaining seconds.
Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
set. It is also possible to undo the expire at all turning the key into a normal key using the
PERSIST
command.
Time complexity: O(1)
expire
in interface KeyBinaryCommands
key
- seconds
- public long expire(byte[] key, long seconds, ExpiryOption expiryOption)
expire
in interface KeyBinaryCommands
public long pexpire(byte[] key, long milliseconds)
Volatile keys are stored on disk like the other keys, the timeout is persistent too like all the other aspects of the dataset. Saving a dataset containing expires and stopping the server does not stop the flow of time as Redis stores on disk the time when the key will no longer be available as Unix time, and not the remaining milliseconds.
Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
set. It is also possible to undo the expire at all turning the key into a normal key using the
PERSIST
command.
Time complexity: O(1)
pexpire
in interface KeyBinaryCommands
key
- milliseconds
- public long pexpire(byte[] key, long milliseconds, ExpiryOption expiryOption)
pexpire
in interface KeyBinaryCommands
public long expireTime(byte[] key)
expireTime
in interface KeyBinaryCommands
public long pexpireTime(byte[] key)
pexpireTime
in interface KeyBinaryCommands
public long expireAt(byte[] key, long unixTime)
EXPIRE
but instead to get the
number of seconds representing the Time To Live of the key as a second argument (that is a
relative way of specifying the TTL), it takes an absolute one in the form of a UNIX timestamp
(Number of seconds elapsed since 1 Gen 1970).
EXPIREAT was introduced in order to implement the Append Only File persistence mode so that EXPIRE commands are automatically translated into EXPIREAT commands for the append only file. Of course EXPIREAT can also used by programmers that need a way to simply specify that a given key should expire at a given time in the future.
Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
set. It is also possible to undo the expire at all turning the key into a normal key using the
PERSIST
command.
Time complexity: O(1)
expireAt
in interface KeyBinaryCommands
key
- unixTime
- public long expireAt(byte[] key, long unixTime, ExpiryOption expiryOption)
expireAt
in interface KeyBinaryCommands
public long pexpireAt(byte[] key, long millisecondsTimestamp)
pexpireAt
in interface KeyBinaryCommands
public long pexpireAt(byte[] key, long millisecondsTimestamp, ExpiryOption expiryOption)
pexpireAt
in interface KeyBinaryCommands
public long ttl(byte[] key)
EXPIRE
set. This introspection capability allows a Redis
connection to check how many seconds a given key will continue to be part of the dataset.ttl
in interface KeyBinaryCommands
key
- public long touch(byte[]... keys)
touch
in interface KeyBinaryCommands
keys
- public long touch(byte[] key)
touch
in interface KeyBinaryCommands
public long move(byte[] key, int dbIndex)
move
in interface DatabaseCommands
key
- dbIndex
- DatabaseCommands.move(String, int)
public byte[] getSet(byte[] key, byte[] value)
Time complexity: O(1)
getSet
in interface StringBinaryCommands
key
- value
- public java.util.List<byte[]> mget(byte[]... keys)
Time complexity: O(1) for every key
mget
in interface StringBinaryCommands
keys
- public long setnx(byte[] key, byte[] value)
SET
with the only difference that if
the key already exists no operation is performed. SETNX actually means "SET if Not eXists".
Time complexity: O(1)
setnx
in interface StringBinaryCommands
key
- value
- public java.lang.String setex(byte[] key, long seconds, byte[] value)
SET
+ EXPIRE
. The
operation is atomic.
Time complexity: O(1)
setex
in interface StringBinaryCommands
key
- seconds
- value
- public java.lang.String mset(byte[]... keysvalues)
MSETNX
will not perform any operation at all even
if just a single key already exists.
Because of this semantic MSETNX can be used in order to set different keys representing different fields of an unique logic object in a way that ensures that either all the fields or none at all are set.
Both MSET and MSETNX are atomic operations. This means that for instance if the keys A and B are modified, another connection talking to Redis can either see the changes to both A and B at once, or no modification at all.
mset
in interface StringBinaryCommands
keysvalues
- msetnx(byte[][])
public long msetnx(byte[]... keysvalues)
MSET
will
replace old values with new values, while MSETNX will not perform any operation at all even if
just a single key already exists.
Because of this semantic MSETNX can be used in order to set different keys representing different fields of an unique logic object in a way that ensures that either all the fields or none at all are set.
Both MSET and MSETNX are atomic operations. This means that for instance if the keys A and B are modified, another connection talking to Redis can either see the changes to both A and B at once, or no modification at all.
msetnx
in interface StringBinaryCommands
keysvalues
- mset(byte[][])
public long decrBy(byte[] key, long decrement)
DECR
but instead to decrement by 1 the
decrement is integer.
DECR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
decrBy
in interface StringBinaryCommands
key
- decrement
- incr(byte[])
,
decr(byte[])
,
incrBy(byte[], long)
public long decr(byte[] key)
DECR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
decr
in interface StringBinaryCommands
key
- incr(byte[])
,
incrBy(byte[], long)
,
decrBy(byte[], long)
public long incrBy(byte[] key, long increment)
INCR
but instead to increment by 1 the
increment is integer.
INCR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
incrBy
in interface StringBinaryCommands
key
- increment
- incr(byte[])
,
decr(byte[])
,
decrBy(byte[], long)
public double incrByFloat(byte[] key, double increment)
incrBy(byte[], long)
INCRBY} but increments by floats
instead of integers.
INCRBYFLOAT commands are limited to double precision floating point values.
Note: this is actually a string operation, that is, in Redis there are not "double" types. Simply the string stored at the key is parsed as a base double precision floating point value, incremented, and then converted back as a string. There is no DECRYBYFLOAT but providing a negative value will work as expected.
Time complexity: O(1)
incrByFloat
in interface StringBinaryCommands
key
- the key to incrementincrement
- the value to increment byincr(byte[])
,
decr(byte[])
,
decrBy(byte[], long)
public long incr(byte[] key)
INCR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
incr
in interface StringBinaryCommands
key
- incrBy(byte[], long)
,
decr(byte[])
,
decrBy(byte[], long)
public long append(byte[] key, byte[] value)
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.
append
in interface StringBinaryCommands
key
- value
- public byte[] substr(byte[] key, int start, int end)
The function handles out of range requests without raising an error, but just limiting the resulting range to the actual length of the string.
Time complexity: O(start+n) (with start being the start index and n the total length of the requested range). Note that the lookup part of this command is O(1) so for small strings this is actually an O(1) command.
substr
in interface StringBinaryCommands
key
- start
- end
- public long hset(byte[] key, byte[] field, byte[] value)
If key does not exist, a new key holding a hash is created.
Time complexity: O(1)
hset
in interface HashBinaryCommands
key
- field
- value
- public long hset(byte[] key, java.util.Map<byte[],byte[]> hash)
hset
in interface HashBinaryCommands
public byte[] hget(byte[] key, byte[] field)
If the field is not found or the key does not exist, a special 'nil' value is returned.
Time complexity: O(1)
hget
in interface HashBinaryCommands
key
- field
- public long hsetnx(byte[] key, byte[] field, byte[] value)
hsetnx
in interface HashBinaryCommands
key
- field
- value
- public java.lang.String hmset(byte[] key, java.util.Map<byte[],byte[]> hash)
If key does not exist, a new key holding a hash is created.
Time complexity: O(N) (with N being the number of fields)
hmset
in interface HashBinaryCommands
key
- hash
- public java.util.List<byte[]> hmget(byte[] key, byte[]... fields)
If some of the specified fields do not exist, nil values are returned. Non existing keys are considered like empty hashes.
Time complexity: O(N) (with N being the number of fields)
hmget
in interface HashBinaryCommands
key
- fields
- public long hincrBy(byte[] key, byte[] field, long value)
The range of values supported by HINCRBY is limited to 64-bit signed integers.
Time complexity: O(1)
hincrBy
in interface HashBinaryCommands
key
- field
- value
- public double hincrByFloat(byte[] key, byte[] field, double value)
The range of values supported by HINCRBYFLOAT is limited to double precision floating point values.
Time complexity: O(1)
hincrByFloat
in interface HashBinaryCommands
key
- field
- value
- public boolean hexists(byte[] key, byte[] field)
hexists
in interface HashBinaryCommands
key
- field
- true
if the hash stored at key contains the specified field, false
if the key is
not found or the field is not present.public long hdel(byte[] key, byte[]... fields)
Time complexity: O(1)
hdel
in interface HashBinaryCommands
key
- fields
- public long hlen(byte[] key)
Time complexity: O(1)
hlen
in interface HashBinaryCommands
key
- public java.util.Set<byte[]> hkeys(byte[] key)
Time complexity: O(N), where N is the total number of entries
hkeys
in interface HashBinaryCommands
key
- public java.util.List<byte[]> hvals(byte[] key)
Time complexity: O(N), where N is the total number of entries
hvals
in interface HashBinaryCommands
key
- public java.util.Map<byte[],byte[]> hgetAll(byte[] key)
Time complexity: O(N), where N is the total number of entries
hgetAll
in interface HashBinaryCommands
key
- public byte[] hrandfield(byte[] key)
Time complexity: O(N), where N is the number of fields returned
hrandfield
in interface HashBinaryCommands
key
- public java.util.List<byte[]> hrandfield(byte[] key, long count)
Time complexity: O(N), where N is the number of fields returned
hrandfield
in interface HashBinaryCommands
key
- public java.util.List<java.util.Map.Entry<byte[],byte[]>> hrandfieldWithValues(byte[] key, long count)
Time complexity: O(N), where N is the number of fields returned
hrandfieldWithValues
in interface HashBinaryCommands
key
- public long rpush(byte[] key, byte[]... strings)
Time complexity: O(1)
rpush
in interface ListBinaryCommands
key
- strings
- public long lpush(byte[] key, byte[]... strings)
Time complexity: O(1)
lpush
in interface ListBinaryCommands
key
- strings
- public long llen(byte[] key)
Time complexity: O(1)
llen
in interface ListBinaryCommands
key
- public java.util.List<byte[]> lrange(byte[] key, long start, long stop)
For example LRANGE foobar 0 2 will return the first three elements of the list.
start and end can also be negative numbers indicating offsets from the end of the list. For example -1 is the last element of the list, -2 the penultimate element and so on.
Consistency with range functions in various programming languages
Note that if you have a list of numbers from 0 to 100, LRANGE 0 10 will return 11 elements, that is, rightmost item is included. This may or may not be consistent with behavior of range-related functions in your programming language of choice (think Ruby's Range.new, Array#slice or Python's range() function).
LRANGE behavior is consistent with one of Tcl.
Out-of-range indexes
Indexes out of range will not produce an error: if start is over the end of the list, or start > end, an empty list is returned. If end is over the end of the list Redis will threat it just like the last element of the list.
Time complexity: O(start+n) (with n being the length of the range and start being the start offset)
lrange
in interface ListBinaryCommands
key
- start
- stop
- public java.lang.String ltrim(byte[] key, long start, long stop)
For example LTRIM foobar 0 2 will modify the list stored at foobar key so that only the first three elements of the list will remain.
start and end can also be negative numbers indicating offsets from the end of the list. For example -1 is the last element of the list, -2 the penultimate element and so on.
Indexes out of range will not produce an error: if start is over the end of the list, or start > end, an empty list is left as value. If end over the end of the list Redis will threat it just like the last element of the list.
Hint: the obvious use of LTRIM is together with LPUSH/RPUSH. For example:
lpush("mylist", "someelement"); ltrim("mylist", 0, 99); *
The above two commands will push elements in the list taking care that the list will not grow without limits. This is very useful when using Redis to store logs for example. It is important to note that when used in this way LTRIM is an O(1) operation because in the average case just one element is removed from the tail of the list.
Time complexity: O(n) (with n being len of list - len of range)
ltrim
in interface ListBinaryCommands
key
- start
- stop
- public byte[] lindex(byte[] key, long index)
If the value stored at key is not of list type an error is returned. If the index is out of range a 'nil' reply is returned.
Note that even if the average time complexity is O(n) asking for the first or the last element of the list is O(1).
Time complexity: O(n) (with n being the length of the list)
lindex
in interface ListBinaryCommands
key
- index
- public java.lang.String lset(byte[] key, long index, byte[] value)
Out of range indexes will generate an error.
Similarly to other list commands accepting indexes, the index can be negative to access elements starting from the end of the list. So -1 is the last element, -2 is the penultimate, and so forth.
Time complexity:
O(N) (with N being the length of the list), setting the first or last elements of the list is O(1).
lset
in interface ListBinaryCommands
key
- index
- value
- lindex(byte[], long)
public long lrem(byte[] key, long count, byte[] value)
Time complexity: O(N) (with N being the length of the list)
lrem
in interface ListBinaryCommands
key
- count
- value
- public byte[] lpop(byte[] key)
If the key does not exist or the list is already empty the special value 'nil' is returned.
lpop
in interface ListBinaryCommands
key
- rpop(byte[])
public java.util.List<byte[]> lpop(byte[] key, int count)
lpop
in interface ListBinaryCommands
public java.lang.Long lpos(byte[] key, byte[] element)
Time complexity: O(N) where N is the number of elements in the list
lpos
in interface ListBinaryCommands
key
- element
- lpos(byte[], byte[])
public java.lang.Long lpos(byte[] key, byte[] element, LPosParams params)
Maxlen option compares the element provided only with a given maximum number of list items. A value of 1000 will make sure that the command performs only 1000 comparisons. The comparison is made for the first part or the last part depending on the fact we use a positive or negative rank. Following is how we could use the Maxlen option lpos("foo", "b", LPosParams.lPosParams().rank(1).maxlen(2)).
lpos
in interface ListBinaryCommands
key
- element
- params
- lpos(byte[], byte[], LPosParams)
public java.util.List<java.lang.Long> lpos(byte[] key, byte[] element, LPosParams params, long count)
Time complexity: O(N) where N is the number of elements in the list
lpos
in interface ListBinaryCommands
key
- element
- params
- count
- lpos(byte[], byte[], LPosParams, long)
public byte[] rpop(byte[] key)
If the key does not exist or the list is already empty the special value 'nil' is returned.
rpop
in interface ListBinaryCommands
key
- lpop(byte[])
public java.util.List<byte[]> rpop(byte[] key, int count)
rpop
in interface ListBinaryCommands
public byte[] rpoplpush(byte[] srckey, byte[] dstkey)
If the key does not exist or the list is already empty the special value 'nil' is returned. If the srckey and dstkey are the same the operation is equivalent to removing the last element from the list and pushing it as first element of the list, so it's a "list rotation" command.
Time complexity: O(1)
rpoplpush
in interface ListBinaryCommands
srckey
- dstkey
- public long sadd(byte[] key, byte[]... members)
Time complexity O(1)
sadd
in interface SetBinaryCommands
key
- members
- public java.util.Set<byte[]> smembers(byte[] key)
sinter(byte[][])
SINTER}.
Time complexity O(N)
smembers
in interface SetBinaryCommands
key
- the key of the setpublic long srem(byte[] key, byte[]... members)
Time complexity O(1)
srem
in interface SetBinaryCommands
key
- the key of the setmembers
- the set member to removepublic byte[] spop(byte[] key)
The srandmember(byte[])
command does a similar work but the returned element is
not removed from the Set.
Time complexity O(1)
spop
in interface SetBinaryCommands
key
- public java.util.Set<byte[]> spop(byte[] key, long count)
spop
in interface SetBinaryCommands
public long smove(byte[] srckey, byte[] dstkey, byte[] member)
If the source set does not exist or does not contain the specified element no operation is performed and zero is returned, otherwise the element is removed from the source set and added to the destination set. On success one is returned, even if the element was already present in the destination set.
An error is raised if the source or destination keys contain a non Set value.
Time complexity O(1)
smove
in interface SetBinaryCommands
srckey
- dstkey
- member
- public long scard(byte[] key)
scard
in interface SetBinaryCommands
key
- public boolean sismember(byte[] key, byte[] member)
Time complexity O(1)
sismember
in interface SetBinaryCommands
key
- member
- true
if the element is a member of the set, false
otherwisepublic java.util.List<java.lang.Boolean> smismember(byte[] key, byte[]... members)
Time complexity O(N) where N is the number of elements being checked for membership
smismember
in interface SetBinaryCommands
key
- members
- public java.util.Set<byte[]> sinter(byte[]... keys)
lrange(byte[], long, long)
LRANGE} the result is sent to
the connection as a multi-bulk reply (see the protocol specification for more information). If
just a single key is specified, then this command produces the same result as
SMEMBERS
. Actually SMEMBERS is just syntax sugar for SINTER.
Non existing keys are considered like empty sets, so if one of the keys is missing an empty set is returned (since the intersection with an empty set always is an empty set).
Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the number of sets
sinter
in interface SetBinaryCommands
keys
- public long sinterstore(byte[] dstkey, byte[]... keys)
SINTER
but instead of being
returned the resulting set is stored as dstkey.
Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the number of sets
sinterstore
in interface SetBinaryCommands
dstkey
- keys
- public long sintercard(byte[]... keys)
SINTER
but instead of returning
the result set, it returns just the cardinality of the result. LIMIT defaults to 0 and means unlimited
Time complexity O(N*M) worst case where N is the cardinality of the smallest
sintercard
in interface SetBinaryCommands
keys
- public long sintercard(int limit, byte[]... keys)
SINTER
but instead of returning
the result set, it returns just the cardinality of the result.
Time complexity O(N*M) worst case where N is the cardinality of the smallest
sintercard
in interface SetBinaryCommands
limit
- If the intersection cardinality reaches limit partway through the computation,
the algorithm will exit and yield limit as the cardinality.keys
- public java.util.Set<byte[]> sunion(byte[]... keys)
lrange(byte[], long, long)
LRANGE} the result is sent to the
connection as a multi-bulk reply (see the protocol specification for more information). If just
a single key is specified, then this command produces the same result as
SMEMBERS
.
Non existing keys are considered like empty sets.
Time complexity O(N) where N is the total number of elements in all the provided sets
sunion
in interface SetBinaryCommands
keys
- public long sunionstore(byte[] dstkey, byte[]... keys)
SUNION
but instead of being
returned the resulting set is stored as dstkey. Any existing value in dstkey will be
over-written.
Time complexity O(N) where N is the total number of elements in all the provided sets
sunionstore
in interface SetBinaryCommands
dstkey
- keys
- public java.util.Set<byte[]> sdiff(byte[]... keys)
Example:
key1 = [x, a, b, c] key2 = [c] key3 = [a, d] SDIFF key1,key2,key3 => [x, b]Non existing keys are considered like empty sets.
Time complexity:
O(N) with N being the total number of elements of all the sets
sdiff
in interface SetBinaryCommands
keys
- public long sdiffstore(byte[] dstkey, byte[]... keys)
SDIFF
but instead of being returned
the resulting set is stored in dstkey.sdiffstore
in interface SetBinaryCommands
dstkey
- keys
- public byte[] srandmember(byte[] key)
The SPOP command does a similar work but the returned element is popped (removed) from the Set.
Time complexity O(1)
srandmember
in interface SetBinaryCommands
key
- public java.util.List<byte[]> srandmember(byte[] key, int count)
srandmember
in interface SetBinaryCommands
public long zadd(byte[] key, double score, byte[] member)
The score value can be the string representation of a double precision floating point number.
Time complexity O(log(N)) with N being the number of elements in the sorted set
zadd
in interface SortedSetBinaryCommands
key
- score
- member
- public long zadd(byte[] key, double score, byte[] member, ZAddParams params)
zadd
in interface SortedSetBinaryCommands
public long zadd(byte[] key, java.util.Map<byte[],java.lang.Double> scoreMembers)
zadd
in interface SortedSetBinaryCommands
public long zadd(byte[] key, java.util.Map<byte[],java.lang.Double> scoreMembers, ZAddParams params)
zadd
in interface SortedSetBinaryCommands
public java.lang.Double zaddIncr(byte[] key, double score, byte[] member, ZAddParams params)
zaddIncr
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrange(byte[] key, long start, long stop)
zrange
in interface SortedSetBinaryCommands
public long zrem(byte[] key, byte[]... members)
Time complexity O(log(N)) with N being the number of elements in the sorted set
zrem
in interface SortedSetBinaryCommands
key
- members
- public double zincrby(byte[] key, double increment, byte[] member)
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
zincrby
in interface SortedSetBinaryCommands
key
- increment
- member
- public java.lang.Double zincrby(byte[] key, double increment, byte[] member, ZIncrByParams params)
zincrby
in interface SortedSetBinaryCommands
public java.lang.Long zrank(byte[] key, byte[] member)
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))
zrank
in interface SortedSetBinaryCommands
key
- member
- zrevrank(byte[], byte[])
public java.lang.Long zrevrank(byte[] key, byte[] member)
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))
zrevrank
in interface SortedSetBinaryCommands
key
- member
- zrank(byte[], byte[])
public KeyValue<java.lang.Long,java.lang.Double> zrankWithScore(byte[] key, byte[] member)
zrankWithScore
in interface SortedSetBinaryCommands
key
- the keymember
- the memberpublic KeyValue<java.lang.Long,java.lang.Double> zrevrankWithScore(byte[] key, byte[] member)
zrevrankWithScore
in interface SortedSetBinaryCommands
key
- the keymember
- the memberpublic java.util.List<byte[]> zrevrange(byte[] key, long start, long stop)
zrevrange
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrangeWithScores(byte[] key, long start, long stop)
zrangeWithScores
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrevrangeWithScores(byte[] key, long start, long stop)
zrevrangeWithScores
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrange(byte[] key, ZRangeParams zRangeParams)
zrange
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrangeWithScores(byte[] key, ZRangeParams zRangeParams)
zrangeWithScores
in interface SortedSetBinaryCommands
public long zrangestore(byte[] dest, byte[] src, ZRangeParams zRangeParams)
zrangestore
in interface SortedSetBinaryCommands
public byte[] zrandmember(byte[] key)
zrandmember
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrandmember(byte[] key, long count)
zrandmember
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrandmemberWithScores(byte[] key, long count)
zrandmemberWithScores
in interface SortedSetBinaryCommands
public long zcard(byte[] key)
Time complexity O(1)
zcard
in interface SortedSetBinaryCommands
key
- public java.lang.Double zscore(byte[] key, byte[] member)
Time complexity: O(1)
zscore
in interface SortedSetBinaryCommands
key
- member
- public java.util.List<java.lang.Double> zmscore(byte[] key, byte[]... members)
Time complexity: O(N) where N is the number of members being requested.
zmscore
in interface SortedSetBinaryCommands
key
- members
- public Tuple zpopmax(byte[] key)
zpopmax
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zpopmax(byte[] key, int count)
zpopmax
in interface SortedSetBinaryCommands
public Tuple zpopmin(byte[] key)
zpopmin
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zpopmin(byte[] key, int count)
zpopmin
in interface SortedSetBinaryCommands
public java.lang.String watch(byte[]... keys)
public java.lang.String unwatch()
public java.util.List<byte[]> sort(byte[] key)
Sort the elements contained in the List, Set, or Sorted Set value at key. By default sorting is numeric with elements being compared as double precision floating point numbers. This is the simplest form of SORT.
sort
in interface KeyBinaryCommands
key
- sort(byte[], byte[])
,
sort(byte[], SortingParams)
,
sort(byte[], SortingParams, byte[])
public java.util.List<byte[]> sort(byte[] key, SortingParams sortingParams)
examples:
Given are the following sets and key/values:
x = [1, 2, 3] y = [a, b, c] k1 = z k2 = y k3 = x w1 = 9 w2 = 8 w3 = 7Sort Order:
sort(x) or sort(x, sp.asc()) -> [1, 2, 3] sort(x, sp.desc()) -> [3, 2, 1] sort(y) -> [c, a, b] sort(y, sp.alpha()) -> [a, b, c] sort(y, sp.alpha().desc()) -> [c, a, b]Limit (e.g. for Pagination):
sort(x, sp.limit(0, 2)) -> [1, 2] sort(y, sp.alpha().desc().limit(1, 2)) -> [b, a]Sorting by external keys:
sort(x, sb.by(w*)) -> [3, 2, 1] sort(x, sb.by(w*).desc()) -> [1, 2, 3]Getting external keys:
sort(x, sp.by(w*).get(k*)) -> [x, y, z] sort(x, sp.by(w*).get(#).get(k*)) -> [3, x, 2, y, 1, z]
sort
in interface KeyBinaryCommands
key
- sortingParams
- sort(byte[])
,
sort(byte[], SortingParams, byte[])
public long sort(byte[] key, SortingParams sortingParams, byte[] dstkey)
sort
in interface KeyBinaryCommands
key
- sortingParams
- dstkey
- sort(byte[], SortingParams)
,
sort(byte[])
,
sort(byte[], byte[])
public long sort(byte[] key, byte[] dstkey)
Sort the elements contained in the List, Set, or Sorted Set value at key and store the result at dstkey. By default sorting is numeric with elements being compared as double precision floating point numbers. This is the simplest form of SORT.
sort
in interface KeyBinaryCommands
key
- dstkey
- sort(byte[])
,
sort(byte[], SortingParams)
,
sort(byte[], SortingParams, byte[])
public java.util.List<byte[]> sortReadonly(byte[] key, SortingParams sortingParams)
sortReadonly
in interface KeyBinaryCommands
public byte[] lmove(byte[] srcKey, byte[] dstKey, ListDirection from, ListDirection to)
lmove
in interface ListBinaryCommands
srcKey
- dstKey
- from
- to
- public byte[] blmove(byte[] srcKey, byte[] dstKey, ListDirection from, ListDirection to, double timeout)
blmove
in interface ListBinaryCommands
srcKey
- dstKey
- from
- to
- timeout
- public java.util.List<byte[]> blpop(int timeout, byte[]... keys)
The following is a description of the exact semantic. We describe BLPOP but the two commands are identical, the only difference is that BLPOP pops the element from the left (head) of the list, and BRPOP pops from the right (tail).
Non blocking behavior
When BLPOP is called, if at least one of the specified keys contain a non empty list, an element is popped from the head of the list and returned to the caller together with the name of the key (BLPOP returns a two elements array, the first element is the key, the second the popped value).
Keys are scanned from left to right, so for instance if you issue BLPOP list1 list2 list3 0 against a dataset where list1 does not exist but list2 and list3 contain non empty lists, BLPOP guarantees to return an element from the list stored at list2 (since it is the first non empty list starting from the left).
Blocking behavior
If none of the specified keys exist or contain non empty lists, BLPOP blocks until some other connection performs a LPUSH or an RPUSH operation against one of the lists.
Once new data is present on one of the lists, the connection finally returns with the name of the key unblocking it and the popped value.
When blocking, if a non-zero timeout is specified, the connection will unblock returning a nil special value if the specified amount of seconds passed without a push operation against at least one of the specified keys.
The timeout argument is interpreted as an integer value. A timeout of zero means instead to block forever.
Multiple clients blocking for the same keys
Multiple clients can block for the same key. They are put into a queue, so the first to be served will be the one that started to wait earlier, in a first-blpopping first-served fashion.
blocking POP inside a MULTI/EXEC transaction
BLPOP and BRPOP can be used with pipelining (sending multiple commands and reading the replies in batch), but it does not make sense to use BLPOP or BRPOP inside a MULTI/EXEC block (a Redis transaction).
The behavior of BLPOP inside MULTI/EXEC when the list is empty is to return a multi-bulk nil reply, exactly what happens when the timeout is reached. If you like science fiction, think at it like if inside MULTI/EXEC the time will flow at infinite speed :)
Time complexity: O(1)
blpop
in interface ListBinaryCommands
timeout
- keys
- When a non-zero timeout is specified, and the BLPOP operation timed out, the return value is a nil multi bulk reply. Most connection values will return false or nil accordingly to the programming language used.
public KeyValue<byte[],byte[]> blpop(double timeout, byte[]... keys)
blpop
in interface ListBinaryCommands
public java.util.List<byte[]> brpop(int timeout, byte[]... keys)
The following is a description of the exact semantic. We describe BLPOP but the two commands are identical, the only difference is that BLPOP pops the element from the left (head) of the list, and BRPOP pops from the right (tail).
Non blocking behavior
When BLPOP is called, if at least one of the specified keys contain a non empty list, an element is popped from the head of the list and returned to the caller together with the name of the key (BLPOP returns a two elements array, the first element is the key, the second the popped value).
Keys are scanned from left to right, so for instance if you issue BLPOP list1 list2 list3 0 against a dataset where list1 does not exist but list2 and list3 contain non empty lists, BLPOP guarantees to return an element from the list stored at list2 (since it is the first non empty list starting from the left).
Blocking behavior
If none of the specified keys exist or contain non empty lists, BLPOP blocks until some other connection performs a LPUSH or an RPUSH operation against one of the lists.
Once new data is present on one of the lists, the connection finally returns with the name of the key unblocking it and the popped value.
When blocking, if a non-zero timeout is specified, the connection will unblock returning a nil special value if the specified amount of seconds passed without a push operation against at least one of the specified keys.
The timeout argument is interpreted as an integer value. A timeout of zero means instead to block forever.
Multiple clients blocking for the same keys
Multiple clients can block for the same key. They are put into a queue, so the first to be served will be the one that started to wait earlier, in a first-blpopping first-served fashion.
blocking POP inside a MULTI/EXEC transaction
BLPOP and BRPOP can be used with pipelining (sending multiple commands and reading the replies in batch), but it does not make sense to use BLPOP or BRPOP inside a MULTI/EXEC block (a Redis transaction).
The behavior of BLPOP inside MULTI/EXEC when the list is empty is to return a multi-bulk nil reply, exactly what happens when the timeout is reached. If you like science fiction, think at it like if inside MULTI/EXEC the time will flow at infinite speed :)
Time complexity: O(1)
brpop
in interface ListBinaryCommands
timeout
- keys
- When a non-zero timeout is specified, and the BLPOP operation timed out, the return value is a nil multi bulk reply. Most connection values will return false or nil accordingly to the programming language used.
public KeyValue<byte[],byte[]> brpop(double timeout, byte[]... keys)
brpop
in interface ListBinaryCommands
public KeyValue<byte[],java.util.List<byte[]>> lmpop(ListDirection direction, byte[]... keys)
lmpop
in interface ListBinaryCommands
public KeyValue<byte[],java.util.List<byte[]>> lmpop(ListDirection direction, int count, byte[]... keys)
lmpop
in interface ListBinaryCommands
public KeyValue<byte[],java.util.List<byte[]>> blmpop(double timeout, ListDirection direction, byte[]... keys)
blmpop
in interface ListBinaryCommands
public KeyValue<byte[],java.util.List<byte[]>> blmpop(double timeout, ListDirection direction, int count, byte[]... keys)
blmpop
in interface ListBinaryCommands
public KeyValue<byte[],Tuple> bzpopmax(double timeout, byte[]... keys)
bzpopmax
in interface SortedSetBinaryCommands
public KeyValue<byte[],Tuple> bzpopmin(double timeout, byte[]... keys)
bzpopmin
in interface SortedSetBinaryCommands
public java.lang.String auth(java.lang.String password)
auth
in interface ServerCommands
password
- public java.lang.String auth(java.lang.String user, java.lang.String password)
auth
in interface ServerCommands
user
- password
- public long zcount(byte[] key, double min, double max)
zcount
in interface SortedSetBinaryCommands
public long zcount(byte[] key, byte[] min, byte[] max)
zcount
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zdiff(byte[]... keys)
zdiff
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zdiffWithScores(byte[]... keys)
zdiffWithScores
in interface SortedSetBinaryCommands
@Deprecated public long zdiffStore(byte[] dstkey, byte[]... keys)
zdiffStore
in interface SortedSetBinaryCommands
public long zdiffstore(byte[] dstkey, byte[]... keys)
zdiffstore
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrangeByScore(byte[] key, double min, double 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 is
possible to get only a range of the matching elements in an SQL-alike way. Note that if the
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 is 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))
zrangeByScore
in interface SortedSetBinaryCommands
key
- min
- max
- zrangeByScore(byte[], double, double)
,
zrangeByScore(byte[], double, double, int, int)
,
zrangeByScoreWithScores(byte[], double, double)
,
zrangeByScoreWithScores(byte[], double, double, int, int)
,
zcount(byte[], double, double)
public java.util.List<byte[]> zrangeByScore(byte[] key, byte[] min, byte[] max)
zrangeByScore
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrangeByScore(byte[] key, double min, double max, int offset, int count)
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 is
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 is 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))
zrangeByScore
in interface SortedSetBinaryCommands
key
- min
- max
- offset
- count
- zrangeByScore(byte[], double, double)
,
zrangeByScore(byte[], double, double, int, int)
,
zrangeByScoreWithScores(byte[], double, double)
,
zrangeByScoreWithScores(byte[], double, double, int, int)
,
zcount(byte[], double, double)
public java.util.List<byte[]> zrangeByScore(byte[] key, byte[] min, byte[] max, int offset, int count)
zrangeByScore
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrangeByScoreWithScores(byte[] key, double min, double 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 is
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 is 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))
zrangeByScoreWithScores
in interface SortedSetBinaryCommands
key
- min
- max
- zrangeByScore(byte[], double, double)
,
zrangeByScore(byte[], double, double, int, int)
,
zrangeByScoreWithScores(byte[], double, double)
,
zrangeByScoreWithScores(byte[], double, double, int, int)
,
zcount(byte[], double, double)
public java.util.List<Tuple> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max)
zrangeByScoreWithScores
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrangeByScoreWithScores(byte[] key, double min, double max, int offset, int count)
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 is
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 is 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))
zrangeByScoreWithScores
in interface SortedSetBinaryCommands
key
- min
- max
- offset
- count
- zrangeByScore(byte[], double, double)
,
zrangeByScore(byte[], double, double, int, int)
,
zrangeByScoreWithScores(byte[], double, double)
,
zrangeByScoreWithScores(byte[], double, double, int, int)
,
zcount(byte[], double, double)
public java.util.List<Tuple> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max, int offset, int count)
zrangeByScoreWithScores
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrevrangeByScore(byte[] key, double max, double min)
zrevrangeByScore
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrevrangeByScore(byte[] key, byte[] max, byte[] min)
zrevrangeByScore
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrevrangeByScore(byte[] key, double max, double min, int offset, int count)
zrevrangeByScore
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrevrangeByScore(byte[] key, byte[] max, byte[] min, int offset, int count)
zrevrangeByScore
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, double max, double min)
zrevrangeByScoreWithScores
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, double max, double min, int offset, int count)
zrevrangeByScoreWithScores
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min)
zrevrangeByScoreWithScores
in interface SortedSetBinaryCommands
public java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min, int offset, int count)
zrevrangeByScoreWithScores
in interface SortedSetBinaryCommands
public long zremrangeByRank(byte[] key, long start, long stop)
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
zremrangeByRank
in interface SortedSetBinaryCommands
key
- start
- stop
- public long zremrangeByScore(byte[] key, double min, double max)
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
in interface SortedSetBinaryCommands
key
- min
- max
- public long zremrangeByScore(byte[] key, byte[] min, byte[] max)
zremrangeByScore
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zunion(ZParams params, byte[]... keys)
zunion
in interface SortedSetBinaryCommands
params
- keys
- public java.util.List<Tuple> zunionWithScores(ZParams params, byte[]... keys)
zunionWithScores
in interface SortedSetBinaryCommands
params
- keys
- public long zunionstore(byte[] dstkey, byte[]... sets)
As the terms imply, the zinterstore(byte[], byte[][])
ZINTERSTORE} command
requires an element to be present in each of the given inputs to be inserted in the result. The
zunionstore(byte[], byte[][])
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 is 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
zunionstore
in interface SortedSetBinaryCommands
dstkey
- sets
- public long zunionstore(byte[] dstkey, ZParams params, byte[]... sets)
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 is 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
zunionstore
in interface SortedSetBinaryCommands
dstkey
- sets
- params
- public java.util.List<byte[]> zinter(ZParams params, byte[]... keys)
zinter
in interface SortedSetBinaryCommands
params
- keys
- public java.util.List<Tuple> zinterWithScores(ZParams params, byte[]... keys)
zinterWithScores
in interface SortedSetBinaryCommands
params
- keys
- public long zinterstore(byte[] dstkey, byte[]... sets)
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 is 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
zinterstore
in interface SortedSetBinaryCommands
dstkey
- sets
- public long zinterstore(byte[] dstkey, ZParams params, byte[]... sets)
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 is 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
zinterstore
in interface SortedSetBinaryCommands
dstkey
- sets
- params
- public long zintercard(byte[]... keys)
SortedSetBinaryCommands
ZINTER
, but
instead of returning the result set, it returns just the cardinality of the result.
Time complexity O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets
zintercard
in interface SortedSetBinaryCommands
keys
- group of setsSortedSetBinaryCommands#zinter(ZParams, byte[]...)
public long zintercard(long limit, byte[]... keys)
SortedSetBinaryCommands
ZINTER
, but
instead of returning the result set, it returns just the cardinality of the result.
Time complexity O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets
zintercard
in interface SortedSetBinaryCommands
limit
- If the intersection cardinality reaches limit partway through the computation,
the algorithm will exit and yield limit as the cardinalitykeys
- group of setsSortedSetBinaryCommands#zinter(ZParams, byte[]...)
public long zlexcount(byte[] key, byte[] min, byte[] max)
zlexcount
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrangeByLex(byte[] key, byte[] min, byte[] max)
zrangeByLex
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, int count)
zrangeByLex
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrevrangeByLex(byte[] key, byte[] max, byte[] min)
zrevrangeByLex
in interface SortedSetBinaryCommands
public java.util.List<byte[]> zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, int count)
zrevrangeByLex
in interface SortedSetBinaryCommands
public long zremrangeByLex(byte[] key, byte[] min, byte[] max)
zremrangeByLex
in interface SortedSetBinaryCommands
public KeyValue<byte[],java.util.List<Tuple>> zmpop(SortedSetOption option, byte[]... keys)
zmpop
in interface SortedSetBinaryCommands
public KeyValue<byte[],java.util.List<Tuple>> zmpop(SortedSetOption option, int count, byte[]... keys)
zmpop
in interface SortedSetBinaryCommands
public KeyValue<byte[],java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, byte[]... keys)
bzmpop
in interface SortedSetBinaryCommands
public KeyValue<byte[],java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, int count, byte[]... keys)
bzmpop
in interface SortedSetBinaryCommands
public java.lang.String save()
Save the whole dataset on disk (this means that all the databases are saved, as well as keys with an EXPIRE set (the expire is preserved). The server hangs while the saving is not completed, no connection is served in the meanwhile. An OK code is returned when the DB was fully stored in disk.
The background variant of this command is BGSAVE
that is able to perform
the saving in the background while the server continues serving other clients.
save
in interface ServerCommands
public java.lang.String bgsave()
Save the DB in background. The OK code is immediately returned. Redis forks, the parent continues to server the clients, the child saves the DB on disk then exit. A connection my be able to check if the operation succeeded using the LASTSAVE command.
bgsave
in interface ServerCommands
public java.lang.String bgsaveSchedule()
bgsaveSchedule
in interface ServerCommands
public java.lang.String bgrewriteaof()
BGREWRITEAOF rewrites the Append Only File in background when it gets too big. The Redis Append Only File is a Journal, so every operation modifying the dataset is logged in the Append Only File (and replayed at startup). This means that the Append Only File always grows. In order to rebuild its content the BGREWRITEAOF creates a new version of the append only file starting directly form the dataset in memory in order to guarantee the generation of the minimal number of commands needed to rebuild the database.
bgrewriteaof
in interface ServerCommands
public long lastsave()
Return the UNIX TIME of the last DB save executed with success. A connection may check if a
BGSAVE
command succeeded reading the LASTSAVE value, then issuing a
BGSAVE command and checking at regular intervals every N seconds if LASTSAVE changed.
lastsave
in interface ServerCommands
public void shutdown() throws JedisException
Stop all the clients, save the DB, then quit the server. This commands makes sure that the DB is switched off without the lost of any data.
shutdown
in interface ServerCommands
JedisException
- with the status code reply on error. On success nothing is thrown since
the server quits and the connection is closed.public void shutdown(ShutdownParams shutdownParams) throws JedisException
shutdown
in interface ServerCommands
shutdownParams
- set commands parametersJedisException
SaveMode
public java.lang.String shutdownAbort()
shutdownAbort
in interface ServerCommands
public java.lang.String info()
The info command returns different information and statistics about the server in an format that's simple to parse by computers and easy to read by humans.
Format of the returned String:
All the fields are in the form field:value
edis_version:0.07 connected_clients:1 connected_slaves:0 used_memory:3187 changes_since_last_save:0 last_save_time:1237655729 total_connections_received:1 total_commands_processed:1 uptime_in_seconds:25 uptime_in_days:0Notes
used_memory is returned in bytes, and is the total number of bytes allocated by the program using malloc.
uptime_in_days is redundant since the uptime in seconds contains already the full uptime information, this field is only mainly present for humans.
changes_since_last_save does not refer to the number of key changes, but to the number of operations that produced some kind of change in the dataset.
info
in interface ServerCommands
public java.lang.String info(java.lang.String section)
ServerCommands
info
in interface ServerCommands
section
- (all: Return all sections, default: Return only the default set of sections,
server: General information about the Redis server, clients: Client connections
section, memory: Memory consumption related information, persistence: RDB and AOF
related information, stats: General statistics, replication: Master/slave replication
information, cpu: CPU consumption statistics, commandstats: Redis command statistics,
cluster: Redis Cluster section, keyspace: Database related statistics)public void monitor(JedisMonitor jedisMonitor)
MONITOR is a debugging command that outputs the whole sequence of commands received by the Redis server. is very handy in order to understand what is happening into the database. This command is used directly via telnet.
jedisMonitor
- @Deprecated public java.lang.String slaveof(java.lang.String host, int port)
replicaof(java.lang.String, int)
.The SLAVEOF command can change the replication settings of a slave on the fly. If a Redis server is already acting as slave, the command SLAVEOF NO ONE will turn off the replication turning the Redis server into a MASTER. In the proper form SLAVEOF hostname port will make the server a slave of the specific server listening at the specified hostname and port.
If a server is already a slave of some master, SLAVEOF hostname port will stop the replication against the old server and start the synchronization against the new one discarding the old dataset.
The form SLAVEOF no one will stop replication turning the server into a MASTER but will not discard the replication. So if the old master stop working it is possible to turn the slave into a master and set the application to use the new master in read/write. Later when the other Redis server will be fixed it can be configured in order to work as slave.
slaveof
in interface ServerCommands
host
- port
- @Deprecated public java.lang.String slaveofNoOne()
replicaofNoOne()
.ServerCommands
slaveofNoOne
in interface ServerCommands
public java.lang.String replicaof(java.lang.String host, int port)
ServerCommands
replicaof
in interface ServerCommands
host
- listening at the specified hostnameport
- server listening at the specified portpublic java.lang.String replicaofNoOne()
ServerCommands
replicaofNoOne
in interface ServerCommands
public java.util.List<java.lang.Object> roleBinary()
ControlBinaryCommands
roleBinary
in interface ControlBinaryCommands
public java.util.Map<byte[],byte[]> configGet(byte[] pattern)
CONFIG GET returns the current configuration parameters. This sub command only accepts a single argument, that is glob style pattern. All the configuration parameters matching this parameter are reported as a list of key-value pairs.
Example:
$ redis-cli config get '*' 1. "dbfilename" 2. "dump.rdb" 3. "requirepass" 4. (nil) 5. "masterauth" 6. (nil) 7. "maxmemory" 8. "0\n" 9. "appendfsync" 10. "everysec" 11. "save" 12. "3600 1 300 100 60 10000" $ redis-cli config get 'm*' 1. "masterauth" 2. (nil) 3. "maxmemory" 4. "0\n"
configGet
in interface ConfigCommands
pattern
- public java.util.Map<byte[],byte[]> configGet(byte[]... patterns)
ConfigCommands
configGet
in interface ConfigCommands
patterns
- names of Redis server's configurationpublic java.lang.String configResetStat()
configResetStat
in interface ConfigCommands
public java.lang.String configRewrite()
The rewrite is performed in a very conservative way:
CONFIG REWRITE is also able to rewrite the configuration file from scratch if the original one no longer exists for some reason. However, if the server was started without a configuration file at all, the CONFIG REWRITE will just return an error.
configRewrite
in interface ConfigCommands
public java.lang.String configSet(byte[] parameter, byte[] value)
The list of configuration parameters supported by CONFIG SET can be obtained issuing a
CONFIG GET *
command.
The configuration set using CONFIG SET is immediately loaded by the Redis server that will start acting as specified starting from the next command.
Parameters value format
The value of the configuration parameter is the same as the one of the same parameter in the Redis configuration file, with the following exceptions:
configSet
in interface ConfigCommands
parameter
- value
- public java.lang.String configSet(byte[]... parameterValues)
configSet
in interface ConfigCommands
public java.lang.String configSetBinary(java.util.Map<byte[],byte[]> parameterValues)
configSetBinary
in interface ConfigCommands
public long strlen(byte[] key)
strlen
in interface StringBinaryCommands
public LCSMatchResult lcs(byte[] keyA, byte[] keyB, LCSParams params)
StringBinaryCommands
lcs
in interface StringBinaryCommands
public long lpushx(byte[] key, byte[]... strings)
lpushx
in interface ListBinaryCommands
public long persist(byte[] key)
expire
at turning the expire key into a normal key.
Time complexity: O(1)
persist
in interface KeyBinaryCommands
key
- public long rpushx(byte[] key, byte[]... strings)
rpushx
in interface ListBinaryCommands
public byte[] echo(byte[] string)
echo
in interface ServerCommands
public long linsert(byte[] key, ListPosition where, byte[] pivot, byte[] value)
linsert
in interface ListBinaryCommands
public byte[] brpoplpush(byte[] source, byte[] destination, int timeout)
brpoplpush
in interface ListBinaryCommands
public boolean setbit(byte[] key, long offset, boolean value)
setbit
in interface BitBinaryCommands
public boolean getbit(byte[] key, long offset)
getbit
in interface BitBinaryCommands
public long bitpos(byte[] key, boolean value)
bitpos
in interface BitBinaryCommands
public long bitpos(byte[] key, boolean value, BitPosParams params)
bitpos
in interface BitBinaryCommands
public long setrange(byte[] key, long offset, byte[] value)
setrange
in interface StringBinaryCommands
public byte[] getrange(byte[] key, long startOffset, long endOffset)
getrange
in interface StringBinaryCommands
public long publish(byte[] channel, byte[] message)
public void subscribe(BinaryJedisPubSub jedisPubSub, byte[]... channels)
public void psubscribe(BinaryJedisPubSub jedisPubSub, byte[]... patterns)
public java.lang.Object eval(byte[] script, java.util.List<byte[]> keys, java.util.List<byte[]> args)
eval
in interface ScriptingKeyBinaryCommands
script
- keys
- args
- public java.lang.Object evalReadonly(byte[] script, java.util.List<byte[]> keys, java.util.List<byte[]> args)
evalReadonly
in interface ScriptingKeyBinaryCommands
protected static byte[][] getParamsWithBinary(java.util.List<byte[]> keys, java.util.List<byte[]> args)
public java.lang.Object eval(byte[] script, int keyCount, byte[]... params)
eval
in interface ScriptingKeyBinaryCommands
public java.lang.Object eval(byte[] script)
eval
in interface ScriptingKeyBinaryCommands
public java.lang.Object evalsha(byte[] sha1)
evalsha
in interface ScriptingKeyBinaryCommands
public java.lang.Object evalsha(byte[] sha1, java.util.List<byte[]> keys, java.util.List<byte[]> args)
evalsha
in interface ScriptingKeyBinaryCommands
public java.lang.Object evalshaReadonly(byte[] sha1, java.util.List<byte[]> keys, java.util.List<byte[]> args)
evalshaReadonly
in interface ScriptingKeyBinaryCommands
public java.lang.Object evalsha(byte[] sha1, int keyCount, byte[]... params)
evalsha
in interface ScriptingKeyBinaryCommands
public java.lang.String scriptFlush()
scriptFlush
in interface ScriptingControlCommands
public java.lang.String scriptFlush(FlushMode flushMode)
scriptFlush
in interface ScriptingControlCommands
public java.lang.Boolean scriptExists(byte[] sha1)
scriptExists
in interface ScriptingControlCommands
public java.util.List<java.lang.Boolean> scriptExists(byte[]... sha1)
scriptExists
in interface ScriptingControlCommands
public byte[] scriptLoad(byte[] script)
scriptLoad
in interface ScriptingControlCommands
public java.lang.String scriptKill()
scriptKill
in interface ScriptingControlCommands
public java.lang.String slowlogReset()
slowlogReset
in interface SlowlogCommands
public long slowlogLen()
slowlogLen
in interface SlowlogCommands
public java.util.List<java.lang.Object> slowlogGetBinary()
slowlogGetBinary
in interface SlowlogCommands
public java.util.List<java.lang.Object> slowlogGetBinary(long entries)
slowlogGetBinary
in interface SlowlogCommands
public java.lang.Long objectRefcount(byte[] key)
ControlBinaryCommands
key
.objectRefcount
in interface ControlBinaryCommands
objectRefcount
in interface KeyBinaryCommands
key
- The key in Redis serverkey
public byte[] objectEncoding(byte[] key)
ControlBinaryCommands
key
.
See for details: OBJECT ENCODING key
objectEncoding
in interface ControlBinaryCommands
objectEncoding
in interface KeyBinaryCommands
key
- The key in Redis serverpublic java.lang.Long objectIdletime(byte[] key)
ControlBinaryCommands
key
.
The command is only available when the maxmemory-policy configuration directive
is not set to one of the LFU policies.objectIdletime
in interface ControlBinaryCommands
objectIdletime
in interface KeyBinaryCommands
key
- The key in Redis serverpublic java.util.List<byte[]> objectHelpBinary()
ControlBinaryCommands
objectHelpBinary
in interface ControlBinaryCommands
public java.lang.Long objectFreq(byte[] key)
ControlBinaryCommands
key
.
The command is only available when the maxmemory-policy configuration directive is set to one of the LFU policies.
objectFreq
in interface ControlBinaryCommands
objectFreq
in interface KeyBinaryCommands
key
- The key in Redis serverpublic long bitcount(byte[] key)
bitcount
in interface BitBinaryCommands
public long bitcount(byte[] key, long start, long end)
bitcount
in interface BitBinaryCommands
public long bitcount(byte[] key, long start, long end, BitCountOption option)
bitcount
in interface BitBinaryCommands
public long bitop(BitOP op, byte[] destKey, byte[]... srcKeys)
bitop
in interface BitBinaryCommands
public byte[] dump(byte[] key)
dump
in interface KeyBinaryCommands
public java.lang.String restore(byte[] key, long ttl, byte[] serializedValue)
restore
in interface KeyBinaryCommands
public java.lang.String restore(byte[] key, long ttl, byte[] serializedValue, RestoreParams params)
restore
in interface KeyBinaryCommands
public long pttl(byte[] key)
pttl
in interface KeyBinaryCommands
public java.lang.String psetex(byte[] key, long milliseconds, byte[] value)
setex(byte[], long, byte[])
with the sole difference
that the expire time is specified in milliseconds instead of seconds. Time complexity: O(1)psetex
in interface StringBinaryCommands
key
- milliseconds
- value
- public byte[] memoryDoctorBinary()
ControlBinaryCommands
memoryDoctorBinary
in interface ControlBinaryCommands
public java.lang.Long memoryUsage(byte[] key)
ControlBinaryCommands
See for details: MEMORY USAGE key
memoryUsage
in interface ControlBinaryCommands
memoryUsage
in interface KeyBinaryCommands
key
- The key in Redis serverpublic java.lang.Long memoryUsage(byte[] key, int samples)
ControlBinaryCommands
See for details: MEMORY USAGE key SAMPLES count
memoryUsage
in interface ControlBinaryCommands
memoryUsage
in interface KeyBinaryCommands
key
- The key in Redis serverpublic java.lang.String failover()
failover
in interface GenericControlCommands
public java.lang.String failover(FailoverParams failoverParams)
failover
in interface GenericControlCommands
public java.lang.String failoverAbort()
failoverAbort
in interface GenericControlCommands
public byte[] aclWhoAmIBinary()
AccessControlLogBinaryCommands
aclWhoAmIBinary
in interface AccessControlLogBinaryCommands
public byte[] aclGenPassBinary()
AccessControlLogBinaryCommands
aclGenPassBinary
in interface AccessControlLogBinaryCommands
public byte[] aclGenPassBinary(int bits)
AccessControlLogBinaryCommands
aclGenPassBinary
in interface AccessControlLogBinaryCommands
bits
- the number of output bitspublic java.util.List<byte[]> aclListBinary()
AccessControlLogBinaryCommands
aclListBinary
in interface AccessControlLogBinaryCommands
public java.util.List<byte[]> aclUsersBinary()
AccessControlLogBinaryCommands
aclUsersBinary
in interface AccessControlLogBinaryCommands
public AccessControlUser aclGetUser(byte[] name)
AccessControlLogBinaryCommands
aclGetUser
in interface AccessControlLogBinaryCommands
name
- usernamepublic java.lang.String aclSetUser(byte[] name)
AccessControlLogBinaryCommands
aclSetUser
in interface AccessControlLogBinaryCommands
name
- user who receives an aclpublic java.lang.String aclSetUser(byte[] name, byte[]... rules)
AccessControlLogBinaryCommands
aclSetUser
in interface AccessControlLogBinaryCommands
name
- user who receives an aclrules
- the acl rules for the specified userpublic long aclDelUser(byte[]... names)
AccessControlLogBinaryCommands
aclDelUser
in interface AccessControlLogBinaryCommands
names
- The username to deletepublic java.util.List<byte[]> aclCatBinary()
AccessControlLogBinaryCommands
aclCatBinary
in interface AccessControlLogBinaryCommands
public java.util.List<byte[]> aclCat(byte[] category)
AccessControlLogBinaryCommands
aclCat
in interface AccessControlLogBinaryCommands
category
- The category for which to list available ACLspublic java.util.List<byte[]> aclLogBinary()
AccessControlLogBinaryCommands
aclLogBinary
in interface AccessControlLogBinaryCommands
public java.util.List<byte[]> aclLogBinary(int limit)
AccessControlLogBinaryCommands
aclLogBinary
in interface AccessControlLogBinaryCommands
limit
- The number of results to returnpublic java.lang.String aclLogReset()
AccessControlLogCommands
aclLogReset
in interface AccessControlLogBinaryCommands
aclLogReset
in interface AccessControlLogCommands
public java.lang.String clientKill(byte[] ipPort)
ClientBinaryCommands
clientKill
in interface ClientBinaryCommands
ipPort
- The ip:port should match a line returned by the CLIENT LIST command (addr field).public java.lang.String clientKill(java.lang.String ip, int port)
ClientCommands
clientKill
in interface ClientBinaryCommands
clientKill
in interface ClientCommands
ip
- The ip should match a line returned by the CLIENT LIST command (addr field).port
- The port should match a line returned by the CLIENT LIST command (addr field).public long clientKill(ClientKillParams params)
ClientCommands
clientKill
in interface ClientBinaryCommands
clientKill
in interface ClientCommands
params
- Connection info will be closedpublic byte[] clientGetnameBinary()
ClientBinaryCommands
clientGetnameBinary
in interface ClientBinaryCommands
public byte[] clientListBinary()
ClientBinaryCommands
clientListBinary
in interface ClientBinaryCommands
public byte[] clientListBinary(ClientType type)
ClientBinaryCommands
clientListBinary
in interface ClientBinaryCommands
public byte[] clientListBinary(long... clientIds)
ClientBinaryCommands
clientListBinary
in interface ClientBinaryCommands
clientIds
- Unique 64-bit client IDspublic byte[] clientInfoBinary()
ClientBinaryCommands
clientInfoBinary
in interface ClientBinaryCommands
public java.lang.String clientSetInfo(ClientAttributeOption attr, byte[] value)
ClientBinaryCommands
clientSetInfo
in interface ClientBinaryCommands
attr
- the attr optionvalue
- the valuepublic java.lang.String clientSetname(byte[] name)
ClientBinaryCommands
clientSetname
in interface ClientBinaryCommands
name
- Current connection namepublic long clientId()
ClientCommands
clientId
in interface ClientBinaryCommands
clientId
in interface ClientCommands
public long clientUnblock(long clientId)
clientUnblock
in interface ClientBinaryCommands
clientUnblock
in interface ClientCommands
clientId
- public long clientUnblock(long clientId, UnblockType unblockType)
clientUnblock
in interface ClientBinaryCommands
clientUnblock
in interface ClientCommands
clientId
- unblockType
- public java.lang.String clientPause(long timeout)
ClientCommands
clientPause
in interface ClientBinaryCommands
clientPause
in interface ClientCommands
timeout
- WRITE|ALLpublic java.lang.String clientPause(long timeout, ClientPauseMode mode)
ClientCommands
clientPause
in interface ClientBinaryCommands
clientPause
in interface ClientCommands
timeout
- Command timeoutmode
- WRITE|ALLpublic java.lang.String clientUnpause()
ClientCommands
clientUnpause
in interface ClientBinaryCommands
clientUnpause
in interface ClientCommands
public java.lang.String clientNoEvictOn()
ClientCommands
clientNoEvictOn
in interface ClientBinaryCommands
clientNoEvictOn
in interface ClientCommands
public java.lang.String clientNoEvictOff()
ClientCommands
clientNoEvictOff
in interface ClientBinaryCommands
clientNoEvictOff
in interface ClientCommands
public java.lang.String clientNoTouchOn()
ClientCommands
clientNoTouchOn
in interface ClientCommands
public java.lang.String clientNoTouchOff()
ClientCommands
clientNoTouchOff
in interface ClientCommands
public java.util.List<java.lang.String> time()
public java.lang.String migrate(java.lang.String host, int port, byte[] key, int destinationDb, int timeout)
DatabaseCommands
MIGRATE
.migrate
in interface DatabaseCommands
DatabaseCommands.migrate(String, int, String, int, int)
public java.lang.String migrate(java.lang.String host, int port, int destinationDB, int timeout, MigrateParams params, byte[]... keys)
DatabaseCommands
MIGRATE
.migrate
in interface DatabaseCommands
DatabaseCommands.migrate(String, int, int, int, MigrateParams, String...)
public java.lang.String migrate(java.lang.String host, int port, byte[] key, int timeout)
migrate
in interface KeyBinaryCommands
public java.lang.String migrate(java.lang.String host, int port, int timeout, MigrateParams params, byte[]... keys)
migrate
in interface KeyBinaryCommands
public long waitReplicas(int replicas, long timeout)
ServerCommands
Blocks until all the previous write commands are successfully transferred and acknowledged by at least the specified number of replicas. If the timeout, specified in milliseconds, is reached, the command returns even if the specified number of replicas were not yet reached.
Since Java Object class has implemented wait
method, we cannot use it.
waitReplicas
in interface ServerCommands
replicas
- successfully transferred and acknowledged by at least the specified number of
replicastimeout
- the time to block in milliseconds, a timeout of 0 means to block foreverpublic KeyValue<java.lang.Long,java.lang.Long> waitAOF(long numLocal, long numReplicas, long timeout)
ServerCommands
waitAOF
in interface ServerCommands
numLocal
- Number of local instances that are required to acknowledge the sync (0 or 1),
cannot be non-zero if the local Redis does not have AOF enablednumReplicas
- Number of replicas that are required to acknowledge the synctimeout
- Timeout in millis of the operation - if 0 timeout is unlimited. If the timeout is reached,
the command returns even if the specified number of acknowledgments has not been met.public long pfadd(byte[] key, byte[]... elements)
pfadd
in interface HyperLogLogBinaryCommands
public long pfcount(byte[] key)
pfcount
in interface HyperLogLogBinaryCommands
public java.lang.String pfmerge(byte[] destkey, byte[]... sourcekeys)
pfmerge
in interface HyperLogLogBinaryCommands
public long pfcount(byte[]... keys)
pfcount
in interface HyperLogLogBinaryCommands
public ScanResult<byte[]> scan(byte[] cursor)
scan
in interface KeyBinaryCommands
public ScanResult<byte[]> scan(byte[] cursor, ScanParams params)
scan
in interface KeyBinaryCommands
public ScanResult<byte[]> scan(byte[] cursor, ScanParams params, byte[] type)
scan
in interface KeyBinaryCommands
public ScanResult<java.util.Map.Entry<byte[],byte[]>> hscan(byte[] key, byte[] cursor)
hscan
in interface HashBinaryCommands
public ScanResult<java.util.Map.Entry<byte[],byte[]>> hscan(byte[] key, byte[] cursor, ScanParams params)
hscan
in interface HashBinaryCommands
public ScanResult<byte[]> sscan(byte[] key, byte[] cursor)
sscan
in interface SetBinaryCommands
public ScanResult<byte[]> sscan(byte[] key, byte[] cursor, ScanParams params)
sscan
in interface SetBinaryCommands
public ScanResult<Tuple> zscan(byte[] key, byte[] cursor)
zscan
in interface SortedSetBinaryCommands
public ScanResult<Tuple> zscan(byte[] key, byte[] cursor, ScanParams params)
zscan
in interface SortedSetBinaryCommands
public long geoadd(byte[] key, double longitude, double latitude, byte[] member)
geoadd
in interface GeoBinaryCommands
public long geoadd(byte[] key, java.util.Map<byte[],GeoCoordinate> memberCoordinateMap)
geoadd
in interface GeoBinaryCommands
public long geoadd(byte[] key, GeoAddParams params, java.util.Map<byte[],GeoCoordinate> memberCoordinateMap)
geoadd
in interface GeoBinaryCommands
public java.lang.Double geodist(byte[] key, byte[] member1, byte[] member2)
geodist
in interface GeoBinaryCommands
public java.lang.Double geodist(byte[] key, byte[] member1, byte[] member2, GeoUnit unit)
geodist
in interface GeoBinaryCommands
public java.util.List<byte[]> geohash(byte[] key, byte[]... members)
geohash
in interface GeoBinaryCommands
public java.util.List<GeoCoordinate> geopos(byte[] key, byte[]... members)
geopos
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit)
georadius
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadiusReadonly(byte[] key, double longitude, double latitude, double radius, GeoUnit unit)
georadiusReadonly
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
georadius
in interface GeoBinaryCommands
public long georadiusStore(byte[] key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
georadiusStore
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadiusReadonly(byte[] key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusReadonly
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit)
georadiusByMember
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit)
georadiusByMemberReadonly
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusByMember
in interface GeoBinaryCommands
public long georadiusByMemberStore(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
georadiusByMemberStore
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> geosearch(byte[] key, byte[] member, double radius, GeoUnit unit)
geosearch
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> geosearch(byte[] key, GeoCoordinate coord, double radius, GeoUnit unit)
geosearch
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> geosearch(byte[] key, byte[] member, double width, double height, GeoUnit unit)
geosearch
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> geosearch(byte[] key, GeoCoordinate coord, double width, double height, GeoUnit unit)
geosearch
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> geosearch(byte[] key, GeoSearchParam params)
geosearch
in interface GeoBinaryCommands
public long geosearchStore(byte[] dest, byte[] src, byte[] member, double radius, GeoUnit unit)
geosearchStore
in interface GeoBinaryCommands
public long geosearchStore(byte[] dest, byte[] src, GeoCoordinate coord, double radius, GeoUnit unit)
geosearchStore
in interface GeoBinaryCommands
public long geosearchStore(byte[] dest, byte[] src, byte[] member, double width, double height, GeoUnit unit)
geosearchStore
in interface GeoBinaryCommands
public long geosearchStore(byte[] dest, byte[] src, GeoCoordinate coord, double width, double height, GeoUnit unit)
geosearchStore
in interface GeoBinaryCommands
public long geosearchStore(byte[] dest, byte[] src, GeoSearchParam params)
geosearchStore
in interface GeoBinaryCommands
public long geosearchStoreStoreDist(byte[] dest, byte[] src, GeoSearchParam params)
geosearchStoreStoreDist
in interface GeoBinaryCommands
public java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusByMemberReadonly
in interface GeoBinaryCommands
public java.util.List<java.lang.Long> bitfield(byte[] key, byte[]... arguments)
bitfield
in interface BitBinaryCommands
public java.util.List<java.lang.Long> bitfieldReadonly(byte[] key, byte[]... arguments)
bitfieldReadonly
in interface BitBinaryCommands
public long hstrlen(byte[] key, byte[] field)
hstrlen
in interface HashBinaryCommands
public java.util.List<java.lang.Object> xread(XReadParams xReadParams, java.util.Map.Entry<byte[],byte[]>... streams)
xread
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xreadGroup(byte[] groupName, byte[] consumer, XReadGroupParams xReadGroupParams, java.util.Map.Entry<byte[],byte[]>... streams)
xreadGroup
in interface StreamBinaryCommands
public byte[] xadd(byte[] key, XAddParams params, java.util.Map<byte[],byte[]> hash)
xadd
in interface StreamBinaryCommands
public long xlen(byte[] key)
xlen
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xrange(byte[] key, byte[] start, byte[] end)
xrange
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xrange(byte[] key, byte[] start, byte[] end, int count)
xrange
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xrevrange(byte[] key, byte[] end, byte[] start)
xrevrange
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xrevrange(byte[] key, byte[] end, byte[] start, int count)
xrevrange
in interface StreamBinaryCommands
public long xack(byte[] key, byte[] group, byte[]... ids)
xack
in interface StreamBinaryCommands
public java.lang.String xgroupCreate(byte[] key, byte[] consumer, byte[] id, boolean makeStream)
xgroupCreate
in interface StreamBinaryCommands
public java.lang.String xgroupSetID(byte[] key, byte[] consumer, byte[] id)
xgroupSetID
in interface StreamBinaryCommands
public long xgroupDestroy(byte[] key, byte[] consumer)
xgroupDestroy
in interface StreamBinaryCommands
public boolean xgroupCreateConsumer(byte[] key, byte[] groupName, byte[] consumerName)
xgroupCreateConsumer
in interface StreamBinaryCommands
public long xgroupDelConsumer(byte[] key, byte[] groupName, byte[] consumerName)
xgroupDelConsumer
in interface StreamBinaryCommands
public long xdel(byte[] key, byte[]... ids)
xdel
in interface StreamBinaryCommands
public long xtrim(byte[] key, long maxLen, boolean approximateLength)
xtrim
in interface StreamBinaryCommands
public long xtrim(byte[] key, XTrimParams params)
xtrim
in interface StreamBinaryCommands
public java.lang.Object xpending(byte[] key, byte[] groupName)
xpending
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xpending(byte[] key, byte[] groupName, XPendingParams params)
xpending
in interface StreamBinaryCommands
public java.util.List<byte[]> xclaim(byte[] key, byte[] group, byte[] consumerName, long minIdleTime, XClaimParams params, byte[]... ids)
xclaim
in interface StreamBinaryCommands
public java.util.List<byte[]> xclaimJustId(byte[] key, byte[] group, byte[] consumerName, long minIdleTime, XClaimParams params, byte[]... ids)
xclaimJustId
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xautoclaim(byte[] key, byte[] groupName, byte[] consumerName, long minIdleTime, byte[] start, XAutoClaimParams params)
xautoclaim
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xautoclaimJustId(byte[] key, byte[] groupName, byte[] consumerName, long minIdleTime, byte[] start, XAutoClaimParams params)
xautoclaimJustId
in interface StreamBinaryCommands
public java.lang.Object xinfoStream(byte[] key)
xinfoStream
in interface StreamBinaryCommands
public java.lang.Object xinfoStreamFull(byte[] key)
StreamBinaryCommands
xinfoStreamFull
in interface StreamBinaryCommands
key
- Stream namepublic java.lang.Object xinfoStreamFull(byte[] key, int count)
StreamBinaryCommands
xinfoStreamFull
in interface StreamBinaryCommands
key
- Stream namecount
- stream info countpublic java.util.List<java.lang.Object> xinfoGroups(byte[] key)
xinfoGroups
in interface StreamBinaryCommands
public java.util.List<java.lang.Object> xinfoConsumers(byte[] key, byte[] group)
xinfoConsumers
in interface StreamBinaryCommands
public java.lang.Object sendCommand(ProtocolCommand cmd, byte[]... args)
public java.lang.Object sendBlockingCommand(ProtocolCommand cmd, byte[]... args)
public java.lang.Object sendCommand(ProtocolCommand cmd)
public boolean copy(java.lang.String srcKey, java.lang.String dstKey, int db, boolean replace)
copy
in interface DatabaseCommands
srcKey
- the source key.dstKey
- the destination key.db
- replace
- public boolean copy(java.lang.String srcKey, java.lang.String dstKey, boolean replace)
copy
in interface KeyCommands
srcKey
- the source key.dstKey
- the destination key.replace
- true
if source was copied, false
otherwisepublic java.lang.String ping(java.lang.String message)
ping()
but returns argument message instead of PONG.ping
in interface ServerCommands
message
- public java.lang.String set(java.lang.String key, java.lang.String value)
Time complexity: O(1)
set
in interface StringCommands
key
- value
- public java.lang.String set(java.lang.String key, java.lang.String value, SetParams params)
set
in interface StringCommands
key
- value
- params
- NX|XX, NX -- Only set the key if it does not already exist. XX -- Only set the
key if it already exists. EX|PX, expire time units: EX = seconds; PX = millisecondsOK
if SET
was executed correctly, or null
if the SET
operation was not performed because the user specified the NX or XX option
but the condition was not met.public java.lang.String get(java.lang.String key)
Time complexity: O(1)
get
in interface StringCommands
key
- public java.lang.String setGet(java.lang.String key, java.lang.String value)
setGet
in interface StringCommands
public java.lang.String setGet(java.lang.String key, java.lang.String value, SetParams params)
setGet
in interface StringCommands
public java.lang.String getDel(java.lang.String key)
Time complexity: O(1)
getDel
in interface StringCommands
key
- public java.lang.String getEx(java.lang.String key, GetExParams params)
StringCommands
GET
,
but is a write command with additional options:
EX seconds -- Set the specified expire time, in seconds.
PX milliseconds -- Set the specified expire time, in milliseconds.
EXAT timestamp-seconds -- Set the specified Unix time at which the key will expire, in seconds.
PXAT timestamp-milliseconds -- Set the specified Unix time at which the key will expire, in milliseconds.
PERSIST -- Remove the time to live associated with the key.
Time complexity: O(1)
getEx
in interface StringCommands
params
- GetExParams
public long exists(java.lang.String... keys)
exists
in interface KeyCommands
keys
- keys
public boolean exists(java.lang.String key)
exists
in interface KeyCommands
key
- true
if the key exists, otherwise false
public long del(java.lang.String... keys)
del
in interface KeyCommands
keys
- public long del(java.lang.String key)
KeyCommands
Time complexity: O(1)
del
in interface KeyCommands
public long unlink(java.lang.String... keys)
Time complexity: O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.
unlink
in interface KeyCommands
keys
- KeyCommands.unlink(String)
public long unlink(java.lang.String key)
KeyCommands
DEL
: it removes the specified key.
Just like DEL a key is ignored if it does not exist. However, the command performs the actual
memory reclaiming in a different thread, so it is not blocking, while DEL is. This is where the
command name comes from: the command just unlinks the keys from the keyspace. The actual removal
will happen later asynchronously.
Time complexity: O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.
unlink
in interface KeyCommands
public java.lang.String type(java.lang.String key)
type
in interface KeyCommands
key
- public java.util.Set<java.lang.String> keys(java.lang.String pattern)
KeyCommands
Note that while the time complexity for this operation is O(n) the constant times are pretty low. For example Redis running on an entry level laptop can scan a 1 million keys database in 40 milliseconds. Still it's better to consider this one of the slow commands that may ruin the DB performance if not used with care.
In other words this command is intended only for debugging and special operations like creating a script to change the DB schema. Don't use it in your normal code. Use Redis Sets in order to group together a subset of objects.
Glob style patterns examples:
Use \ to escape special chars if you want to match them verbatim.
Time complexity: O(n) (with n being the number of keys in the DB, and assuming keys and pattern of limited length)
keys
in interface KeyCommands
public java.lang.String randomKey()
Time complexity: O(1)
randomKey
in interface KeyCommands
public java.lang.String rename(java.lang.String oldkey, java.lang.String newkey)
Time complexity: O(1)
rename
in interface KeyCommands
oldkey
- newkey
- public long renamenx(java.lang.String oldkey, java.lang.String newkey)
Time complexity: O(1)
renamenx
in interface KeyCommands
oldkey
- newkey
- public long expire(java.lang.String key, long seconds)
Volatile keys are stored on disk like the other keys, the timeout is persistent too like all the other aspects of the dataset. Saving a dataset containing expires and stopping the server does not stop the flow of time as Redis stores on disk the time when the key will no longer be available as Unix time, and not the remaining seconds.
Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
set. It is also possible to undo the expire at all turning the key into a normal key using the
PERSIST
command.
Time complexity: O(1)
expire
in interface KeyCommands
key
- seconds
- public long expire(java.lang.String key, long seconds, ExpiryOption expiryOption)
EXPIRE
but with optional expiry setting.expire
in interface KeyCommands
key
- seconds
- time to expireexpiryOption
- can be NX, XX, GT or LTexpire(String, long)
public long pexpire(java.lang.String key, long milliseconds)
KeyCommands
EXPIRE
but the time
to live of the key is specified in milliseconds instead of seconds.
Time complexity: O(1)
pexpire
in interface KeyCommands
milliseconds
- time to expirepublic long pexpire(java.lang.String key, long milliseconds, ExpiryOption expiryOption)
KeyCommands
EXPIRE
but with optional expiry setting.pexpire
in interface KeyCommands
milliseconds
- time to expireexpiryOption
- can be NX, XX, GT or LTKeyCommands.pexpire(String, long)
public long expireTime(java.lang.String key)
The command returns -1 if the key exists but has no associated expiration time, and -2 if the key does not exist.
Time complexity: O(1)
expireTime
in interface KeyCommands
key
- public long pexpireTime(java.lang.String key)
EXPIRETIME
but returns the absolute Unix expiration
timestamp in milliseconds instead of seconds.
Time complexity: O(1)
pexpireTime
in interface KeyCommands
key
- expireTime(String)
public long expireAt(java.lang.String key, long unixTime)
EXPIRE
but instead to get the
number of seconds representing the Time To Live of the key as a second argument (that is a
relative way of specifying the TTL), it takes an absolute one in the form of a UNIX timestamp
(Number of seconds elapsed since 1 Gen 1970).
EXPIREAT was introduced in order to implement the Append Only File persistence mode so that EXPIRE commands are automatically translated into EXPIREAT commands for the append only file. Of course EXPIREAT can also used by programmers that need a way to simply specify that a given key should expire at a given time in the future.
Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
set. It is also possible to undo the expire at all turning the key into a normal key using the
PERSIST
command.
Time complexity: O(1)
expireAt
in interface KeyCommands
key
- unixTime
- public long expireAt(java.lang.String key, long unixTime, ExpiryOption expiryOption)
EXPIREAT
but with ExpiryOption
.expireAt
in interface KeyCommands
key
- unixTime
- time to expireexpiryOption
- can be NX, XX, GT or LTexpireAt(String, long)
public long pexpireAt(java.lang.String key, long millisecondsTimestamp)
EXPIREAT
but
Unix time at which the key will expire is specified in milliseconds instead of seconds.
Time complexity: O(1)
pexpireAt
in interface KeyCommands
key
- millisecondsTimestamp
- time to expirepublic long pexpireAt(java.lang.String key, long millisecondsTimestamp, ExpiryOption expiryOption)
pexpireAt
in interface KeyCommands
key
- millisecondsTimestamp
- time to expireexpiryOption
- can be NX, XX, GT or LTpexpireAt(String, long)
public long ttl(java.lang.String key)
EXPIRE
set. This introspection capability allows a Redis
connection to check how many seconds a given key will continue to be part of the dataset.ttl
in interface KeyCommands
key
- public long touch(java.lang.String... keys)
touch
in interface KeyCommands
keys
- public long touch(java.lang.String key)
KeyCommands
Time complexity: O(N) where N is the number of keys that will be touched.
touch
in interface KeyCommands
public long move(java.lang.String key, int dbIndex)
move
in interface DatabaseCommands
key
- dbIndex
- public java.lang.String getSet(java.lang.String key, java.lang.String value)
Time complexity: O(1)
getSet
in interface StringCommands
key
- value
- public java.util.List<java.lang.String> mget(java.lang.String... keys)
Time complexity: O(1) for every key
mget
in interface StringCommands
keys
- public long setnx(java.lang.String key, java.lang.String value)
SET
with the only difference that if
the key already exists no operation is performed. SETNX actually means "SET if Not eXists".
Time complexity: O(1)
setnx
in interface StringCommands
key
- value
- public java.lang.String setex(java.lang.String key, long seconds, java.lang.String value)
SET
+ EXPIRE
. The
operation is atomic.
Time complexity: O(1)
setex
in interface StringCommands
key
- seconds
- value
- public java.lang.String mset(java.lang.String... keysvalues)
MSETNX
will not perform any operation at all even
if just a single key already exists.
Because of this semantic MSETNX can be used in order to set different keys representing different fields of an unique logic object in a way that ensures that either all the fields or none at all are set.
Both MSET and MSETNX are atomic operations. This means that for instance if the keys A and B are modified, another connection talking to Redis can either see the changes to both A and B at once, or no modification at all.
mset
in interface StringCommands
keysvalues
- msetnx(String...)
public long msetnx(java.lang.String... keysvalues)
MSET
will
replace old values with new values, while MSETNX will not perform any operation at all even if
just a single key already exists.
Because of this semantic MSETNX can be used in order to set different keys representing different fields of an unique logic object in a way that ensures that either all the fields or none at all are set.
Both MSET and MSETNX are atomic operations. This means that for instance if the keys A and B are modified, another connection talking to Redis can either see the changes to both A and B at once, or no modification at all.
msetnx
in interface StringCommands
keysvalues
- mset(String...)
public long decrBy(java.lang.String key, long decrement)
INCR
but instead to decrement by 1 the
decrement is integer.
INCR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
decrBy
in interface StringCommands
key
- decrement
- incr(String)
,
decr(String)
,
incrBy(String, long)
public long decr(java.lang.String key)
INCR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
decr
in interface StringCommands
key
- incr(String)
,
incrBy(String, long)
,
decrBy(String, long)
public long incrBy(java.lang.String key, long increment)
INCR
but instead to increment by 1 the
increment is integer.
INCR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
incrBy
in interface StringCommands
key
- increment
- incr(String)
,
decr(String)
,
decrBy(String, long)
public double incrByFloat(java.lang.String key, double increment)
INCRBYFLOAT commands are limited to double precision floating point values.
Note: this is actually a string operation, that is, in Redis there are not "double" types. Simply the string stored at the key is parsed as a base double precision floating point value, incremented, and then converted back as a string. There is no DECRYBYFLOAT but providing a negative value will work as expected.
Time complexity: O(1)
incrByFloat
in interface StringCommands
key
- increment
- public long incr(java.lang.String key)
INCR commands are limited to 64-bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
incr
in interface StringCommands
key
- incrBy(String, long)
,
decr(String)
,
decrBy(String, long)
public long append(java.lang.String key, java.lang.String value)
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.
append
in interface StringCommands
key
- value
- public java.lang.String substr(java.lang.String key, int start, int end)
The function handles out of range requests without raising an error, but just limiting the resulting range to the actual length of the string.
Time complexity: O(start+n) (with start being the start index and n the total length of the requested range). Note that the lookup part of this command is O(1) so for small strings this is actually an O(1) command.
substr
in interface StringCommands
key
- start
- end
- public long hset(java.lang.String key, java.lang.String field, java.lang.String value)
If key does not exist, a new key holding a hash is created.
Time complexity: O(1)
hset
in interface HashCommands
key
- field
- value
- public long hset(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> hash)
hset
in interface HashCommands
public java.lang.String hget(java.lang.String key, java.lang.String field)
If the field is not found or the key does not exist, a special 'nil' value is returned.
Time complexity: O(1)
hget
in interface HashCommands
key
- field
- public long hsetnx(java.lang.String key, java.lang.String field, java.lang.String value)
hsetnx
in interface HashCommands
key
- field
- value
- public java.lang.String hmset(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> hash)
If key does not exist, a new key holding a hash is created.
Time complexity: O(N) (with N being the number of fields)
hmset
in interface HashCommands
key
- hash
- public java.util.List<java.lang.String> hmget(java.lang.String key, java.lang.String... fields)
If some of the specified fields do not exist, nil values are returned. Non existing keys are considered like empty hashes.
Time complexity: O(N) (with N being the number of fields)
hmget
in interface HashCommands
key
- fields
- public long hincrBy(java.lang.String key, java.lang.String field, long value)
The range of values supported by HINCRBY is limited to 64-bit signed integers.
Time complexity: O(1)
hincrBy
in interface HashCommands
key
- field
- value
- public double hincrByFloat(java.lang.String key, java.lang.String field, double value)
The range of values supported by HINCRBYFLOAT is limited to double precision floating point values.
Time complexity: O(1)
hincrByFloat
in interface HashCommands
key
- field
- value
- public boolean hexists(java.lang.String key, java.lang.String field)
hexists
in interface HashCommands
key
- field
- true
if the hash stored at key contains the specified field, false
if the key is
not found or the field is not present.public long hdel(java.lang.String key, java.lang.String... fields)
Time complexity: O(1)
hdel
in interface HashCommands
key
- fields
- public long hlen(java.lang.String key)
Time complexity: O(1)
hlen
in interface HashCommands
key
- public java.util.Set<java.lang.String> hkeys(java.lang.String key)
Time complexity: O(N), where N is the total number of entries
hkeys
in interface HashCommands
key
- public java.util.List<java.lang.String> hvals(java.lang.String key)
Time complexity: O(N), where N is the total number of entries
hvals
in interface HashCommands
key
- public java.util.Map<java.lang.String,java.lang.String> hgetAll(java.lang.String key)
Time complexity: O(N), where N is the total number of entries
hgetAll
in interface HashCommands
key
- public java.lang.String hrandfield(java.lang.String key)
Time complexity: O(N), where N is the number of fields returned
hrandfield
in interface HashCommands
key
- public java.util.List<java.lang.String> hrandfield(java.lang.String key, long count)
Time complexity: O(N), where N is the number of fields returned
hrandfield
in interface HashCommands
key
- count
- public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> hrandfieldWithValues(java.lang.String key, long count)
Time complexity: O(N), where N is the number of fields returned
hrandfieldWithValues
in interface HashCommands
key
- count
- public long rpush(java.lang.String key, java.lang.String... strings)
Time complexity: O(1)
rpush
in interface ListCommands
key
- strings
- public long lpush(java.lang.String key, java.lang.String... strings)
Time complexity: O(1)
lpush
in interface ListCommands
key
- strings
- public long llen(java.lang.String key)
Time complexity: O(1)
llen
in interface ListCommands
key
- public java.util.List<java.lang.String> lrange(java.lang.String key, long start, long stop)
For example LRANGE foobar 0 2 will return the first three elements of the list.
start and end can also be negative numbers indicating offsets from the end of the list. For example -1 is the last element of the list, -2 the penultimate element and so on.
Consistency with range functions in various programming languages
Note that if you have a list of numbers from 0 to 100, LRANGE 0 10 will return 11 elements, that is, rightmost item is included. This may or may not be consistent with behavior of range-related functions in your programming language of choice (think Ruby's Range.new, Array#slice or Python's range() function).
LRANGE behavior is consistent with one of Tcl.
Out-of-range indexes
Indexes out of range will not produce an error: if start is over the end of the list, or start > end, an empty list is returned. If end is over the end of the list Redis will threat it just like the last element of the list.
Time complexity: O(start+n) (with n being the length of the range and start being the start offset)
lrange
in interface ListCommands
key
- start
- stop
- public java.lang.String ltrim(java.lang.String key, long start, long stop)
For example LTRIM foobar 0 2 will modify the list stored at foobar key so that only the first three elements of the list will remain.
start and end can also be negative numbers indicating offsets from the end of the list. For example -1 is the last element of the list, -2 the penultimate element and so on.
Indexes out of range will not produce an error: if start is over the end of the list, or start > end, an empty list is left as value. If end over the end of the list Redis will threat it just like the last element of the list.
Hint: the obvious use of LTRIM is together with LPUSH/RPUSH. For example:
lpush("mylist", "someelement"); ltrim("mylist", 0, 99); *
The above two commands will push elements in the list taking care that the list will not grow without limits. This is very useful when using Redis to store logs for example. It is important to note that when used in this way LTRIM is an O(1) operation because in the average case just one element is removed from the tail of the list.
Time complexity: O(n) (with n being len of list - len of range)
ltrim
in interface ListCommands
key
- start
- stop
- public java.lang.String lindex(java.lang.String key, long index)
If the value stored at key is not of list type an error is returned. If the index is out of range a 'nil' reply is returned.
Note that even if the average time complexity is O(n) asking for the first or the last element of the list is O(1).
Time complexity: O(n) (with n being the length of the list)
lindex
in interface ListCommands
key
- index
- public java.lang.String lset(java.lang.String key, long index, java.lang.String value)
Out of range indexes will generate an error.
Similarly to other list commands accepting indexes, the index can be negative to access elements starting from the end of the list. So -1 is the last element, -2 is the penultimate, and so forth.
Time complexity:
O(N) (with N being the length of the list), setting the first or last elements of the list is O(1).
lset
in interface ListCommands
key
- index
- value
- lindex(String, long)
public long lrem(java.lang.String key, long count, java.lang.String value)
Time complexity: O(N) (with N being the length of the list)
lrem
in interface ListCommands
key
- count
- value
- public java.lang.String lpop(java.lang.String key)
If the key does not exist or the list is already empty the special value 'nil' is returned.
lpop
in interface ListCommands
key
- rpop(String)
public java.util.List<java.lang.String> lpop(java.lang.String key, int count)
ListCommands
lpop
in interface ListCommands
public java.lang.Long lpos(java.lang.String key, java.lang.String element)
ListCommands
Time complexity: O(N) where N is the number of elements in the list
lpos
in interface ListCommands
public java.lang.Long lpos(java.lang.String key, java.lang.String element, LPosParams params)
ListCommands
Maxlen option compares the element provided only with a given maximum number of list items. A value of 1000 will make sure that the command performs only 1000 comparisons. The comparison is made for the first part or the last part depending on the fact we use a positive or negative rank. Following is how we could use the Maxlen option lpos("foo", "b", LPosParams.lPosParams().rank(1).maxlen(2)).
lpos
in interface ListCommands
params
- LPosParams
public java.util.List<java.lang.Long> lpos(java.lang.String key, java.lang.String element, LPosParams params, long count)
ListCommands
Time complexity: O(N) where N is the number of elements in the list
lpos
in interface ListCommands
params
- LPosParams
public java.lang.String rpop(java.lang.String key)
If the key does not exist or the list is already empty the special value 'nil' is returned.
rpop
in interface ListCommands
key
- lpop(String)
public java.util.List<java.lang.String> rpop(java.lang.String key, int count)
ListCommands
rpop
in interface ListCommands
count
- return up to count elementspublic java.lang.String rpoplpush(java.lang.String srckey, java.lang.String dstkey)
If the key does not exist or the list is already empty the special value 'nil' is returned. If the srckey and dstkey are the same the operation is equivalent to removing the last element from the list and pushing it as first element of the list, so it's a "list rotation" command.
Time complexity: O(1)
rpoplpush
in interface ListCommands
srckey
- dstkey
- public long sadd(java.lang.String key, java.lang.String... members)
Time complexity O(1)
sadd
in interface SetCommands
key
- members
- public java.util.Set<java.lang.String> smembers(java.lang.String key)
SINTER
.
Time complexity O(N)
smembers
in interface SetCommands
key
- public long srem(java.lang.String key, java.lang.String... members)
Time complexity O(1)
srem
in interface SetCommands
key
- members
- public java.lang.String spop(java.lang.String key)
The srandmember(String)
command does a similar work but the returned element is
not removed from the Set.
Time complexity O(1)
spop
in interface SetCommands
key
- public java.util.Set<java.lang.String> spop(java.lang.String key, long count)
SetCommands
SetCommands.spop(String)
pops a single member from the set.
In this command, the reply will consist of up to count members, depending on the set's cardinality.
The SetCommands.srandmember(String)
command does a similar work but the returned element is
not removed from the Set.
Time complexity O(N), where N is the value of the passed count
spop
in interface SetCommands
public long smove(java.lang.String srckey, java.lang.String dstkey, java.lang.String member)
If the source set does not exist or does not contain the specified element no operation is performed and zero is returned, otherwise the element is removed from the source set and added to the destination set. On success one is returned, even if the element was already present in the destination set.
An error is raised if the source or destination keys contain a non Set value.
Time complexity O(1)
smove
in interface SetCommands
srckey
- dstkey
- member
- public long scard(java.lang.String key)
scard
in interface SetCommands
key
- public boolean sismember(java.lang.String key, java.lang.String member)
Time complexity O(1)
sismember
in interface SetCommands
key
- member
- true
if the element is a member of the set, false
otherwisepublic java.util.List<java.lang.Boolean> smismember(java.lang.String key, java.lang.String... members)
Time complexity O(N) where N is the number of elements being checked for membership
smismember
in interface SetCommands
key
- members
- public java.util.Set<java.lang.String> sinter(java.lang.String... keys)
LRANGE
the result is sent to
the connection as a multi-bulk reply (see the protocol specification for more information). If
just a single key is specified, then this command produces the same result as
SMEMBERS
. Actually SMEMBERS is just syntax sugar for SINTER.
Non existing keys are considered like empty sets, so if one of the keys is missing an empty set is returned (since the intersection with an empty set always is an empty set).
Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the number of sets
sinter
in interface SetCommands
keys
- public long sinterstore(java.lang.String dstkey, java.lang.String... keys)
SINTER
but instead of being
returned the resulting set is stored as dstkey.
Time complexity O(N*M) worst case where N is the cardinality of the smallest set and M the number of sets
sinterstore
in interface SetCommands
dstkey
- keys
- public long sintercard(java.lang.String... keys)
SINTER
but instead of returning
the result set, it returns just the cardinality of the result.
Time complexity O(N*M) worst case where N is the cardinality of the smallest
sintercard
in interface SetCommands
keys
- public long sintercard(int limit, java.lang.String... keys)
SINTER
but instead of returning
the result set, it returns just the cardinality of the result.
Time complexity O(N*M) worst case where N is the cardinality of the smallest
sintercard
in interface SetCommands
limit
- If the intersection cardinality reaches limit partway through the computation,
the algorithm will exit and yield limit as the cardinality.keys
- public java.util.Set<java.lang.String> sunion(java.lang.String... keys)
LRANGE
the result is sent to the
connection as a multi-bulk reply (see the protocol specification for more information). If just
a single key is specified, then this command produces the same result as
SMEMBERS
.
Non existing keys are considered like empty sets.
Time complexity O(N) where N is the total number of elements in all the provided sets
sunion
in interface SetCommands
keys
- public long sunionstore(java.lang.String dstkey, java.lang.String... keys)
SUNION
but instead of being
returned the resulting set is stored as dstkey. Any existing value in dstkey will be
over-written.
Time complexity O(N) where N is the total number of elements in all the provided sets
sunionstore
in interface SetCommands
dstkey
- keys
- public java.util.Set<java.lang.String> sdiff(java.lang.String... keys)
Example:
key1 = [x, a, b, c] key2 = [c] key3 = [a, d] SDIFF key1,key2,key3 => [x, b]Non existing keys are considered like empty sets.
Time complexity:
O(N) with N being the total number of elements of all the sets
sdiff
in interface SetCommands
keys
- public long sdiffstore(java.lang.String dstkey, java.lang.String... keys)
SDIFF
but instead of being
returned the resulting set is stored in dstkey.sdiffstore
in interface SetCommands
dstkey
- keys
- public java.lang.String srandmember(java.lang.String key)
The SPOP command does a similar work but the returned element is popped (removed) from the Set.
Time complexity O(1)
srandmember
in interface SetCommands
key
- public java.util.List<java.lang.String> srandmember(java.lang.String key, int count)
The SPOP command does a similar work but the returned elements is popped (removed) from the Set.
Time complexity O(1)
srandmember
in interface SetCommands
key
- count
- if positive, return an array of distinct elements.
If negative the behavior changes and the command is allowed to
return the same element multiple timespublic long zadd(java.lang.String key, double score, java.lang.String member)
The score value can be the string representation of a double precision floating point number.
Time complexity O(log(N)) with N being the number of elements in the sorted set
zadd
in interface SortedSetCommands
key
- score
- member
- public long zadd(java.lang.String key, double score, java.lang.String member, ZAddParams params)
SortedSetCommands
ZADD
but can be used with optional params.zadd
in interface SortedSetCommands
params
- ZAddParams
SortedSetCommands.zadd(String, double, String)
public long zadd(java.lang.String key, java.util.Map<java.lang.String,java.lang.Double> scoreMembers)
SortedSetCommands
ZADD
but for multiple members.zadd
in interface SortedSetCommands
SortedSetCommands.zadd(String, double, String)
public long zadd(java.lang.String key, java.util.Map<java.lang.String,java.lang.Double> scoreMembers, ZAddParams params)
SortedSetCommands
ZADD
but can be used with optional params,
and fits for multiple members.zadd
in interface SortedSetCommands
params
- ZAddParams
SortedSetCommands.zadd(String, double, String)
public java.lang.Double zaddIncr(java.lang.String key, double score, java.lang.String member, ZAddParams params)
SortedSetCommands
The score value should be the string representation of a numeric value, and accepts double precision floating point numbers. It is possible to provide a negative value to decrement the score.
Time complexity O(log(N)) with N being the number of elements in the sorted set
zaddIncr
in interface SortedSetCommands
params
- ZAddParams
public java.util.List<java.lang.String> zdiff(java.lang.String... keys)
SortedSetCommands
Time complexity O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set.
zdiff
in interface SortedSetCommands
keys
- group of setspublic java.util.List<Tuple> zdiffWithScores(java.lang.String... keys)
SortedSetCommands
zdiffWithScores
in interface SortedSetCommands
keys
- group of sets@Deprecated public long zdiffStore(java.lang.String dstkey, java.lang.String... keys)
SortedSetCommands
zdiffStore
in interface SortedSetCommands
keys
- group of setspublic long zdiffstore(java.lang.String dstkey, java.lang.String... keys)
SortedSetCommands
zdiffstore
in interface SortedSetCommands
keys
- group of setspublic java.util.List<java.lang.String> zrange(java.lang.String key, long start, long stop)
SortedSetCommands
Time complexity O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
zrange
in interface SortedSetCommands
key
- the key to querystart
- the minimum indexstop
- the maximum indexpublic long zrem(java.lang.String key, java.lang.String... members)
Time complexity O(log(N)) with N being the number of elements in the sorted set
zrem
in interface SortedSetCommands
key
- members
- public double zincrby(java.lang.String key, double increment, java.lang.String member)
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
zincrby
in interface SortedSetCommands
key
- increment
- member
- public java.lang.Double zincrby(java.lang.String key, double increment, java.lang.String member, ZIncrByParams params)
SortedSetCommands
ZINCRBY
but can be used with optionals params.zincrby
in interface SortedSetCommands
params
- ZIncrByParams
SortedSetCommands.zincrby(String, double, String)
public java.lang.Long zrank(java.lang.String key, java.lang.String member)
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))
zrank
in interface SortedSetCommands
key
- member
- zrevrank(String, String)
public java.lang.Long zrevrank(java.lang.String key, java.lang.String member)
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))
zrevrank
in interface SortedSetCommands
key
- member
- zrank(String, String)
public KeyValue<java.lang.Long,java.lang.Double> zrankWithScore(java.lang.String key, java.lang.String member)
zrankWithScore
in interface SortedSetCommands
key
- the keymember
- the memberpublic KeyValue<java.lang.Long,java.lang.Double> zrevrankWithScore(java.lang.String key, java.lang.String member)
zrevrankWithScore
in interface SortedSetCommands
key
- the keymember
- the memberpublic java.util.List<java.lang.String> zrevrange(java.lang.String key, long start, long stop)
SortedSetCommands
Time complexity O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
zrevrange
in interface SortedSetCommands
key
- the key to querystart
- the minimum indexstop
- the maximum indexpublic java.util.List<Tuple> zrangeWithScores(java.lang.String key, long start, long stop)
SortedSetCommands
zrangeWithScores
in interface SortedSetCommands
key
- the key to querystart
- the minimum indexstop
- the maximum indexpublic java.util.List<Tuple> zrevrangeWithScores(java.lang.String key, long start, long stop)
SortedSetCommands
ZREVRANGE
but the reply will
include the scores of the returned elements.zrevrangeWithScores
in interface SortedSetCommands
key
- the key to querystart
- the minimum indexstop
- the maximum indexSortedSetCommands.zrevrange(String, long, long)
public java.util.List<java.lang.String> zrange(java.lang.String key, ZRangeParams zRangeParams)
SortedSetCommands
ZRANGE
but can be used with additional params.zrange
in interface SortedSetCommands
key
- the key to queryzRangeParams
- ZRangeParams
SortedSetCommands.zrange(String, long, long)
public java.util.List<Tuple> zrangeWithScores(java.lang.String key, ZRangeParams zRangeParams)
SortedSetCommands
ZRANGE
but can be used with additional params.zrangeWithScores
in interface SortedSetCommands
key
- the key to queryzRangeParams
- ZRangeParams
SortedSetCommands.zrangeWithScores(String, long, long)
public long zrangestore(java.lang.String dest, java.lang.String src, ZRangeParams zRangeParams)
SortedSetCommands
ZRANGE
but stores the result in dest
.zrangestore
in interface SortedSetCommands
dest
- the storing keysrc
- the key to queryzRangeParams
- ZRangeParams
SortedSetCommands.zrange(String, ZRangeParams)
public java.lang.String zrandmember(java.lang.String key)
SortedSetCommands
Time complexity O(N) where N is the number of elements returned
zrandmember
in interface SortedSetCommands
public java.util.List<java.lang.String> zrandmember(java.lang.String key, long count)
SortedSetCommands
ZCARD
), whichever is lower.
Time complexity O(N) where N is the number of elements returned
zrandmember
in interface SortedSetCommands
count
- choose up to count elementspublic java.util.List<Tuple> zrandmemberWithScores(java.lang.String key, long count)
SortedSetCommands
ZRANDMEMBER
but the replay will
include the scores with the result.zrandmemberWithScores
in interface SortedSetCommands
count
- choose up to count elementsSortedSetCommands.zrandmember(String, long)
public long zcard(java.lang.String key)
Time complexity O(1)
zcard
in interface SortedSetCommands
key
- public java.lang.Double zscore(java.lang.String key, java.lang.String member)
Time complexity: O(1)
zscore
in interface SortedSetCommands
key
- member
- public java.util.List<java.lang.Double> zmscore(java.lang.String key, java.lang.String... members)
Time complexity: O(N) where N is the number of members being requested.
zmscore
in interface SortedSetCommands
key
- members
- public Tuple zpopmax(java.lang.String key)
SortedSetCommands
Time complexity O(log(N)) with N being the number of elements in the sorted set
zpopmax
in interface SortedSetCommands
public java.util.List<Tuple> zpopmax(java.lang.String key, int count)
SortedSetCommands
Time complexity O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.
zpopmax
in interface SortedSetCommands
count
- the number of elements to poppublic Tuple zpopmin(java.lang.String key)
SortedSetCommands
Time complexity O(log(N)) with N being the number of elements in the sorted set
zpopmin
in interface SortedSetCommands
public java.util.List<Tuple> zpopmin(java.lang.String key, int count)
SortedSetCommands
Time complexity O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.
zpopmin
in interface SortedSetCommands
count
- the number of elements to poppublic java.lang.String watch(java.lang.String... keys)
public java.util.List<java.lang.String> sort(java.lang.String key)
Sort the elements contained in the List, Set, or Sorted Set value at key. By default sorting is numeric with elements being compared as double precision floating point numbers. This is the simplest form of SORT.
sort
in interface KeyCommands
key
- sort(String, String)
,
sort(String, SortingParams)
,
sort(String, SortingParams, String)
public java.util.List<java.lang.String> sort(java.lang.String key, SortingParams sortingParams)
examples:
Given are the following sets and key/values:
x = [1, 2, 3] y = [a, b, c] k1 = z k2 = y k3 = x w1 = 9 w2 = 8 w3 = 7Sort Order:
sort(x) or sort(x, sp.asc()) -> [1, 2, 3] sort(x, sp.desc()) -> [3, 2, 1] sort(y) -> [c, a, b] sort(y, sp.alpha()) -> [a, b, c] sort(y, sp.alpha().desc()) -> [c, a, b]Limit (e.g. for Pagination):
sort(x, sp.limit(0, 2)) -> [1, 2] sort(y, sp.alpha().desc().limit(1, 2)) -> [b, a]Sorting by external keys:
sort(x, sb.by(w*)) -> [3, 2, 1] sort(x, sb.by(w*).desc()) -> [1, 2, 3]Getting external keys:
sort(x, sp.by(w*).get(k*)) -> [x, y, z] sort(x, sp.by(w*).get(#).get(k*)) -> [3, x, 2, y, 1, z]
sort
in interface KeyCommands
key
- sortingParams
- sort(String)
,
sort(String, SortingParams, String)
public long sort(java.lang.String key, SortingParams sortingParams, java.lang.String dstkey)
sort
in interface KeyCommands
key
- sortingParams
- dstkey
- sort(String, SortingParams)
,
sort(String)
,
sort(String, String)
public java.util.List<java.lang.String> sortReadonly(java.lang.String key, SortingParams sortingParams)
KeyCommands
SORT
command.
It is exactly like the original SORT but refuses the STORE option and can safely be used in read-only replicas.sortReadonly
in interface KeyCommands
key
- the key to sortsortingParams
- SortingParams
public long sort(java.lang.String key, java.lang.String dstkey)
Sort the elements contained in the List, Set, or Sorted Set value at key and store the result at dstkey. By default sorting is numeric with elements being compared as double precision floating point numbers. This is the simplest form of SORT.
sort
in interface KeyCommands
key
- dstkey
- sort(String)
,
sort(String, SortingParams)
,
sort(String, SortingParams, String)
public java.lang.String lmove(java.lang.String srcKey, java.lang.String dstKey, ListDirection from, ListDirection to)
ListCommands
lmove
in interface ListCommands
from
- can be LEFT or RIGHTto
- can be LEFT or RIGHTpublic java.lang.String blmove(java.lang.String srcKey, java.lang.String dstKey, ListDirection from, ListDirection to, double timeout)
ListCommands
blmove
in interface ListCommands
from
- can be LEFT or RIGHTto
- can be LEFT or RIGHTtimeout
- the timeout argument is interpreted as a double value specifying the maximum number of
seconds to block. A timeout of zero can be used to block indefinitely.public java.util.List<java.lang.String> blpop(int timeout, java.lang.String... keys)
The following is a description of the exact semantic. We describe BLPOP but the two commands are identical, the only difference is that BLPOP pops the element from the left (head) of the list, and BRPOP pops from the right (tail).
Non blocking behavior
When BLPOP is called, if at least one of the specified keys contain a non empty list, an element is popped from the head of the list and returned to the caller together with the name of the key (BLPOP returns a two elements array, the first element is the key, the second the popped value).
Keys are scanned from left to right, so for instance if you issue BLPOP list1 list2 list3 0 against a dataset where list1 does not exist but list2 and list3 contain non empty lists, BLPOP guarantees to return an element from the list stored at list2 (since it is the first non empty list starting from the left).
Blocking behavior
If none of the specified keys exist or contain non empty lists, BLPOP blocks until some other connection performs a LPUSH or an RPUSH operation against one of the lists.
Once new data is present on one of the lists, the connection finally returns with the name of the key unblocking it and the popped value.
When blocking, if a non-zero timeout is specified, the connection will unblock returning a nil special value if the specified amount of seconds passed without a push operation against at least one of the specified keys.
The timeout argument is interpreted as an integer value. A timeout of zero means instead to block forever.
Multiple clients blocking for the same keys
Multiple clients can block for the same key. They are put into a queue, so the first to be served will be the one that started to wait earlier, in a first-blpopping first-served fashion.
blocking POP inside a MULTI/EXEC transaction
BLPOP and BRPOP can be used with pipelining (sending multiple commands and reading the replies in batch), but it does not make sense to use BLPOP or BRPOP inside a MULTI/EXEC block (a Redis transaction).
The behavior of BLPOP inside MULTI/EXEC when the list is empty is to return a multi-bulk nil reply, exactly what happens when the timeout is reached. If you like science fiction, think at it like if inside MULTI/EXEC the time will flow at infinite speed :)
Time complexity: O(1)
blpop
in interface ListCommands
timeout
- keys
- When a non-zero timeout is specified, and the BLPOP operation timed out, the return value is a nil multi bulk reply. Most connection values will return false or nil accordingly to the programming language used.
brpop(int, String...)
public KeyValue<java.lang.String,java.lang.String> blpop(double timeout, java.lang.String... keys)
ListCommands
ListCommands.lpop(String)
LPOP} 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.blpop
in interface ListCommands
timeout
- the timeout argument is interpreted as a double value specifying the maximum number of
seconds to block. A timeout of zero can be used to block indefinitely.public java.util.List<java.lang.String> brpop(int timeout, java.lang.String... keys)
The following is a description of the exact semantic. We describe BLPOP but the two commands are identical, the only difference is that BLPOP pops the element from the left (head) of the list, and BRPOP pops from the right (tail).
Non blocking behavior
When BLPOP is called, if at least one of the specified keys contain a non empty list, an element is popped from the head of the list and returned to the caller together with the name of the key (BLPOP returns a two elements array, the first element is the key, the second the popped value).
Keys are scanned from left to right, so for instance if you issue BLPOP list1 list2 list3 0 against a dataset where list1 does not exist but list2 and list3 contain non empty lists, BLPOP guarantees to return an element from the list stored at list2 (since it is the first non empty list starting from the left).
Blocking behavior
If none of the specified keys exist or contain non empty lists, BLPOP blocks until some other connection performs a LPUSH or an RPUSH operation against one of the lists.
Once new data is present on one of the lists, the connection finally returns with the name of the key unblocking it and the popped value.
When blocking, if a non-zero timeout is specified, the connection will unblock returning a nil special value if the specified amount of seconds passed without a push operation against at least one of the specified keys.
The timeout argument is interpreted as an integer value. A timeout of zero means instead to block forever.
Multiple clients blocking for the same keys
Multiple clients can block for the same key. They are put into a queue, so the first to be served will be the one that started to wait earlier, in a first-blpopping first-served fashion.
blocking POP inside a MULTI/EXEC transaction
BLPOP and BRPOP can be used with pipelining (sending multiple commands and reading the replies in batch), but it does not make sense to use BLPOP or BRPOP inside a MULTI/EXEC block (a Redis transaction).
The behavior of BLPOP inside MULTI/EXEC when the list is empty is to return a multi-bulk nil reply, exactly what happens when the timeout is reached. If you like science fiction, think at it like if inside MULTI/EXEC the time will flow at infinite speed :)
Time complexity: O(1)
brpop
in interface ListCommands
timeout
- keys
- When a non-zero timeout is specified, and the BLPOP operation timed out, the return value is a nil multi bulk reply. Most connection values will return false or nil accordingly to the programming language used.
blpop(int, String...)
public KeyValue<java.lang.String,java.lang.String> brpop(double timeout, java.lang.String... keys)
ListCommands
ListCommands.rpop(String)
RPOP} 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.brpop
in interface ListCommands
timeout
- the timeout argument is interpreted as a double value specifying the maximum number of
seconds to block. A timeout of zero can be used to block indefinitely.public KeyValue<java.lang.String,java.util.List<java.lang.String>> lmpop(ListDirection direction, java.lang.String... keys)
lmpop
in interface ListCommands
public KeyValue<java.lang.String,java.util.List<java.lang.String>> lmpop(ListDirection direction, int count, java.lang.String... keys)
lmpop
in interface ListCommands
public KeyValue<java.lang.String,java.util.List<java.lang.String>> blmpop(double timeout, ListDirection direction, java.lang.String... keys)
blmpop
in interface ListCommands
public KeyValue<java.lang.String,java.util.List<java.lang.String>> blmpop(double timeout, ListDirection direction, int count, java.lang.String... keys)
blmpop
in interface ListCommands
public KeyValue<java.lang.String,Tuple> bzpopmax(double timeout, java.lang.String... keys)
SortedSetCommands
ZPOPMAX
bzpopmax
in interface SortedSetCommands
timeout
- specifying the maximum number of seconds to block. A timeout of zero can
be used to block indefinitely.public KeyValue<java.lang.String,Tuple> bzpopmin(double timeout, java.lang.String... keys)
SortedSetCommands
ZPOPMIN
bzpopmin
in interface SortedSetCommands
timeout
- specifying the maximum number of seconds to block. A timeout of zero can
be used to block indefinitely.public java.util.List<java.lang.String> blpop(int timeout, java.lang.String key)
blpop
in interface ListCommands
ListCommands.blpop(int, String...)
public KeyValue<java.lang.String,java.lang.String> blpop(double timeout, java.lang.String key)
blpop
in interface ListCommands
ListCommands.blpop(double, String...)
public java.util.List<java.lang.String> brpop(int timeout, java.lang.String key)
brpop
in interface ListCommands
ListCommands.brpop(int, String...)
public KeyValue<java.lang.String,java.lang.String> brpop(double timeout, java.lang.String key)
brpop
in interface ListCommands
ListCommands.brpop(double, String...)
public long zcount(java.lang.String key, double min, double max)
SortedSetCommands
Time complexity O(log(N)) with N being the number of elements in the sorted set.
zcount
in interface SortedSetCommands
key
- the key to querymin
- minimum scoremax
- maximum scorepublic long zcount(java.lang.String key, java.lang.String min, java.lang.String max)
SortedSetCommands
ZCOUNT
but with exclusive range.zcount
in interface SortedSetCommands
SortedSetCommands.zcount(String, double, double)
public java.util.List<java.lang.String> zrangeByScore(java.lang.String key, double min, double 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 is
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 is 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))
zrangeByScore
in interface SortedSetCommands
key
- min
- a double or Double.NEGATIVE_INFINITY for "-inf"max
- a double or Double.POSITIVE_INFINITY for "+inf"zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, String, String)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.List<java.lang.String> zrangeByScore(java.lang.String key, java.lang.String min, java.lang.String max)
SortedSetCommands
ZRANGE
but with exclusive range.zrangeByScore
in interface SortedSetCommands
SortedSetCommands.zrangeByScore(String, double, double)
public java.util.List<java.lang.String> zrangeByScore(java.lang.String key, double min, double max, int offset, int count)
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 is
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 is 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))
zrangeByScore
in interface SortedSetCommands
key
- min
- max
- offset
- count
- zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.List<java.lang.String> zrangeByScore(java.lang.String key, java.lang.String min, java.lang.String max, int offset, int count)
SortedSetCommands
ZRANGE
but with limit option,zrangeByScore
in interface SortedSetCommands
key
- the key to querymin
- minimum scoremax
- maximum scoreoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetand with exclusive range.
public java.util.List<Tuple> zrangeByScoreWithScores(java.lang.String key, double min, double 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 is
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 is 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))
zrangeByScoreWithScores
in interface SortedSetCommands
key
- min
- max
- zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.List<Tuple> zrangeByScoreWithScores(java.lang.String key, java.lang.String min, java.lang.String max)
SortedSetCommands
ZRANGE
but with exclusive range,
and return with scores.zrangeByScoreWithScores
in interface SortedSetCommands
SortedSetCommands.zrangeByScore(String, double, double)
public java.util.List<Tuple> zrangeByScoreWithScores(java.lang.String key, double min, double max, int offset, int count)
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 is
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 is 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))
zrangeByScoreWithScores
in interface SortedSetCommands
key
- min
- max
- offset
- count
- zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.List<Tuple> zrangeByScoreWithScores(java.lang.String key, java.lang.String min, java.lang.String max, int offset, int count)
SortedSetCommands
ZRANGE
but with exclusive range,
with limit options and return with scores.zrangeByScoreWithScores
in interface SortedSetCommands
key
- the key to querymin
- minimum scoremax
- maximum scoreoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetSortedSetCommands.zrangeByScore(String, String, String)
public java.util.List<java.lang.String> zrevrangeByScore(java.lang.String key, double max, double min)
SortedSetCommands
The elements having the same score are returned in reverse lexicographical order.
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.
zrevrangeByScore
in interface SortedSetCommands
key
- the key to querymax
- maximum scoremin
- minimum scorepublic java.util.List<java.lang.String> zrevrangeByScore(java.lang.String key, java.lang.String max, java.lang.String min)
SortedSetCommands
ZREVRANGE
but with exclusive range.zrevrangeByScore
in interface SortedSetCommands
SortedSetCommands.zrevrangeByScore(String, double, double)
public java.util.List<java.lang.String> zrevrangeByScore(java.lang.String key, double max, double min, int offset, int count)
SortedSetCommands
ZRANGE
but with limit option,zrevrangeByScore
in interface SortedSetCommands
key
- the key to querymax
- maximum scoremin
- minimum scoreoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetSortedSetCommands.zrevrangeByScore(String, double, double)
public java.util.List<Tuple> zrevrangeByScoreWithScores(java.lang.String key, double max, double min)
SortedSetCommands
ZREVRANGE
but return with scores.zrevrangeByScoreWithScores
in interface SortedSetCommands
key
- the key to querymax
- maximum scoremin
- minimum scorereturn both the element and its score, instead of the element alone.
public java.util.List<Tuple> zrevrangeByScoreWithScores(java.lang.String key, double max, double min, int offset, int count)
SortedSetCommands
ZREVRANGE
but with
limit options and return with scores.zrevrangeByScoreWithScores
in interface SortedSetCommands
key
- the key to querymax
- maximum scoremin
- minimum scoreoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetSortedSetCommands.zrevrangeByScore(String, double, double)
public java.util.List<Tuple> zrevrangeByScoreWithScores(java.lang.String key, java.lang.String max, java.lang.String min, int offset, int count)
SortedSetCommands
ZREVRANGE
but with
exclusive range, with limit options and return with scores.zrevrangeByScoreWithScores
in interface SortedSetCommands
key
- the key to querymax
- maximum scoremin
- minimum scoreoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetSortedSetCommands.zrevrangeByScore(String, double, double)
public java.util.List<java.lang.String> zrevrangeByScore(java.lang.String key, java.lang.String max, java.lang.String min, int offset, int count)
SortedSetCommands
ZREVRANGE
but with limit option,zrevrangeByScore
in interface SortedSetCommands
key
- the key to querymax
- maximum scoremin
- minimum scoreoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetand with exclusive range.
public java.util.List<Tuple> zrevrangeByScoreWithScores(java.lang.String key, java.lang.String max, java.lang.String min)
SortedSetCommands
ZREVRANGE
but with exclusive range,
and return with scores.zrevrangeByScoreWithScores
in interface SortedSetCommands
SortedSetCommands.zrevrangeByScore(String, double, double)
public long zremrangeByRank(java.lang.String key, long start, long stop)
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
zremrangeByRank
in interface SortedSetCommands
key
- start
- stop
- public long zremrangeByScore(java.lang.String key, double min, double max)
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
in interface SortedSetCommands
key
- min
- max
- public long zremrangeByScore(java.lang.String key, java.lang.String min, java.lang.String max)
SortedSetCommands
ZREMRANGE
but with limit option.zremrangeByScore
in interface SortedSetCommands
SortedSetCommands.zremrangeByScore(String, double, double)
public java.util.List<java.lang.String> zunion(ZParams params, java.lang.String... keys)
zunion
in interface SortedSetCommands
params
- keys
- public java.util.List<Tuple> zunionWithScores(ZParams params, java.lang.String... keys)
zunionWithScores
in interface SortedSetCommands
params
- keys
- public long zunionstore(java.lang.String dstkey, java.lang.String... sets)
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 is 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
zunionstore
in interface SortedSetCommands
dstkey
- sets
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public long zunionstore(java.lang.String dstkey, ZParams params, java.lang.String... sets)
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 is 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
zunionstore
in interface SortedSetCommands
dstkey
- sets
- params
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public java.util.List<java.lang.String> zinter(ZParams params, java.lang.String... keys)
zinter
in interface SortedSetCommands
params
- keys
- public java.util.List<Tuple> zinterWithScores(ZParams params, java.lang.String... keys)
zinterWithScores
in interface SortedSetCommands
params
- keys
- public long zintercard(java.lang.String... keys)
SortedSetCommands
ZINTER
, but
instead of returning the result set, it returns just the cardinality of the result.
Time complexity O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets
zintercard
in interface SortedSetCommands
keys
- group of setsSortedSetCommands.zinter(ZParams, String...)
public long zintercard(long limit, java.lang.String... keys)
SortedSetCommands
ZINTER
, but
instead of returning the result set, it returns just the cardinality of the result.
Time complexity O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets
zintercard
in interface SortedSetCommands
limit
- If the intersection cardinality reaches limit partway through the computation,
the algorithm will exit and yield limit as the cardinalitykeys
- group of setsSortedSetCommands.zinter(ZParams, String...)
public long zinterstore(java.lang.String dstkey, java.lang.String... sets)
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 is 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
zinterstore
in interface SortedSetCommands
dstkey
- sets
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public long zinterstore(java.lang.String dstkey, ZParams params, java.lang.String... sets)
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 is 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
zinterstore
in interface SortedSetCommands
dstkey
- sets
- params
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public long zlexcount(java.lang.String key, java.lang.String min, java.lang.String max)
SortedSetCommands
Time complexity O(log(N)) with N being the number of elements in the sorted set.
zlexcount
in interface SortedSetCommands
min
- minimum valuemax
- maximum valuepublic java.util.List<java.lang.String> zrangeByLex(java.lang.String key, java.lang.String min, java.lang.String max)
SortedSetCommands
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.
zrangeByLex
in interface SortedSetCommands
min
- minimum valuemax
- maximum valuepublic java.util.List<java.lang.String> zrangeByLex(java.lang.String key, java.lang.String min, java.lang.String max, int offset, int count)
SortedSetCommands
ZRANGE
but with limit option.zrangeByLex
in interface SortedSetCommands
min
- minimum valuemax
- maximum valueoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetSortedSetCommands.zrangeByLex(String, String, String)
public java.util.List<java.lang.String> zrevrangeByLex(java.lang.String key, java.lang.String max, java.lang.String min)
SortedSetCommands
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.
zrevrangeByLex
in interface SortedSetCommands
max
- maximum valuemin
- minimum valuepublic java.util.List<java.lang.String> zrevrangeByLex(java.lang.String key, java.lang.String max, java.lang.String min, int offset, int count)
SortedSetCommands
ZRANGE
but with limit option.zrevrangeByLex
in interface SortedSetCommands
max
- maximum valuemin
- minimum valueoffset
- the first index of the sub-rangecount
- count of the sub-range. A negative count returns all elements from the offsetSortedSetCommands.zrevrangeByLex(String, String, String)
public long zremrangeByLex(java.lang.String key, java.lang.String min, java.lang.String max)
SortedSetCommands
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.
zremrangeByLex
in interface SortedSetCommands
min
- minimum value to removemax
- maximum value to removepublic KeyValue<java.lang.String,java.util.List<Tuple>> zmpop(SortedSetOption option, java.lang.String... keys)
zmpop
in interface SortedSetCommands
public KeyValue<java.lang.String,java.util.List<Tuple>> zmpop(SortedSetOption option, int count, java.lang.String... keys)
zmpop
in interface SortedSetCommands
public KeyValue<java.lang.String,java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, java.lang.String... keys)
bzmpop
in interface SortedSetCommands
public KeyValue<java.lang.String,java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, int count, java.lang.String... keys)
bzmpop
in interface SortedSetCommands
public long strlen(java.lang.String key)
StringCommands
strlen
in interface StringCommands
public LCSMatchResult lcs(java.lang.String keyA, java.lang.String keyB, LCSParams params)
lcs
in interface StringCommands
keyA
- keyB
- params
- public long lpushx(java.lang.String key, java.lang.String... strings)
ListCommands
LPUSH
, no operation will be performed when key
does not yet exist.lpushx
in interface ListCommands
strings
- the strings to pushpublic long persist(java.lang.String key)
expire
at turning the expire key into a normal key.
Time complexity: O(1)
persist
in interface KeyCommands
key
- public long rpushx(java.lang.String key, java.lang.String... strings)
ListCommands
RPUSH
, no operation will be performed when key
does not yet exist.rpushx
in interface ListCommands
strings
- the strings to pushpublic java.lang.String echo(java.lang.String string)
echo
in interface ServerCommands
public long linsert(java.lang.String key, ListPosition where, java.lang.String pivot, java.lang.String value)
ListCommands
When key does not exist, it is considered an empty list and no operation is performed.
linsert
in interface ListCommands
where
- can be BEFORE or AFTERpivot
- reference valuevalue
- the valuepublic java.lang.String brpoplpush(java.lang.String source, java.lang.String destination, int timeout)
brpoplpush
in interface ListCommands
source
- destination
- timeout
- public boolean setbit(java.lang.String key, long offset, boolean value)
setbit
in interface BitCommands
key
- offset
- value
- public boolean getbit(java.lang.String key, long offset)
getbit
in interface BitCommands
key
- offset
- public long setrange(java.lang.String key, long offset, java.lang.String value)
StringCommands
Time complexity: O(1)
setrange
in interface StringCommands
public java.lang.String getrange(java.lang.String key, long startOffset, long endOffset)
StringCommands
Time complexity: O(N) where N is the length of the returned string
getrange
in interface StringCommands
public long bitpos(java.lang.String key, boolean value)
BitCommands
bitpos
in interface BitCommands
value
- the bit valuepublic long bitpos(java.lang.String key, boolean value, BitPosParams params)
BitCommands
bitpos
in interface BitCommands
value
- the bit valueparams
- BitPosParams
public java.util.List<java.lang.Object> role()
ControlCommands
role
in interface ControlCommands
public java.util.Map<java.lang.String,java.lang.String> configGet(java.lang.String pattern)
CONFIG GET returns the current configuration parameters. This sub command only accepts a single argument, that is glob style pattern. All the configuration parameters matching this parameter are reported as a list of key-value pairs.
Example:
$ redis-cli config get '*' 1. "dbfilename" 2. "dump.rdb" 3. "requirepass" 4. (nil) 5. "masterauth" 6. (nil) 7. "maxmemory" 8. "0\n" 9. "appendfsync" 10. "everysec" 11. "save" 12. "3600 1 300 100 60 10000" $ redis-cli config get 'm*' 1. "masterauth" 2. (nil) 3. "maxmemory" 4. "0\n"
configGet
in interface ConfigCommands
pattern
- public java.util.Map<java.lang.String,java.lang.String> configGet(java.lang.String... patterns)
ConfigCommands
configGet
in interface ConfigCommands
patterns
- names of Redis server's configurationpublic java.lang.String configSet(java.lang.String parameter, java.lang.String value)
The list of configuration parameters supported by CONFIG SET can be obtained issuing a
CONFIG GET *
command.
The configuration set using CONFIG SET is immediately loaded by the Redis server that will start acting as specified starting from the next command.
Parameters value format
The value of the configuration parameter is the same as the one of the same parameter in the Redis configuration file, with the following exceptions:
configSet
in interface ConfigCommands
parameter
- value
- public java.lang.String configSet(java.lang.String... parameterValues)
configSet
in interface ConfigCommands
public java.lang.String configSet(java.util.Map<java.lang.String,java.lang.String> parameterValues)
configSet
in interface ConfigCommands
public long publish(java.lang.String channel, java.lang.String message)
public void subscribe(JedisPubSub jedisPubSub, java.lang.String... channels)
public void psubscribe(JedisPubSub jedisPubSub, java.lang.String... patterns)
public java.util.List<java.lang.String> pubsubChannels()
public java.util.List<java.lang.String> pubsubChannels(java.lang.String pattern)
public java.lang.Long pubsubNumPat()
public java.util.Map<java.lang.String,java.lang.Long> pubsubNumSub(java.lang.String... channels)
public java.util.List<java.lang.String> pubsubShardChannels()
public java.util.List<java.lang.String> pubsubShardChannels(java.lang.String pattern)
public java.util.Map<java.lang.String,java.lang.Long> pubsubShardNumSub(java.lang.String... channels)
public java.lang.Object eval(java.lang.String script, int keyCount, java.lang.String... params)
ScriptingKeyCommands
eval
in interface ScriptingKeyCommands
script
- Lua 5.1 script. The script does not need to define a Lua function (and should not).
It is just a Lua program that will run in the context of the Redis server.keyCount
- the count of the provided keysparams
- arguments that can be accessed from the scriptpublic java.lang.Object eval(java.lang.String script, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
ScriptingKeyCommands
eval
in interface ScriptingKeyCommands
script
- Lua 5.1 script. The script does not need to define a Lua function (and should not).
It is just a Lua program that will run in the context of the Redis server.keys
- arguments that can be accessed by the scriptargs
- additional arguments should not represent key names and can be accessed by the scriptpublic java.lang.Object evalReadonly(java.lang.String script, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
ScriptingKeyCommands
EVAL
evalReadonly
in interface ScriptingKeyCommands
script
- Lua 5.1 script. The script does not need to define a Lua function (and should not).
It is just a Lua program that will run in the context of the Redis server.keys
- arguments that can be accessed by the scriptargs
- additional arguments should not represent key names and can be accessed by the scriptScriptingKeyCommands.eval(String, List, List)
public java.lang.Object eval(java.lang.String script)
ScriptingKeyCommands
eval
in interface ScriptingKeyCommands
script
- Lua 5.1 script. The script does not need to define a Lua function (and should not).
It is just a Lua program that will run in the context of the Redis server.public java.lang.Object evalsha(java.lang.String sha1)
ScriptingKeyCommands
EVAL
, but the script cached on the server
side by its SHA1 digest. Scripts are cached on the server side using the SCRIPT LOAD command.evalsha
in interface ScriptingKeyCommands
sha1
- the scriptScriptingKeyCommands.eval(String)
public java.lang.Object evalsha(java.lang.String sha1, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
ScriptingKeyCommands
ScriptingKeyCommands.eval(String, List, List)
EVAL}, but the script cached on the server
side by its SHA1 digest. Scripts are cached on the server side using the SCRIPT LOAD command.evalsha
in interface ScriptingKeyCommands
sha1
- the scriptScriptingKeyCommands.eval(String, List, List)
public java.lang.Object evalshaReadonly(java.lang.String sha1, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
ScriptingKeyCommands
EVAL
evalshaReadonly
in interface ScriptingKeyCommands
sha1
- the scriptScriptingKeyCommands.evalsha(String, List, List)
public java.lang.Object evalsha(java.lang.String sha1, int keyCount, java.lang.String... params)
ScriptingKeyCommands
ScriptingKeyCommands.eval(String, int, String...)
EVAL}, but the script cached on the server
side by its SHA1 digest. Scripts are cached on the server side using the SCRIPT LOAD command.evalsha
in interface ScriptingKeyCommands
sha1
- the scriptScriptingKeyCommands.eval(String, int, String...)
public java.lang.Boolean scriptExists(java.lang.String sha1)
scriptExists
in interface ScriptingControlCommands
public java.util.List<java.lang.Boolean> scriptExists(java.lang.String... sha1)
scriptExists
in interface ScriptingControlCommands
public java.lang.String scriptLoad(java.lang.String script)
scriptLoad
in interface ScriptingControlCommands
public java.util.List<Slowlog> slowlogGet()
slowlogGet
in interface SlowlogCommands
public java.util.List<Slowlog> slowlogGet(long entries)
slowlogGet
in interface SlowlogCommands
public java.lang.Long objectRefcount(java.lang.String key)
KeyCommands
Time complexity: O(1)
objectRefcount
in interface ControlCommands
objectRefcount
in interface KeyCommands
key
- The key in Redis serverpublic java.lang.String objectEncoding(java.lang.String key)
KeyCommands
Time complexity: O(1)
objectEncoding
in interface ControlCommands
objectEncoding
in interface KeyCommands
key
- The key in Redis serverpublic java.lang.Long objectIdletime(java.lang.String key)
KeyCommands
Time complexity: O(1)
objectIdletime
in interface ControlCommands
objectIdletime
in interface KeyCommands
key
- The key in Redis serverpublic java.util.List<java.lang.String> objectHelp()
ControlCommands
objectHelp
in interface ControlCommands
public java.lang.Long objectFreq(java.lang.String key)
KeyCommands
Time complexity: O(1)
objectFreq
in interface ControlCommands
objectFreq
in interface KeyCommands
key
- The key in Redis serverpublic long bitcount(java.lang.String key)
BitCommands
bitcount
in interface BitCommands
public long bitcount(java.lang.String key, long start, long end)
BitCommands
Like for the GETRANGE command start and end can contain negative values in order to index bytes starting from the end of the string, where -1 is the last byte, -2 is the penultimate, and so forth.
bitcount
in interface BitCommands
start
- byte start indexend
- byte end indexpublic long bitcount(java.lang.String key, long start, long end, BitCountOption option)
bitcount
in interface BitCommands
start
- byte start indexend
- byte end indexoption
- indicate BYTE or BITBitCommands.bitcount(String, long, long)
public long bitop(BitOP op, java.lang.String destKey, java.lang.String... srcKeys)
BitCommands
bitop
in interface BitCommands
op
- can be AND, OR, XOR or NOTpublic long commandCount()
public java.util.Map<java.lang.String,CommandDocument> commandDocs(java.lang.String... commands)
public java.util.List<java.lang.String> commandGetKeys(java.lang.String... command)
public java.util.List<KeyValue<java.lang.String,java.util.List<java.lang.String>>> commandGetKeysAndFlags(java.lang.String... command)
public java.util.Map<java.lang.String,CommandInfo> commandInfo(java.lang.String... commands)
public java.util.List<java.lang.String> commandList()
public java.util.List<java.lang.String> commandListFilterBy(CommandListFilterByParams filterByParams)
public java.lang.String sentinelMyId()
sentinelMyId
in interface SentinelCommands
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> sentinelMasters()
redis 127.0.0.1:26381> sentinel masters 1) 1) "name" 2) "mymaster" 3) "ip" 4) "127.0.0.1" 5) "port" 6) "6379" 7) "runid" 8) "93d4d4e6e9c06d0eea36e27f31924ac26576081d" 9) "flags" 10) "master" 11) "pending-commands" 12) "0" 13) "last-ok-ping-reply" 14) "423" 15) "last-ping-reply" 16) "423" 17) "info-refresh" 18) "6107" 19) "num-slaves" 20) "1" 21) "num-other-sentinels" 22) "2" 23) "quorum" 24) "2"
sentinelMasters
in interface SentinelCommands
public java.util.Map<java.lang.String,java.lang.String> sentinelMaster(java.lang.String masterName)
sentinelMaster
in interface SentinelCommands
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> sentinelSentinels(java.lang.String masterName)
sentinelSentinels
in interface SentinelCommands
public java.util.List<java.lang.String> sentinelGetMasterAddrByName(java.lang.String masterName)
redis 127.0.0.1:26381> sentinel get-master-addr-by-name mymaster 1) "127.0.0.1" 2) "6379"
sentinelGetMasterAddrByName
in interface SentinelCommands
masterName
- public java.lang.Long sentinelReset(java.lang.String pattern)
redis 127.0.0.1:26381> sentinel reset mymaster (integer) 1
sentinelReset
in interface SentinelCommands
pattern
- @Deprecated public java.util.List<java.util.Map<java.lang.String,java.lang.String>> sentinelSlaves(java.lang.String masterName)
redis 127.0.0.1:26381> sentinel slaves mymaster 1) 1) "name" 2) "127.0.0.1:6380" 3) "ip" 4) "127.0.0.1" 5) "port" 6) "6380" 7) "runid" 8) "d7f6c0ca7572df9d2f33713df0dbf8c72da7c039" 9) "flags" 10) "slave" 11) "pending-commands" 12) "0" 13) "last-ok-ping-reply" 14) "47" 15) "last-ping-reply" 16) "47" 17) "info-refresh" 18) "657" 19) "master-link-down-time" 20) "0" 21) "master-link-status" 22) "ok" 23) "master-host" 24) "localhost" 25) "master-port" 26) "6379" 27) "slave-priority" 28) "100"
sentinelSlaves
in interface SentinelCommands
masterName
- public java.util.List<java.util.Map<java.lang.String,java.lang.String>> sentinelReplicas(java.lang.String masterName)
sentinelReplicas
in interface SentinelCommands
public java.lang.String sentinelFailover(java.lang.String masterName)
sentinelFailover
in interface SentinelCommands
public java.lang.String sentinelMonitor(java.lang.String masterName, java.lang.String ip, int port, int quorum)
sentinelMonitor
in interface SentinelCommands
public java.lang.String sentinelRemove(java.lang.String masterName)
sentinelRemove
in interface SentinelCommands
public java.lang.String sentinelSet(java.lang.String masterName, java.util.Map<java.lang.String,java.lang.String> parameterMap)
sentinelSet
in interface SentinelCommands
public byte[] dump(java.lang.String key)
KeyCommands
Time complexity: O(1) to access the key and additional O(N*M) to serialize it where N is the number of Redis objects composing the value and M their average size.
dump
in interface KeyCommands
public java.lang.String restore(java.lang.String key, long ttl, byte[] serializedValue)
KeyCommands
DUMP
).
Time complexity: O(1) to access the key and additional O(N*M) to serialize it where N is the number of Redis objects composing the value and M their average size.
restore
in interface KeyCommands
ttl
- If ttl is 0 the key is created without any expire, otherwise the specified expire
time (in milliseconds) is set.public java.lang.String restore(java.lang.String key, long ttl, byte[] serializedValue, RestoreParams params)
KeyCommands
DUMP
).
Time complexity: O(1) to access the key and additional O(N*M) to serialize it where N is the number of Redis objects composing the value and M their average size.
restore
in interface KeyCommands
ttl
- If ttl is 0 the key is created without any expire, otherwise the specified expire
time (in milliseconds) is set.params
- RestoreParams
public long pttl(java.lang.String key)
KeyCommands
EXPIRE
set.
Time complexity: O(1)
pttl
in interface KeyCommands
public java.lang.String psetex(java.lang.String key, long milliseconds, java.lang.String value)
setex(String, long, String)
with the sole difference
that the expire time is specified in milliseconds instead of seconds. Time complexity: O(1)psetex
in interface StringCommands
key
- milliseconds
- value
- public java.lang.String aclSetUser(java.lang.String name)
AccessControlLogCommands
aclSetUser
in interface AccessControlLogCommands
name
- user who receives an aclpublic java.lang.String aclSetUser(java.lang.String name, java.lang.String... rules)
AccessControlLogCommands
aclSetUser
in interface AccessControlLogCommands
name
- user who receives an aclrules
- the acl rules for the specified userpublic long aclDelUser(java.lang.String... names)
AccessControlLogCommands
aclDelUser
in interface AccessControlLogCommands
names
- The usernames to deletepublic AccessControlUser aclGetUser(java.lang.String name)
AccessControlLogCommands
aclGetUser
in interface AccessControlLogCommands
name
- usernamepublic java.util.List<java.lang.String> aclUsers()
AccessControlLogCommands
aclUsers
in interface AccessControlLogCommands
public java.util.List<java.lang.String> aclList()
AccessControlLogCommands
aclList
in interface AccessControlLogCommands
public java.lang.String aclWhoAmI()
AccessControlLogCommands
aclWhoAmI
in interface AccessControlLogCommands
public java.util.List<java.lang.String> aclCat()
AccessControlLogCommands
aclCat
in interface AccessControlLogCommands
public java.util.List<java.lang.String> aclCat(java.lang.String category)
AccessControlLogCommands
aclCat
in interface AccessControlLogCommands
category
- The category for which to list available ACLspublic java.util.List<AccessControlLogEntry> aclLog()
AccessControlLogCommands
aclLog
in interface AccessControlLogCommands
public java.util.List<AccessControlLogEntry> aclLog(int limit)
AccessControlLogCommands
aclLog
in interface AccessControlLogCommands
limit
- The number of results to returnpublic java.lang.String aclLoad()
AccessControlLogCommands
aclLoad
in interface AccessControlLogBinaryCommands
aclLoad
in interface AccessControlLogCommands
public java.lang.String aclSave()
AccessControlLogCommands
aclSave
in interface AccessControlLogBinaryCommands
aclSave
in interface AccessControlLogCommands
public java.lang.String aclGenPass()
AccessControlLogCommands
aclGenPass
in interface AccessControlLogCommands
public java.lang.String aclGenPass(int bits)
AccessControlLogCommands
aclGenPass
in interface AccessControlLogCommands
bits
- the number of output bitspublic java.lang.String aclDryRun(java.lang.String username, java.lang.String command, java.lang.String... args)
aclDryRun
in interface AccessControlLogCommands
public java.lang.String aclDryRun(java.lang.String username, CommandArguments commandArgs)
aclDryRun
in interface AccessControlLogCommands
public byte[] aclDryRunBinary(byte[] username, byte[] command, byte[]... args)
aclDryRunBinary
in interface AccessControlLogBinaryCommands
public byte[] aclDryRunBinary(byte[] username, CommandArguments commandArgs)
aclDryRunBinary
in interface AccessControlLogBinaryCommands
public java.lang.String clientKill(java.lang.String ipPort)
ClientCommands
clientKill
in interface ClientCommands
ipPort
- The ip:port should match a line returned by the CLIENT LIST command (addr field).public java.lang.String clientGetname()
ClientCommands
clientGetname
in interface ClientCommands
public java.lang.String clientList()
ClientCommands
clientList
in interface ClientCommands
public java.lang.String clientList(ClientType type)
ClientCommands
clientList
in interface ClientCommands
public java.lang.String clientList(long... clientIds)
ClientCommands
clientList
in interface ClientCommands
clientIds
- Unique 64-bit client IDspublic java.lang.String clientInfo()
ClientCommands
clientInfo
in interface ClientCommands
public java.lang.String clientSetInfo(ClientAttributeOption attr, java.lang.String value)
ClientCommands
clientSetInfo
in interface ClientCommands
attr
- the attr optionvalue
- the valuepublic java.lang.String clientSetname(java.lang.String name)
ClientCommands
clientSetname
in interface ClientCommands
name
- current connection namepublic java.lang.String migrate(java.lang.String host, int port, java.lang.String key, int destinationDb, int timeout)
DatabaseCommands
migrate
in interface DatabaseCommands
host
- target hostport
- target portkey
- migrate keydestinationDb
- target dbtimeout
- the maximum idle time in any moment of the communication with the
destination instance in milliseconds.public java.lang.String migrate(java.lang.String host, int port, int destinationDB, int timeout, MigrateParams params, java.lang.String... keys)
DatabaseCommands
migrate
in interface DatabaseCommands
host
- target hostport
- target portdestinationDB
- target dbtimeout
- the maximum idle time in any moment of the communication with the
destination instance in milliseconds.params
- MigrateParams
keys
- to migratepublic java.lang.String migrate(java.lang.String host, int port, java.lang.String key, int timeout)
KeyCommands
migrate
in interface KeyCommands
timeout
- the maximum idle time in any moment of the communication with the
destination instance in milliseconds.public java.lang.String migrate(java.lang.String host, int port, int timeout, MigrateParams params, java.lang.String... keys)
KeyCommands
migrate
in interface KeyCommands
timeout
- the maximum idle time in any moment of the communication with the
destination instance in milliseconds.params
- MigrateParams
public ScanResult<java.lang.String> scan(java.lang.String cursor)
scan
in interface KeyCommands
public ScanResult<java.lang.String> scan(java.lang.String cursor, ScanParams params)
scan
in interface KeyCommands
public ScanResult<java.lang.String> scan(java.lang.String cursor, ScanParams params, java.lang.String type)
scan
in interface KeyCommands
public ScanResult<java.util.Map.Entry<java.lang.String,java.lang.String>> hscan(java.lang.String key, java.lang.String cursor, ScanParams params)
hscan
in interface HashCommands
public ScanResult<java.lang.String> sscan(java.lang.String key, java.lang.String cursor, ScanParams params)
sscan
in interface SetCommands
public ScanResult<Tuple> zscan(java.lang.String key, java.lang.String cursor, ScanParams params)
zscan
in interface SortedSetCommands
public java.lang.String readonly()
readonly
in interface ClusterCommands
public java.lang.String readwrite()
readwrite
in interface ClusterCommands
public java.lang.String clusterNodes()
clusterNodes
in interface ClusterCommands
public java.lang.String clusterMeet(java.lang.String ip, int port)
clusterMeet
in interface ClusterCommands
public java.lang.String clusterReset()
clusterReset
in interface ClusterCommands
public java.lang.String clusterReset(ClusterResetType resetType)
ClusterCommands
resetType
can be null for default behavior.clusterReset
in interface ClusterCommands
public java.lang.String clusterAddSlots(int... slots)
clusterAddSlots
in interface ClusterCommands
public java.lang.String clusterDelSlots(int... slots)
clusterDelSlots
in interface ClusterCommands
public java.lang.String clusterInfo()
clusterInfo
in interface ClusterCommands
public java.util.List<java.lang.String> clusterGetKeysInSlot(int slot, int count)
clusterGetKeysInSlot
in interface ClusterCommands
public java.util.List<byte[]> clusterGetKeysInSlotBinary(int slot, int count)
clusterGetKeysInSlotBinary
in interface ClusterCommands
public java.lang.String clusterSetSlotNode(int slot, java.lang.String nodeId)
clusterSetSlotNode
in interface ClusterCommands
public java.lang.String clusterSetSlotMigrating(int slot, java.lang.String nodeId)
clusterSetSlotMigrating
in interface ClusterCommands
public java.lang.String clusterSetSlotImporting(int slot, java.lang.String nodeId)
clusterSetSlotImporting
in interface ClusterCommands
public java.lang.String clusterSetSlotStable(int slot)
clusterSetSlotStable
in interface ClusterCommands
public java.lang.String clusterForget(java.lang.String nodeId)
clusterForget
in interface ClusterCommands
public java.lang.String clusterFlushSlots()
clusterFlushSlots
in interface ClusterCommands
public long clusterKeySlot(java.lang.String key)
clusterKeySlot
in interface ClusterCommands
public long clusterCountFailureReports(java.lang.String nodeId)
clusterCountFailureReports
in interface ClusterCommands
public long clusterCountKeysInSlot(int slot)
clusterCountKeysInSlot
in interface ClusterCommands
public java.lang.String clusterSaveConfig()
clusterSaveConfig
in interface ClusterCommands
public java.lang.String clusterSetConfigEpoch(long configEpoch)
ClusterCommands
clusterSetConfigEpoch
in interface ClusterCommands
public java.lang.String clusterBumpEpoch()
ClusterCommands
clusterBumpEpoch
in interface ClusterCommands
public java.lang.String clusterReplicate(java.lang.String nodeId)
clusterReplicate
in interface ClusterCommands
@Deprecated public java.util.List<java.lang.String> clusterSlaves(java.lang.String nodeId)
ClusterCommands
CLUSTER SLAVES
command is deprecated since Redis 5.clusterSlaves
in interface ClusterCommands
public java.util.List<java.lang.String> clusterReplicas(java.lang.String nodeId)
clusterReplicas
in interface ClusterCommands
public java.lang.String clusterFailover()
clusterFailover
in interface ClusterCommands
public java.lang.String clusterFailover(ClusterFailoverOption failoverOption)
clusterFailover
in interface ClusterCommands
public java.util.List<java.lang.Object> clusterSlots()
clusterSlots
in interface ClusterCommands
public java.lang.String clusterMyId()
clusterMyId
in interface ClusterCommands
public java.lang.String clusterMyShardId()
clusterMyShardId
in interface ClusterCommands
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> clusterLinks()
ClusterCommands
clusterLinks
in interface ClusterCommands
public java.lang.String clusterAddSlotsRange(int... ranges)
ClusterCommands
clusterAddSlotsRange
in interface ClusterCommands
ranges
- slots rangepublic java.lang.String clusterDelSlotsRange(int... ranges)
ClusterCommands
clusterDelSlotsRange
in interface ClusterCommands
ranges
- slots rangepublic java.lang.String asking()
asking
in interface ClusterCommands
public long pfadd(java.lang.String key, java.lang.String... elements)
pfadd
in interface HyperLogLogCommands
public long pfcount(java.lang.String key)
pfcount
in interface HyperLogLogCommands
public long pfcount(java.lang.String... keys)
pfcount
in interface HyperLogLogCommands
public java.lang.String pfmerge(java.lang.String destkey, java.lang.String... sourcekeys)
pfmerge
in interface HyperLogLogCommands
public java.lang.Object fcall(java.lang.String name, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
FunctionCommands
fcall
in interface FunctionCommands
public java.lang.Object fcallReadonly(java.lang.String name, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
FunctionCommands
FCALL
command that cannot execute commands that modify data.fcallReadonly
in interface FunctionCommands
public java.lang.String functionDelete(java.lang.String libraryName)
FunctionCommands
functionDelete
in interface FunctionCommands
public java.lang.String functionLoad(java.lang.String functionCode)
FunctionCommands
The library payload must start with Shebang statement that provides a metadata about the
library (like the engine to use and the library name). Shebang format:
#!<engine name> name=<library name>
. Currently engine name must be lua.
functionLoad
in interface FunctionCommands
functionCode
- the source code.public java.lang.String functionLoadReplace(java.lang.String functionCode)
FunctionCommands
functionLoadReplace
in interface FunctionCommands
functionCode
- the source codepublic FunctionStats functionStats()
FunctionCommands
functionStats
in interface FunctionCommands
FunctionStats
public java.lang.String functionFlush()
FunctionCommands
functionFlush
in interface FunctionBinaryCommands
functionFlush
in interface FunctionCommands
public java.lang.String functionFlush(FlushMode mode)
FunctionCommands
functionFlush
in interface FunctionBinaryCommands
functionFlush
in interface FunctionCommands
mode
- ASYNC: Asynchronously flush the libraries, SYNC: Synchronously flush the libraries.public java.lang.String functionKill()
FunctionCommands
functionKill
in interface FunctionBinaryCommands
functionKill
in interface FunctionCommands
public java.util.List<LibraryInfo> functionList()
FunctionCommands
functionList
in interface FunctionCommands
LibraryInfo
public java.util.List<LibraryInfo> functionList(java.lang.String libraryNamePattern)
FunctionCommands
functionList
in interface FunctionCommands
libraryNamePattern
- a pattern for matching library namesLibraryInfo
public java.util.List<LibraryInfo> functionListWithCode()
FunctionCommands
FUNCTION LIST
but include the
libraries source implementation in the reply.functionListWithCode
in interface FunctionCommands
LibraryInfo
FunctionCommands.functionList()
public java.util.List<LibraryInfo> functionListWithCode(java.lang.String libraryNamePattern)
FunctionCommands
FUNCTION LIST
but include the
libraries source implementation in the reply.functionListWithCode
in interface FunctionCommands
libraryNamePattern
- a pattern for matching library namesLibraryInfo
FunctionCommands.functionList(String)
public long geoadd(java.lang.String key, double longitude, double latitude, java.lang.String member)
GeoCommands
Time complexity: O(log(N)) where N is the number of elements in the sorted set.
geoadd
in interface GeoCommands
public long geoadd(java.lang.String key, java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
GeoCommands
Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.
geoadd
in interface GeoCommands
memberCoordinateMap
- Members names with their geo coordinatespublic long geoadd(java.lang.String key, GeoAddParams params, java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
GeoCommands
Time complexity: O(log(N)) for each item added
geoadd
in interface GeoCommands
params
- Additional optionsmemberCoordinateMap
- Members names with their geo coordinatespublic java.lang.Double geodist(java.lang.String key, java.lang.String member1, java.lang.String member2)
GeoCommands
Time complexity: O(log(N))
geodist
in interface GeoCommands
public java.lang.Double geodist(java.lang.String key, java.lang.String member1, java.lang.String member2, GeoUnit unit)
GeoCommands
Time complexity: O(log(N))
geodist
in interface GeoCommands
unit
- can be M, KM, MI or FT can M, KM, MI or FTpublic java.util.List<java.lang.String> geohash(java.lang.String key, java.lang.String... members)
GeoCommands
Time complexity: O(log(N)) for each member requested
geohash
in interface GeoCommands
public java.util.List<GeoCoordinate> geopos(java.lang.String key, java.lang.String... members)
GeoCommands
Time complexity: O(N) where N is the number of members requested.
geopos
in interface GeoCommands
public java.util.List<GeoRadiusResponse> georadius(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit)
GeoCommands
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadius
in interface GeoCommands
longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTpublic java.util.List<GeoRadiusResponse> georadiusReadonly(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit)
GeoCommands
GEORADIUS
,
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusReadonly
in interface GeoCommands
longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTGeoCommands.georadius(String, double, double, double, GeoUnit)
public java.util.List<GeoRadiusResponse> georadius(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
GeoCommands
GeoRadiusParam
:
WITHDIST: Also return the distance of the returned items from the specified center.
The distance is returned in the same unit as the unit specified as the radius argument of the command.
WITHCOORD: Also return the longitude,latitude coordinates of the matching items.
WITHHASH: Also return the raw geohash-encoded sorted set score of the item, in the form of a 52
bit unsigned integer. This is only useful for low level hacks or debugging and is otherwise of
little interest for the general user.
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadius
in interface GeoCommands
longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
public long georadiusStore(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
GeoCommands
GEORADIUS
but storing the results at the destination key (provided with storeParam
).
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusStore
in interface GeoCommands
longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
storeParam
- GeoRadiusStoreParam
public java.util.List<GeoRadiusResponse> georadiusReadonly(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
GeoCommands
GEORADIUS
,
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusReadonly
in interface GeoCommands
longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
GeoCommands.georadius(String, double, double, double, GeoUnit, GeoRadiusParam)
public java.util.List<GeoRadiusResponse> georadiusByMember(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
GeoCommands
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set.
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusByMember
in interface GeoCommands
member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTpublic java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
GeoCommands
GEORADIUSBYMEMBER
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusByMemberReadonly
in interface GeoCommands
member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTpublic java.util.List<GeoRadiusResponse> georadiusByMember(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param)
GeoCommands
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set.
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusByMember
in interface GeoCommands
member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
public long georadiusByMemberStore(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
GeoCommands
GEORADIUSBYMEMBER
but storing the results at the destination key (provided with storeParam
).
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusByMemberStore
in interface GeoCommands
member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
storeParam
- GeoRadiusStoreParam
public java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param)
GeoCommands
GEORADIUSBYMEMBER
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
georadiusByMemberReadonly
in interface GeoCommands
member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
public java.util.List<GeoRadiusResponse> geosearch(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
GeoCommands
This command can be used in place of the GEORADIUSBYMEMBER
command.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearch
in interface GeoCommands
member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTpublic java.util.List<GeoRadiusResponse> geosearch(java.lang.String key, GeoCoordinate coord, double radius, GeoUnit unit)
GeoCommands
This command can be used in place of the GEORADIUS
command.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearch
in interface GeoCommands
coord
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTpublic java.util.List<GeoRadiusResponse> geosearch(java.lang.String key, java.lang.String member, double width, double height, GeoUnit unit)
GeoCommands
The axis-aligned rectangle, determined by height and width, when the center point is determined by the position of the given member.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearch
in interface GeoCommands
member
- represents the center of the areawidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTpublic java.util.List<GeoRadiusResponse> geosearch(java.lang.String key, GeoCoordinate coord, double width, double height, GeoUnit unit)
GeoCommands
The axis-aligned rectangle, determined by height and width, when the center point is determined by the given coordinate.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearch
in interface GeoCommands
coord
- represents the center pointwidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTpublic java.util.List<GeoRadiusResponse> geosearch(java.lang.String key, GeoSearchParam params)
GeoCommands
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearch
in interface GeoCommands
params
- GeoSearchParam
public long geosearchStore(java.lang.String dest, java.lang.String src, java.lang.String member, double radius, GeoUnit unit)
GeoCommands
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearchStore
in interface GeoCommands
src
- the sorted set (key)member
- represents the center of the arearadius
- of the circular areaunit
- can be M, KM, MI or FTpublic long geosearchStore(java.lang.String dest, java.lang.String src, GeoCoordinate coord, double radius, GeoUnit unit)
GeoCommands
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearchStore
in interface GeoCommands
coord
- represents the center pointradius
- of the circular areaunit
- can be M, KM, MI or FTpublic long geosearchStore(java.lang.String dest, java.lang.String src, java.lang.String member, double width, double height, GeoUnit unit)
GeoCommands
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearchStore
in interface GeoCommands
member
- represents the center of the areawidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTpublic long geosearchStore(java.lang.String dest, java.lang.String src, GeoCoordinate coord, double width, double height, GeoUnit unit)
GeoCommands
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearchStore
in interface GeoCommands
coord
- represents the center pointwidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTpublic long geosearchStore(java.lang.String dest, java.lang.String src, GeoSearchParam params)
GeoCommands
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearchStore
in interface GeoCommands
params
- GeoSearchParam
public long geosearchStoreStoreDist(java.lang.String dest, java.lang.String src, GeoSearchParam params)
GeoCommands
GEOSEARCHSTORE
but storing the results with their destinations from the center point.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
geosearchStoreStoreDist
in interface GeoCommands
params
- GeoSearchParam
public java.lang.String moduleLoad(java.lang.String path)
ModuleCommands
moduleLoad
in interface ModuleCommands
path
- should be the absolute path of the library, including the full filenamepublic java.lang.String moduleLoad(java.lang.String path, java.lang.String... args)
ModuleCommands
moduleLoad
in interface ModuleCommands
path
- should be the absolute path of the library, including the full filenameargs
- additional arguments are passed unmodified to the modulepublic java.lang.String moduleLoadEx(java.lang.String path, ModuleLoadExParams params)
ModuleCommands
This is an extended version of the MODULE LOAD command.
It loads and initializes the Redis module from the dynamic library specified by the path argument. The path should be the absolute path of the library, including the full filename.
You can use the optional CONFIG argument to provide the module with configuration directives. Any additional arguments that follow the ARGS keyword are passed unmodified to the module.
moduleLoadEx
in interface ModuleCommands
path
- should be the absolute path of the library, including the full filenameparams
- as in descriptionpublic java.lang.String moduleUnload(java.lang.String name)
ModuleCommands
MODULE LIST
command, and may differ from the dynamic
library's filename.moduleUnload
in interface ModuleCommands
public java.util.List<Module> moduleList()
ModuleCommands
moduleList
in interface GenericControlCommands
moduleList
in interface ModuleCommands
Module
public java.util.List<java.lang.Long> bitfield(java.lang.String key, java.lang.String... arguments)
BitCommands
bitfield
in interface BitCommands
arguments
- may be used with optional argumentspublic java.util.List<java.lang.Long> bitfieldReadonly(java.lang.String key, java.lang.String... arguments)
BitCommands
BITFIELD
bitfieldReadonly
in interface BitCommands
public long hstrlen(java.lang.String key, java.lang.String field)
hstrlen
in interface HashCommands
public java.lang.String memoryDoctor()
ControlCommands
memoryDoctor
in interface ControlCommands
public java.lang.Long memoryUsage(java.lang.String key)
KeyCommands
Time complexity: O(1)
memoryUsage
in interface ControlCommands
memoryUsage
in interface KeyCommands
key
- The key in Redis serverpublic java.lang.Long memoryUsage(java.lang.String key, int samples)
KeyCommands
Time complexity: O(1)
memoryUsage
in interface ControlCommands
memoryUsage
in interface KeyCommands
key
- The key in Redis serversamples
- the number of sampled nested values. By default, this option is set to 5.
To sample the all the nested values, use 0.public java.lang.String memoryPurge()
ControlCommands
memoryPurge
in interface ControlCommands
public java.util.Map<java.lang.String,java.lang.Object> memoryStats()
ControlCommands
memoryStats
in interface ControlCommands
public java.lang.String lolwut()
lolwut
in interface ServerCommands
public java.lang.String lolwut(LolwutParams lolwutParams)
lolwut
in interface ServerCommands
public java.lang.String latencyDoctor()
ServerCommands
This command is the most powerful analysis tool in the latency monitoring framework, and is able to provide additional statistical data like the average period between latency spikes, the median deviation, and a human-readable analysis of the event. For certain events, like fork, additional information is provided, like the rate at which the system forks processes.
This is the output you should post in the Redis mailing list if you are looking for help about Latency related issues.
latencyDoctor
in interface ServerCommands
public StreamEntryID xadd(java.lang.String key, StreamEntryID id, java.util.Map<java.lang.String,java.lang.String> hash)
StreamCommands
xadd
in interface StreamCommands
public StreamEntryID xadd(java.lang.String key, XAddParams params, java.util.Map<java.lang.String,java.lang.String> hash)
xadd
in interface StreamCommands
public long xlen(java.lang.String key)
StreamCommands
xlen
in interface StreamCommands
public java.util.List<StreamEntry> xrange(java.lang.String key, StreamEntryID start, StreamEntryID end)
StreamCommands
xrange
in interface StreamCommands
start
- minimum StreamEntryID
for the retrieved range, passing null
will
indicate minimum ID possible in the streamend
- maximum StreamEntryID
for the retrieved range, passing null
will
indicate maximum ID possible in the streampublic java.util.List<StreamEntry> xrange(java.lang.String key, StreamEntryID start, StreamEntryID end, int count)
StreamCommands
xrange
in interface StreamCommands
start
- minimum StreamEntryID
for the retrieved range, passing null
will
indicate minimum ID possible in the streamend
- maximum StreamEntryID
for the retrieved range, passing null
will
indicate maximum ID possible in the streamcount
- maximum number of entries returnedpublic java.util.List<StreamEntry> xrevrange(java.lang.String key, StreamEntryID end, StreamEntryID start)
StreamCommands
xrevrange
in interface StreamCommands
end
- maximum StreamEntryID
for the retrieved range, passing null
will
indicate maximum ID possible in the streamstart
- minimum StreamEntryID
for the retrieved range, passing null
will
indicate minimum ID possible in the streampublic java.util.List<StreamEntry> xrevrange(java.lang.String key, StreamEntryID end, StreamEntryID start, int count)
StreamCommands
xrevrange
in interface StreamCommands
end
- maximum StreamEntryID
for the retrieved range, passing null
will
indicate maximum ID possible in the streamstart
- minimum StreamEntryID
for the retrieved range, passing null
will
indicate minimum ID possible in the streamcount
- The entries with IDs matching the specified range.public java.util.List<StreamEntry> xrange(java.lang.String key, java.lang.String start, java.lang.String end)
xrange
in interface StreamCommands
public java.util.List<StreamEntry> xrange(java.lang.String key, java.lang.String start, java.lang.String end, int count)
xrange
in interface StreamCommands
public java.util.List<StreamEntry> xrevrange(java.lang.String key, java.lang.String end, java.lang.String start)
xrevrange
in interface StreamCommands
public java.util.List<StreamEntry> xrevrange(java.lang.String key, java.lang.String end, java.lang.String start, int count)
xrevrange
in interface StreamCommands
public java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> xread(XReadParams xReadParams, java.util.Map<java.lang.String,StreamEntryID> streams)
StreamCommands
xread
in interface StreamCommands
public long xack(java.lang.String key, java.lang.String group, StreamEntryID... ids)
StreamCommands
xack
in interface StreamCommands
public java.lang.String xgroupCreate(java.lang.String key, java.lang.String groupName, StreamEntryID id, boolean makeStream)
StreamCommands
XGROUP CREATE key groupName <id or $>
xgroupCreate
in interface StreamCommands
public java.lang.String xgroupSetID(java.lang.String key, java.lang.String groupName, StreamEntryID id)
StreamCommands
XGROUP SETID key groupName <id or $>
xgroupSetID
in interface StreamCommands
public long xgroupDestroy(java.lang.String key, java.lang.String groupName)
StreamCommands
xgroupDestroy
in interface StreamCommands
public boolean xgroupCreateConsumer(java.lang.String key, java.lang.String groupName, java.lang.String consumerName)
StreamCommands
xgroupCreateConsumer
in interface StreamCommands
public long xgroupDelConsumer(java.lang.String key, java.lang.String groupName, java.lang.String consumerName)
StreamCommands
xgroupDelConsumer
in interface StreamCommands
public long xdel(java.lang.String key, StreamEntryID... ids)
StreamCommands
xdel
in interface StreamCommands
public long xtrim(java.lang.String key, long maxLen, boolean approximateLength)
StreamCommands
xtrim
in interface StreamCommands
public long xtrim(java.lang.String key, XTrimParams params)
StreamCommands
xtrim
in interface StreamCommands
public java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> xreadGroup(java.lang.String groupName, java.lang.String consumer, XReadGroupParams xReadGroupParams, java.util.Map<java.lang.String,StreamEntryID> streams)
StreamCommands
xreadGroup
in interface StreamCommands
public StreamPendingSummary xpending(java.lang.String key, java.lang.String groupName)
StreamCommands
xpending
in interface StreamCommands
public java.util.List<StreamPendingEntry> xpending(java.lang.String key, java.lang.String groupName, XPendingParams params)
StreamCommands
xpending
in interface StreamCommands
public java.util.List<StreamEntry> xclaim(java.lang.String key, java.lang.String group, java.lang.String consumerName, long minIdleTime, XClaimParams params, StreamEntryID... ids)
StreamCommands
XCLAIM key group consumer min-idle-time <ID-1> ... <ID-N>
[IDLE <milliseconds>] [TIME <mstime>] [RETRYCOUNT <count>]
[FORCE]
xclaim
in interface StreamCommands
public java.util.List<StreamEntryID> xclaimJustId(java.lang.String key, java.lang.String group, java.lang.String consumerName, long minIdleTime, XClaimParams params, StreamEntryID... ids)
StreamCommands
XCLAIM key group consumer min-idle-time <ID-1> ... <ID-N>
[IDLE <milliseconds>] [TIME <mstime>] [RETRYCOUNT <count>]
[FORCE] JUSTID
xclaimJustId
in interface StreamCommands
public java.util.Map.Entry<StreamEntryID,java.util.List<StreamEntry>> xautoclaim(java.lang.String key, java.lang.String group, java.lang.String consumerName, long minIdleTime, StreamEntryID start, XAutoClaimParams params)
StreamCommands
xautoclaim
in interface StreamCommands
key
- Stream Keygroup
- Consumer GroupconsumerName
- Consumer name to transfer the auto claimed entriesminIdleTime
- Entries pending more than minIdleTime will be transferred ownershipstart
- StreamEntryID
- Entries ≥ start will be transferred ownership, passing
null
will indicate '-'params
- XAutoClaimParams
public java.util.Map.Entry<StreamEntryID,java.util.List<StreamEntryID>> xautoclaimJustId(java.lang.String key, java.lang.String group, java.lang.String consumerName, long minIdleTime, StreamEntryID start, XAutoClaimParams params)
StreamCommands
xautoclaimJustId
in interface StreamCommands
key
- Stream Keygroup
- Consumer GroupconsumerName
- Consumer name to transfer the auto claimed entriesminIdleTime
- Entries pending more than minIdleTime will be transferred ownershipstart
- StreamEntryID
- Entries ≥ start will be transferred ownership, passing
null
will indicate '-'params
- XAutoClaimParams
public StreamInfo xinfoStream(java.lang.String key)
StreamCommands
xinfoStream
in interface StreamCommands
key
- Stream nameStreamInfo
that contains information about the streampublic StreamFullInfo xinfoStreamFull(java.lang.String key)
StreamCommands
xinfoStreamFull
in interface StreamCommands
key
- Stream nameStreamFullInfo
that contains information about the streampublic StreamFullInfo xinfoStreamFull(java.lang.String key, int count)
StreamCommands
xinfoStreamFull
in interface StreamCommands
key
- Stream namecount
- stream info countStreamFullInfo
that contains information about the streampublic java.util.List<StreamGroupInfo> xinfoGroups(java.lang.String key)
StreamCommands
xinfoGroups
in interface StreamCommands
key
- Stream nameStreamGroupInfo
containing information about groupspublic java.util.List<StreamConsumersInfo> xinfoConsumers(java.lang.String key, java.lang.String group)
StreamCommands
xinfoConsumers
in interface StreamCommands
key
- Stream namegroup
- Group nameStreamConsumersInfo
containing information about consumers that belong
to the grouppublic java.util.List<StreamConsumerInfo> xinfoConsumers2(java.lang.String key, java.lang.String group)
StreamCommands
xinfoConsumers2
in interface StreamCommands
key
- Stream namegroup
- Group nameStreamConsumerInfo
containing information about consumers that belong
to the grouppublic java.lang.Object fcall(byte[] name, java.util.List<byte[]> keys, java.util.List<byte[]> args)
FunctionBinaryCommands
fcall
in interface FunctionBinaryCommands
public java.lang.Object fcallReadonly(byte[] name, java.util.List<byte[]> keys, java.util.List<byte[]> args)
fcallReadonly
in interface FunctionBinaryCommands
public java.lang.String functionDelete(byte[] libraryName)
FunctionBinaryCommands
functionDelete
in interface FunctionBinaryCommands
public byte[] functionDump()
FunctionCommands
FUNCTION RESTORE
command.functionDump
in interface FunctionBinaryCommands
functionDump
in interface FunctionCommands
public java.util.List<java.lang.Object> functionListBinary()
FunctionBinaryCommands
functionListBinary
in interface FunctionBinaryCommands
LibraryInfo
public java.util.List<java.lang.Object> functionList(byte[] libraryNamePattern)
FunctionBinaryCommands
functionList
in interface FunctionBinaryCommands
libraryNamePattern
- a pattern for matching library namesLibraryInfo
public java.util.List<java.lang.Object> functionListWithCodeBinary()
FunctionBinaryCommands
FUNCTION LIST
but include the
libraries source implementation in the reply.functionListWithCodeBinary
in interface FunctionBinaryCommands
LibraryInfo
FunctionCommands.functionList()
public java.util.List<java.lang.Object> functionListWithCode(byte[] libraryNamePattern)
FunctionBinaryCommands
FUNCTION LIST
but include the
libraries source implementation in the reply.functionListWithCode
in interface FunctionBinaryCommands
libraryNamePattern
- a pattern for matching library namesLibraryInfo
FunctionBinaryCommands.functionList(byte[])
public java.lang.String functionLoad(byte[] functionCode)
FunctionBinaryCommands
The library payload must start with Shebang statement that provides a metadata about the
library (like the engine to use and the library name). Shebang format:
#!<engine name> name=<library name>
. Currently engine name must be lua.
functionLoad
in interface FunctionBinaryCommands
functionCode
- the source code.public java.lang.String functionLoadReplace(byte[] functionCode)
FunctionBinaryCommands
functionLoadReplace
in interface FunctionBinaryCommands
functionCode
- the source codepublic java.lang.String functionRestore(byte[] serializedValue)
FunctionCommands
functionRestore
in interface FunctionBinaryCommands
functionRestore
in interface FunctionCommands
serializedValue
- the serialized payloadpublic java.lang.String functionRestore(byte[] serializedValue, FunctionRestorePolicy policy)
FunctionCommands
functionRestore
in interface FunctionBinaryCommands
functionRestore
in interface FunctionCommands
serializedValue
- the serialized payloadpolicy
- can be FLUSH, APPEND or REPLACE
public java.lang.Object functionStatsBinary()
FunctionBinaryCommands
functionStatsBinary
in interface FunctionBinaryCommands
FunctionStats
public java.lang.Object sendCommand(ProtocolCommand cmd, java.lang.String... args)
public java.lang.Object sendBlockingCommand(ProtocolCommand cmd, java.lang.String... args)
Copyright © 2023. All rights reserved.