public class Jedis extends java.lang.Object implements ServerCommands, DatabaseCommands, JedisCommands, JedisBinaryCommands, ControlCommands, ControlBinaryCommands, ClusterCommands, ModuleCommands, GenericControlCommands, SentinelCommands, CommandCommands, 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)
Create a new Jedis with the provided URI and JedisClientConfig object.
|
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 {@link StringCommands#bitfield(String, String...)
|
long |
bitop(BitOP op,
byte[] destKey,
byte[]... srcKeys)
Bitop Command Perform a bitwise operation
between multiple keys and store the result in the destKey.
|
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 client connections based on certain selection parameters.
|
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.
|
TrackingInfo |
clientTrackingInfo() |
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<ClusterShardInfo> |
clusterShards()
CLUSTER SHARDS returns details about the shards of the cluster. |
java.util.List<java.lang.String> |
clusterSlaves(java.lang.String nodeId)
Deprecated.
|
java.util.List<java.lang.Object> |
clusterSlots()
Deprecated.
|
java.util.Map<java.lang.String,CommandInfo> |
command()
Return an array with details about every Redis command.
|
long |
commandCount()
The number of total commands in this Redis server
|
java.util.Map<java.lang.String,CommandDocument> |
commandDocs(java.lang.String... commands)
Return documentary information about commands.
|
java.util.List<java.lang.String> |
commandGetKeys(java.lang.String... command)
Return list of keys from a full Redis command
|
java.util.List<KeyValue<java.lang.String,java.util.List<java.lang.String>>> |
commandGetKeysAndFlags(java.lang.String... command)
Return list of keys from a full Redis command and their usage flags
|
java.util.Map<java.lang.String,CommandInfo> |
commandInfo(java.lang.String... commands)
Return details about multiple Redis commands
|
java.util.List<java.lang.String> |
commandList()
Return a list of the server's command names
|
java.util.List<java.lang.String> |
commandListFilterBy(CommandListFilterByParams filterByParams)
Return a list of the server's command names filtered by module's name, ACL category or pattern
|
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)
|
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
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. |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Readonly version of
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. |
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,
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. |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Readonly version of
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. |
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)
Deprecated.
|
java.lang.String |
getSet(java.lang.String key,
java.lang.String value)
Deprecated.
|
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.
|
java.util.List<java.lang.Long> |
hexpire(byte[] key,
long seconds,
byte[]... fields)
Set expiry for hash field using relative time to expire (seconds).
|
java.util.List<java.lang.Long> |
hexpire(byte[] key,
long seconds,
ExpiryOption condition,
byte[]... fields)
Set expiry for hash field using relative time to expire (seconds).
|
java.util.List<java.lang.Long> |
hexpire(java.lang.String key,
long seconds,
ExpiryOption condition,
java.lang.String... fields)
Set expiry for hash field using relative time to expire (seconds).
|
java.util.List<java.lang.Long> |
hexpire(java.lang.String key,
long seconds,
java.lang.String... fields)
Set expiry for hash field using relative time to expire (seconds).
|
java.util.List<java.lang.Long> |
hexpireAt(byte[] key,
long unixTimeSeconds,
byte[]... fields)
Set expiry for hash field using an absolute Unix timestamp (seconds).
|
java.util.List<java.lang.Long> |
hexpireAt(byte[] key,
long unixTimeSeconds,
ExpiryOption condition,
byte[]... fields)
Set expiry for hash field using an absolute Unix timestamp (seconds).
|
java.util.List<java.lang.Long> |
hexpireAt(java.lang.String key,
long unixTimeSeconds,
ExpiryOption condition,
java.lang.String... fields)
Set expiry for hash field using an absolute Unix timestamp (seconds).
|
java.util.List<java.lang.Long> |
hexpireAt(java.lang.String key,
long unixTimeSeconds,
java.lang.String... fields)
Set expiry for hash field using an absolute Unix timestamp (seconds).
|
java.util.List<java.lang.Long> |
hexpireTime(byte[] key,
byte[]... fields)
Returns the expiration time of a hash field as a Unix timestamp, in seconds.
|
java.util.List<java.lang.Long> |
hexpireTime(java.lang.String key,
java.lang.String... fields)
Returns the expiration time of a hash field as a Unix timestamp, in seconds.
|
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.
|
java.util.List<byte[]> |
hgetdel(byte[] key,
byte[]... fields)
Retrieves the values associated with the specified fields in the hash stored at the given key
and then deletes those fields from the hash.
|
java.util.List<java.lang.String> |
hgetdel(java.lang.String key,
java.lang.String... fields)
Retrieves the values associated with the specified fields in the hash stored at the given key
and then deletes those fields from the hash.
|
java.util.List<byte[]> |
hgetex(byte[] key,
HGetExParams params,
byte[]... fields)
Retrieves the values associated with the specified fields in a hash stored at the given key
and optionally sets their expiration.
|
java.util.List<java.lang.String> |
hgetex(java.lang.String key,
HGetExParams params,
java.lang.String... fields)
Retrieves the values associated with the specified fields in a hash stored at the given key
and optionally sets their expiration.
|
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.
|
java.util.List<java.lang.Long> |
hpersist(byte[] key,
byte[]... fields)
Removes the expiration time for each specified field.
|
java.util.List<java.lang.Long> |
hpersist(java.lang.String key,
java.lang.String... fields)
Removes the expiration time for each specified field.
|
java.util.List<java.lang.Long> |
hpexpire(byte[] key,
long milliseconds,
byte[]... fields)
Set expiry for hash field using relative time to expire (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpire(byte[] key,
long milliseconds,
ExpiryOption condition,
byte[]... fields)
Set expiry for hash field using relative time to expire (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpire(java.lang.String key,
long milliseconds,
ExpiryOption condition,
java.lang.String... fields)
Set expiry for hash field using relative time to expire (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpire(java.lang.String key,
long milliseconds,
java.lang.String... fields)
Set expiry for hash field using relative time to expire (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpireAt(byte[] key,
long unixTimeMillis,
byte[]... fields)
Set expiry for hash field using an absolute Unix timestamp (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpireAt(byte[] key,
long unixTimeMillis,
ExpiryOption condition,
byte[]... fields)
Set expiry for hash field using an absolute Unix timestamp (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpireAt(java.lang.String key,
long unixTimeMillis,
ExpiryOption condition,
java.lang.String... fields)
Set expiry for hash field using an absolute Unix timestamp (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpireAt(java.lang.String key,
long unixTimeMillis,
java.lang.String... fields)
Set expiry for hash field using an absolute Unix timestamp (milliseconds).
|
java.util.List<java.lang.Long> |
hpexpireTime(byte[] key,
byte[]... fields)
Returns the expiration time of a hash field as a Unix timestamp, in milliseconds.
|
java.util.List<java.lang.Long> |
hpexpireTime(java.lang.String key,
java.lang.String... fields)
Returns the expiration time of a hash field as a Unix timestamp, in milliseconds.
|
java.util.List<java.lang.Long> |
hpttl(byte[] key,
byte[]... fields)
Returns the TTL in milliseconds of a hash field.
|
java.util.List<java.lang.Long> |
hpttl(java.lang.String key,
java.lang.String... fields)
Returns the TTL in milliseconds of a hash field.
|
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,
ScanParams params) |
ScanResult<java.util.Map.Entry<java.lang.String,java.lang.String>> |
hscan(java.lang.String key,
java.lang.String cursor,
ScanParams params) |
ScanResult<byte[]> |
hscanNoValues(byte[] key,
byte[] cursor,
ScanParams params) |
ScanResult<java.lang.String> |
hscanNoValues(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 |
hsetex(byte[] key,
HSetExParams params,
byte[] field,
byte[] value)
Sets the specified fields in the hash stored at key to the specified values with additional parameters,
and optionally set their expiration.
|
long |
hsetex(byte[] key,
HSetExParams params,
java.util.Map<byte[],byte[]> hash)
Sets the specified fields in the hash stored at key to the specified values with additional parameters,
and optionally set their expiration.
|
long |
hsetex(java.lang.String key,
HSetExParams params,
java.util.Map<java.lang.String,java.lang.String> hash)
Sets the specified fields in the hash stored at key to the specified values with additional parameters,
and optionally set their expiration.
|
long |
hsetex(java.lang.String key,
HSetExParams params,
java.lang.String field,
java.lang.String value)
Sets the specified fields in the hash stored at key to the specified values with additional parameters,
and optionally set their expiration.
|
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<java.lang.Long> |
httl(byte[] key,
byte[]... fields)
Returns the TTL in seconds of a hash field.
|
java.util.List<java.lang.Long> |
httl(java.lang.String key,
java.lang.String... fields)
Returns the TTL in seconds of a hash 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
INCRBYFLOAT commands are limited to double precision floating point values.
|
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.
|
java.util.List<LatencyHistoryInfo> |
latencyHistory(LatencyEvent event) |
java.util.Map<java.lang.String,LatencyLatestInfo> |
latencyLatest() |
long |
latencyReset(LatencyEvent... events) |
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. 0 is the first element, 1
the second and so on.
|
java.lang.String |
lindex(java.lang.String key,
long index)
Return the specified element of the list stored at the specified key. 0 is the first element, 1
the second and so on.
|
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 {@link DatabaseCommands#migrate(String, int, int, int, MigrateParams, String...)
|
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.
|
java.lang.String |
reset() |
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
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.
|
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
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.
|
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 {@link Jedis#sdiff(String...)
|
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 {@link Jedis#sinter(String...)
|
long |
sintercard(java.lang.String... keys)
This command works exactly like {@link Jedis#sinter(String...)
|
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 {@link Jedis#sinter(String...)
|
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 {@link Jedis#sunion(String...)
|
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() |
boolean |
vadd(byte[] key,
float[] vector,
byte[] element)
VADD Command Add a new element
into the vector set specified by key.
|
boolean |
vadd(byte[] key,
float[] vector,
byte[] element,
int reduceDim,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key with dimension reduction and additional parameters.
|
boolean |
vadd(byte[] key,
float[] vector,
byte[] element,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key with additional parameters.
|
boolean |
vadd(java.lang.String key,
float[] vector,
java.lang.String element)
VADD Command Add a new element
into the vector set specified by key.
|
boolean |
vadd(java.lang.String key,
float[] vector,
java.lang.String element,
int reduceDim,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key with dimension reduction and additional parameters.
|
boolean |
vadd(java.lang.String key,
float[] vector,
java.lang.String element,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key with additional parameters.
|
boolean |
vaddFP32(byte[] key,
byte[] vectorBlob,
byte[] element)
VADD Command Add a new element
into the vector set specified by key using FP32 binary format.
|
boolean |
vaddFP32(byte[] key,
byte[] vectorBlob,
byte[] element,
int reduceDim,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key using FP32 binary format with dimension reduction and
additional parameters.
|
boolean |
vaddFP32(byte[] key,
byte[] vectorBlob,
byte[] element,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key using FP32 binary format with additional parameters.
|
boolean |
vaddFP32(java.lang.String key,
byte[] vectorBlob,
java.lang.String element)
VADD Command Add a new element
into the vector set specified by key using FP32 binary format.
|
boolean |
vaddFP32(java.lang.String key,
byte[] vectorBlob,
java.lang.String element,
int reduceDim,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key using FP32 binary format with dimension reduction and
additional parameters.
|
boolean |
vaddFP32(java.lang.String key,
byte[] vectorBlob,
java.lang.String element,
VAddParams params)
VADD Command Add a new element
into the vector set specified by key using FP32 binary format with additional parameters.
|
long |
vcard(byte[] key)
VCARD Command Return the
number of elements in the specified vector set.
|
long |
vcard(java.lang.String key)
VCARD Command Return the
number of elements in the specified vector set.
|
long |
vdim(byte[] key)
VDIM Command Return the number
of dimensions of the vectors in the specified vector set.
|
long |
vdim(java.lang.String key)
VDIM Command Return the number
of dimensions of the vectors in the specified vector set.
|
java.util.List<java.lang.Double> |
vemb(byte[] key,
byte[] element)
VEMB Command Return the
approximate vector associated with a given element in the vector set.
|
java.util.List<java.lang.Double> |
vemb(java.lang.String key,
java.lang.String element)
VEMB Command Return the
approximate vector associated with a given element in the vector set.
|
RawVector |
vembRaw(byte[] key,
byte[] element)
VEMB Command Return the raw
vector data associated with a given element in the vector set.
|
RawVector |
vembRaw(java.lang.String key,
java.lang.String element)
VEMB Command Return the raw
vector data associated with a given element in the vector set.
|
byte[] |
vgetattr(byte[] key,
byte[] element)
VGETATTR Command Get the
attributes of an element in a vector set.
|
java.lang.String |
vgetattr(java.lang.String key,
java.lang.String element)
VGETATTR Command Get the
attributes of an element in a vector set.
|
VectorInfo |
vinfo(java.lang.String key)
VINFO Command Get information
about a vector set.
|
java.util.List<java.util.List<byte[]>> |
vlinks(byte[] key,
byte[] element)
VLINKS Command Return the
neighbors of a specified element in a vector set.
|
java.util.List<java.util.List<java.lang.String>> |
vlinks(java.lang.String key,
java.lang.String element)
VLINKS Command Return the
neighbors of a specified element in a vector set.
|
java.util.List<java.util.Map<byte[],java.lang.Double>> |
vlinksWithScores(byte[] key,
byte[] element)
VLINKS Command Return the
neighbors of a specified element in a vector set with similarity scores.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Double>> |
vlinksWithScores(java.lang.String key,
java.lang.String element)
VLINKS Command Return the
neighbors of a specified element in a vector set with similarity scores.
|
byte[] |
vrandmember(byte[] key)
VRANDMEMBER Command
Return a random element from a vector set.
|
java.util.List<byte[]> |
vrandmember(byte[] key,
int count)
VRANDMEMBER Command
Return random elements from a vector set.
|
java.lang.String |
vrandmember(java.lang.String key)
VRANDMEMBER Command
Return a random element from a vector set.
|
java.util.List<java.lang.String> |
vrandmember(java.lang.String key,
int count)
VRANDMEMBER Command
Return random elements from a vector set.
|
boolean |
vrem(byte[] key,
byte[] element)
VREM Command Remove an element
from a vector set.
|
boolean |
vrem(java.lang.String key,
java.lang.String element)
VREM Command Remove an element
from a vector set.
|
boolean |
vsetattr(byte[] key,
byte[] element,
byte[] attributes)
VSETATTR Command Set the
attributes of an element in a vector set.
|
boolean |
vsetattr(java.lang.String key,
java.lang.String element,
java.lang.String attributes)
VSETATTR Command Set the
attributes of an element in a vector set.
|
java.util.List<byte[]> |
vsim(byte[] key,
float[] vector)
VSIM Command Return elements
similar to a given vector.
|
java.util.List<byte[]> |
vsim(byte[] key,
float[] vector,
VSimParams params)
VSIM Command Return elements
similar to a given vector with additional parameters.
|
java.util.List<java.lang.String> |
vsim(java.lang.String key,
float[] vector)
VSIM Command Return elements
similar to a given vector.
|
java.util.List<java.lang.String> |
vsim(java.lang.String key,
float[] vector,
VSimParams params)
VSIM Command Return elements
similar to a given vector with additional parameters.
|
java.util.List<byte[]> |
vsimByElement(byte[] key,
byte[] element)
VSIM Command Return elements
similar to a given element in the vector set.
|
java.util.List<byte[]> |
vsimByElement(byte[] key,
byte[] element,
VSimParams params)
VSIM Command Return elements
similar to a given element in the vector set with additional parameters.
|
java.util.List<java.lang.String> |
vsimByElement(java.lang.String key,
java.lang.String element)
VSIM Command Return elements
similar to a given element in the vector set.
|
java.util.List<java.lang.String> |
vsimByElement(java.lang.String key,
java.lang.String element,
VSimParams params)
VSIM Command Return elements
similar to a given element in the vector set with additional parameters.
|
java.util.Map<byte[],java.lang.Double> |
vsimByElementWithScores(byte[] key,
byte[] element,
VSimParams params)
VSIM Command Return elements
similar to a given element in the vector set with their similarity scores.
|
java.util.Map<java.lang.String,java.lang.Double> |
vsimByElementWithScores(java.lang.String key,
java.lang.String element,
VSimParams params)
VSIM Command Return elements
similar to a given element in the vector set with their similarity scores.
|
java.util.Map<byte[],VSimScoreAttribs> |
vsimByElementWithScoresAndAttribs(byte[] key,
byte[] element,
VSimParams params)
VSIM Command Return elements
similar to a given element in the vector set with their similarity scores and attributes.
|
java.util.Map<java.lang.String,VSimScoreAttribs> |
vsimByElementWithScoresAndAttribs(java.lang.String key,
java.lang.String element,
VSimParams params)
VSIM Command Return elements
similar to a given element in the vector set with their similarity scores and attributes.
|
java.util.Map<byte[],java.lang.Double> |
vsimWithScores(byte[] key,
float[] vector,
VSimParams params)
VSIM Command Return elements
similar to a given vector with their similarity scores.
|
java.util.Map<java.lang.String,java.lang.Double> |
vsimWithScores(java.lang.String key,
float[] vector,
VSimParams params)
VSIM Command Return elements
similar to a given vector with their similarity scores.
|
java.util.Map<byte[],VSimScoreAttribs> |
vsimWithScoresAndAttribs(byte[] key,
float[] vector,
VSimParams params)
VSIM Command Return elements
similar to a given vector with their similarity scores and attributes.
|
java.util.Map<java.lang.String,VSimScoreAttribs> |
vsimWithScoresAndAttribs(java.lang.String key,
float[] vector,
VSimParams params)
VSIM Command Return elements
similar to a given vector with their similarity scores and attributes.
|
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 ...]
|
java.util.List<StreamEntryDeletionResult> |
xackdel(byte[] key,
byte[] group,
byte[]... ids)
XACKDEL key group [KEEPREF | DELREF | ACKED] IDS numids id [id ...]
|
java.util.List<StreamEntryDeletionResult> |
xackdel(byte[] key,
byte[] group,
StreamDeletionPolicy trimMode,
byte[]... ids)
XACKDEL key group [KEEPREF | DELREF | ACKED] IDS numids id [id ...]
|
java.util.List<StreamEntryDeletionResult> |
xackdel(java.lang.String key,
java.lang.String group,
StreamDeletionPolicy trimMode,
StreamEntryID... ids)
XACKDEL key group [KEEPREF | DELREF | ACKED] IDS numids id [id ...]
|
java.util.List<StreamEntryDeletionResult> |
xackdel(java.lang.String key,
java.lang.String group,
StreamEntryID... ids)
XACKDEL key group [KEEPREF | DELREF | ACKED] IDS numids 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.util.List<StreamEntryDeletionResult> |
xdelex(byte[] key,
byte[]... ids)
XDELEX key [KEEPREF | DELREF | ACKED] IDS numids id [id ...]
|
java.util.List<StreamEntryDeletionResult> |
xdelex(byte[] key,
StreamDeletionPolicy trimMode,
byte[]... ids)
XDELEX key [KEEPREF | DELREF | ACKED] IDS numids id [id ...]
|
java.util.List<StreamEntryDeletionResult> |
xdelex(java.lang.String key,
StreamDeletionPolicy trimMode,
StreamEntryID... ids)
XDELEX key [KEEPREF | DELREF | ACKED] IDS numids id [id ...]
|
java.util.List<StreamEntryDeletionResult> |
xdelex(java.lang.String key,
StreamEntryID... ids)
XDELEX key [KEEPREF | DELREF | ACKED] IDS numids 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)
Deprecated.
As of Jedis 6.1.0, use
xreadBinary(XReadParams, Map) or
xreadBinaryAsMap(XReadParams, Map) for type safety and better stream entry
parsing. |
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 ...]
|
java.util.Map<java.lang.String,java.util.List<StreamEntry>> |
xreadAsMap(XReadParams xReadParams,
java.util.Map<java.lang.String,StreamEntryID> streams)
XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...]
|
java.util.List<java.util.Map.Entry<byte[],java.util.List<StreamEntryBinary>>> |
xreadBinary(XReadParams xReadParams,
java.util.Map<byte[],StreamEntryID> streams)
Read from one or more streams.
|
java.util.Map<byte[],java.util.List<StreamEntryBinary>> |
xreadBinaryAsMap(XReadParams xReadParams,
java.util.Map<byte[],StreamEntryID> streams)
Read from one or more streams and return a map of stream name to list of entries.
|
java.util.List<java.lang.Object> |
xreadGroup(byte[] groupName,
byte[] consumer,
XReadGroupParams xReadGroupParams,
java.util.Map.Entry<byte[],byte[]>... streams)
Deprecated.
As of Jedis 6.1.0, use
xreadGroupBinary(byte[], byte[], XReadGroupParams, Map) or
xreadGroupBinaryAsMap(byte[], byte[], XReadGroupParams, Map) instead. |
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)
XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] [NOACK] STREAMS key [key ...] id [id ...]
|
java.util.Map<java.lang.String,java.util.List<StreamEntry>> |
xreadGroupAsMap(java.lang.String groupName,
java.lang.String consumer,
XReadGroupParams xReadGroupParams,
java.util.Map<java.lang.String,StreamEntryID> streams)
XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] [NOACK] STREAMS key [key ...] id [id ...]
|
java.util.List<java.util.Map.Entry<byte[],java.util.List<StreamEntryBinary>>> |
xreadGroupBinary(byte[] groupName,
byte[] consumer,
XReadGroupParams xReadGroupParams,
java.util.Map<byte[],StreamEntryID> streams)
Read from one or more streams as a consumer group.
|
java.util.Map<byte[],java.util.List<StreamEntryBinary>> |
xreadGroupBinaryAsMap(byte[] groupName,
byte[] consumer,
XReadGroupParams xReadGroupParams,
java.util.Map<byte[],StreamEntryID> streams)
Read from one or more streams as a consumer group and return a map of stream name to list of
entries.
|
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 {@link SortedSetCommands#zinter(ZParams, String...)
|
long |
zintercard(java.lang.String... keys)
Similar to {@link SortedSetCommands#zinter(ZParams, String...)
|
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, waitshutdownhscan, hscanNoValuessscanzscanxaddhscan, hscanNoValuesxaddprotected 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)
uri - The URI to connect toconfig - The JedisClientConfig object to usepublic Jedis(JedisSocketFactory jedisSocketFactory)
public Jedis(JedisSocketFactory jedisSocketFactory, JedisClientConfig clientConfig)
public Jedis(Connection connection)
public java.lang.String toString()
toString in class java.lang.Objectpublic 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.Closeableclose in interface java.lang.AutoCloseablepublic Transaction multi()
public Pipeline pipelined()
protected void checkIsInMultiOrPipeline()
public int getDB()
public java.lang.String ping()
ServerCommandsping in interface ServerCommandsPONGpublic byte[] ping(byte[] message)
ping() but returns argument message instead of PONG.message - public java.lang.String select(int index)
select in interface DatabaseCommandsindex - public java.lang.String swapDB(int index1,
int index2)
DatabaseCommandsswapDB in interface DatabaseCommandspublic java.lang.String flushDB()
flushDB in interface DatabaseCommandsflushDB in interface ServerCommandspublic java.lang.String flushDB(FlushMode flushMode)
flushDB in interface DatabaseCommandsflushDB in interface ServerCommandsflushMode - public java.lang.String flushAll()
flushAll in interface ServerCommandspublic java.lang.String flushAll(FlushMode flushMode)
flushAll in interface ServerCommandsflushMode - public boolean copy(byte[] srcKey,
byte[] dstKey,
int db,
boolean replace)
copy in interface DatabaseCommandssrcKey - 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 KeyBinaryCommandssrcKey - the source key.dstKey - the destination key.replace - public java.lang.String set(byte[] key,
byte[] value)
Time complexity: O(1)
set in interface StringBinaryCommandskey - value - public java.lang.String set(byte[] key,
byte[] value,
SetParams params)
set in interface StringBinaryCommandskey - 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 StringBinaryCommandskey - public byte[] setGet(byte[] key,
byte[] value)
setGet in interface StringBinaryCommandspublic byte[] setGet(byte[] key,
byte[] value,
SetParams params)
setGet in interface StringBinaryCommandspublic byte[] getDel(byte[] key)
Time complexity: O(1)
getDel in interface StringBinaryCommandskey - public byte[] getEx(byte[] key,
GetExParams params)
getEx in interface StringBinaryCommandspublic long exists(byte[]... keys)
exists in interface KeyBinaryCommandskeys - public boolean exists(byte[] key)
exists in interface KeyBinaryCommandskey - true if the key exists, otherwise falsepublic long del(byte[]... keys)
del in interface KeyBinaryCommandskeys - public long del(byte[] key)
del in interface KeyBinaryCommandspublic 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 KeyBinaryCommandskeys - public long unlink(byte[] key)
unlink in interface KeyBinaryCommandspublic java.lang.String type(byte[] key)
type in interface KeyBinaryCommandskey - 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 KeyBinaryCommandspattern - public byte[] randomBinaryKey()
Time complexity: O(1)
randomBinaryKey in interface KeyBinaryCommandspublic java.lang.String rename(byte[] oldkey,
byte[] newkey)
Time complexity: O(1)
rename in interface KeyBinaryCommandsoldkey - newkey - public long renamenx(byte[] oldkey,
byte[] newkey)
Time complexity: O(1)
renamenx in interface KeyBinaryCommandsoldkey - newkey - public long dbSize()
dbSize in interface DatabaseCommandspublic 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 KeyBinaryCommandskey - seconds - public long expire(byte[] key,
long seconds,
ExpiryOption expiryOption)
expire in interface KeyBinaryCommandspublic 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 KeyBinaryCommandskey - milliseconds - public long pexpire(byte[] key,
long milliseconds,
ExpiryOption expiryOption)
pexpire in interface KeyBinaryCommandspublic long expireTime(byte[] key)
expireTime in interface KeyBinaryCommandspublic long pexpireTime(byte[] key)
pexpireTime in interface KeyBinaryCommandspublic 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 KeyBinaryCommandskey - unixTime - public long expireAt(byte[] key,
long unixTime,
ExpiryOption expiryOption)
expireAt in interface KeyBinaryCommandspublic long pexpireAt(byte[] key,
long millisecondsTimestamp)
pexpireAt in interface KeyBinaryCommandspublic long pexpireAt(byte[] key,
long millisecondsTimestamp,
ExpiryOption expiryOption)
pexpireAt in interface KeyBinaryCommandspublic 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 KeyBinaryCommandskey - public long touch(byte[]... keys)
touch in interface KeyBinaryCommandskeys - public long touch(byte[] key)
touch in interface KeyBinaryCommandspublic long move(byte[] key,
int dbIndex)
move in interface DatabaseCommandskey - dbIndex - DatabaseCommands.move(String, int)@Deprecated
public byte[] getSet(byte[] key,
byte[] value)
setGet(byte[], byte[]).Time complexity: O(1)
getSet in interface StringBinaryCommandskey - value - public java.util.List<byte[]> mget(byte[]... keys)
Time complexity: O(1) for every key
mget in interface StringBinaryCommandskeys - 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 StringBinaryCommandskey - 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 StringBinaryCommandskey - 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 StringBinaryCommandskeysvalues - 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 StringBinaryCommandskeysvalues - 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 StringBinaryCommandskey - 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 StringBinaryCommandskey - 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 StringBinaryCommandskey - 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 StringBinaryCommandskey - 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 StringBinaryCommandskey - 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 StringBinaryCommandskey - 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 StringBinaryCommandskey - 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 HashBinaryCommandskey - field - value - public long hset(byte[] key,
java.util.Map<byte[],byte[]> hash)
hset in interface HashBinaryCommandspublic long hsetex(byte[] key,
HSetExParams params,
byte[] field,
byte[] value)
HashBinaryCommandshsetex in interface HashBinaryCommandskey - the key of the hashparams - the parameters for the HSETEX commandfield - the field in the hashvalue - the value to setHSetExParamspublic long hsetex(byte[] key,
HSetExParams params,
java.util.Map<byte[],byte[]> hash)
HashBinaryCommandshsetex in interface HashBinaryCommandskey - the key of the hashparams - the parameters for the HSETEX commandhash - the map containing field-value pairs to set in the hashHSetExParamspublic 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 HashBinaryCommandskey - field - public java.util.List<byte[]> hgetex(byte[] key,
HGetExParams params,
byte[]... fields)
HashBinaryCommandshgetex in interface HashBinaryCommandskey - the key of the hashparams - additional parameters for the HGETEX commandfields - the fields whose values are to be retrievedHGetExParamspublic java.util.List<byte[]> hgetdel(byte[] key,
byte[]... fields)
HashBinaryCommandshgetdel in interface HashBinaryCommandskey - the key of the hashfields - the fields whose values are to be retrieved and then deletedpublic long hsetnx(byte[] key,
byte[] field,
byte[] value)
hsetnx in interface HashBinaryCommandskey - 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 HashBinaryCommandskey - 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 HashBinaryCommandskey - 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 HashBinaryCommandskey - 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 HashBinaryCommandskey - field - value - public boolean hexists(byte[] key,
byte[] field)
hexists in interface HashBinaryCommandskey - 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 HashBinaryCommandskey - fields - public long hlen(byte[] key)
Time complexity: O(1)
hlen in interface HashBinaryCommandskey - public java.util.Set<byte[]> hkeys(byte[] key)
Time complexity: O(N), where N is the total number of entries
hkeys in interface HashBinaryCommandskey - public java.util.List<byte[]> hvals(byte[] key)
Time complexity: O(N), where N is the total number of entries
hvals in interface HashBinaryCommandskey - public java.util.Map<byte[],byte[]> hgetAll(byte[] key)
Time complexity: O(N), where N is the total number of entries
hgetAll in interface HashBinaryCommandskey - public byte[] hrandfield(byte[] key)
Time complexity: O(N), where N is the number of fields returned
hrandfield in interface HashBinaryCommandskey - 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 HashBinaryCommandskey - 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 HashBinaryCommandskey - public long rpush(byte[] key,
byte[]... strings)
Time complexity: O(1)
rpush in interface ListBinaryCommandskey - strings - public long lpush(byte[] key,
byte[]... strings)
Time complexity: O(1)
lpush in interface ListBinaryCommandskey - strings - public long llen(byte[] key)
Time complexity: O(1)
llen in interface ListBinaryCommandskey - 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - rpop(byte[])public java.util.List<byte[]> lpop(byte[] key,
int count)
lpop in interface ListBinaryCommandspublic 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - 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 ListBinaryCommandskey - lpop(byte[])public java.util.List<byte[]> rpop(byte[] key,
int count)
rpop in interface ListBinaryCommandspublic 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 ListBinaryCommandssrckey - dstkey - public long sadd(byte[] key,
byte[]... members)
Time complexity O(1)
sadd in interface SetBinaryCommandskey - members - public java.util.Set<byte[]> smembers(byte[] key)
sinter(byte[][]) SINTER}.
Time complexity O(N)
smembers in interface SetBinaryCommandskey - the key of the setpublic long srem(byte[] key,
byte[]... members)
Time complexity O(1)
srem in interface SetBinaryCommandskey - 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 SetBinaryCommandskey - public java.util.Set<byte[]> spop(byte[] key,
long count)
spop in interface SetBinaryCommandspublic 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 SetBinaryCommandssrckey - dstkey - member - public long scard(byte[] key)
scard in interface SetBinaryCommandskey - public boolean sismember(byte[] key,
byte[] member)
Time complexity O(1)
sismember in interface SetBinaryCommandskey - 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 SetBinaryCommandskey - 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 SetBinaryCommandskeys - 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 SetBinaryCommandsdstkey - 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 SetBinaryCommandskeys - 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 SetBinaryCommandslimit - 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 SetBinaryCommandskeys - 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 SetBinaryCommandsdstkey - 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 SetBinaryCommandskeys - public long sdiffstore(byte[] dstkey,
byte[]... keys)
SDIFF but instead of being returned
the resulting set is stored in dstkey.sdiffstore in interface SetBinaryCommandsdstkey - 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 SetBinaryCommandskey - public java.util.List<byte[]> srandmember(byte[] key,
int count)
srandmember in interface SetBinaryCommandspublic 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 SortedSetBinaryCommandskey - score - member - public long zadd(byte[] key,
double score,
byte[] member,
ZAddParams params)
zadd in interface SortedSetBinaryCommandspublic long zadd(byte[] key,
java.util.Map<byte[],java.lang.Double> scoreMembers)
zadd in interface SortedSetBinaryCommandspublic long zadd(byte[] key,
java.util.Map<byte[],java.lang.Double> scoreMembers,
ZAddParams params)
zadd in interface SortedSetBinaryCommandspublic java.lang.Double zaddIncr(byte[] key,
double score,
byte[] member,
ZAddParams params)
zaddIncr in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrange(byte[] key,
long start,
long stop)
zrange in interface SortedSetBinaryCommandspublic 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 SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandskey - increment - member - public java.lang.Double zincrby(byte[] key,
double increment,
byte[] member,
ZIncrByParams params)
zincrby in interface SortedSetBinaryCommandspublic 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 SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandskey - member - zrank(byte[], byte[])public KeyValue<java.lang.Long,java.lang.Double> zrankWithScore(byte[] key, byte[] member)
zrankWithScore in interface SortedSetBinaryCommandskey - the keymember - the memberpublic KeyValue<java.lang.Long,java.lang.Double> zrevrankWithScore(byte[] key, byte[] member)
zrevrankWithScore in interface SortedSetBinaryCommandskey - the keymember - the memberpublic java.util.List<byte[]> zrevrange(byte[] key,
long start,
long stop)
zrevrange in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrangeWithScores(byte[] key, long start, long stop)
zrangeWithScores in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrevrangeWithScores(byte[] key, long start, long stop)
zrevrangeWithScores in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrange(byte[] key,
ZRangeParams zRangeParams)
zrange in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrangeWithScores(byte[] key, ZRangeParams zRangeParams)
zrangeWithScores in interface SortedSetBinaryCommandspublic long zrangestore(byte[] dest,
byte[] src,
ZRangeParams zRangeParams)
zrangestore in interface SortedSetBinaryCommandspublic byte[] zrandmember(byte[] key)
zrandmember in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrandmember(byte[] key,
long count)
zrandmember in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrandmemberWithScores(byte[] key, long count)
zrandmemberWithScores in interface SortedSetBinaryCommandspublic long zcard(byte[] key)
Time complexity O(1)
zcard in interface SortedSetBinaryCommandskey - public java.lang.Double zscore(byte[] key,
byte[] member)
Time complexity: O(1)
zscore in interface SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandskey - members - public Tuple zpopmax(byte[] key)
zpopmax in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zpopmax(byte[] key, int count)
zpopmax in interface SortedSetBinaryCommandspublic Tuple zpopmin(byte[] key)
zpopmin in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zpopmin(byte[] key, int count)
zpopmin in interface SortedSetBinaryCommandspublic 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 KeyBinaryCommandskey - 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 KeyBinaryCommandskey - sortingParams - sort(byte[]),
sort(byte[], SortingParams, byte[])public long sort(byte[] key,
SortingParams sortingParams,
byte[] dstkey)
sort in interface KeyBinaryCommandskey - 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 KeyBinaryCommandskey - dstkey - sort(byte[]),
sort(byte[], SortingParams),
sort(byte[], SortingParams, byte[])public java.util.List<byte[]> sortReadonly(byte[] key,
SortingParams sortingParams)
sortReadonly in interface KeyBinaryCommandspublic byte[] lmove(byte[] srcKey,
byte[] dstKey,
ListDirection from,
ListDirection to)
lmove in interface ListBinaryCommandssrcKey - dstKey - from - to - public byte[] blmove(byte[] srcKey,
byte[] dstKey,
ListDirection from,
ListDirection to,
double timeout)
blmove in interface ListBinaryCommandssrcKey - 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 ListBinaryCommandstimeout - 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 ListBinaryCommandspublic 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 ListBinaryCommandstimeout - 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 ListBinaryCommandspublic KeyValue<byte[],java.util.List<byte[]>> lmpop(ListDirection direction, byte[]... keys)
lmpop in interface ListBinaryCommandspublic KeyValue<byte[],java.util.List<byte[]>> lmpop(ListDirection direction, int count, byte[]... keys)
lmpop in interface ListBinaryCommandspublic KeyValue<byte[],java.util.List<byte[]>> blmpop(double timeout, ListDirection direction, byte[]... keys)
blmpop in interface ListBinaryCommandspublic KeyValue<byte[],java.util.List<byte[]>> blmpop(double timeout, ListDirection direction, int count, byte[]... keys)
blmpop in interface ListBinaryCommandspublic KeyValue<byte[],Tuple> bzpopmax(double timeout, byte[]... keys)
bzpopmax in interface SortedSetBinaryCommandspublic KeyValue<byte[],Tuple> bzpopmin(double timeout, byte[]... keys)
bzpopmin in interface SortedSetBinaryCommandspublic java.lang.String auth(java.lang.String password)
auth in interface ServerCommandspassword - public java.lang.String auth(java.lang.String user,
java.lang.String password)
auth in interface ServerCommandsuser - password - public long zcount(byte[] key,
double min,
double max)
zcount in interface SortedSetBinaryCommandspublic long zcount(byte[] key,
byte[] min,
byte[] max)
zcount in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zdiff(byte[]... keys)
zdiff in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zdiffWithScores(byte[]... keys)
zdiffWithScores in interface SortedSetBinaryCommands@Deprecated
public long zdiffStore(byte[] dstkey,
byte[]... keys)
zdiffStore in interface SortedSetBinaryCommandspublic long zdiffstore(byte[] dstkey,
byte[]... keys)
zdiffstore in interface SortedSetBinaryCommandspublic 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 SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandspublic 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 SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandspublic 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 SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandspublic 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 SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandspublic java.util.List<byte[]> zrevrangeByScore(byte[] key,
double max,
double min)
zrevrangeByScore in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrevrangeByScore(byte[] key,
byte[] max,
byte[] min)
zrevrangeByScore in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrevrangeByScore(byte[] key,
double max,
double min,
int offset,
int count)
zrevrangeByScore in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrevrangeByScore(byte[] key,
byte[] max,
byte[] min,
int offset,
int count)
zrevrangeByScore in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, double max, double min)
zrevrangeByScoreWithScores in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, double max, double min, int offset, int count)
zrevrangeByScoreWithScores in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min)
zrevrangeByScoreWithScores in interface SortedSetBinaryCommandspublic java.util.List<Tuple> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min, int offset, int count)
zrevrangeByScoreWithScores in interface SortedSetBinaryCommandspublic 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 SortedSetBinaryCommandskey - 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 SortedSetBinaryCommandskey - min - max - public long zremrangeByScore(byte[] key,
byte[] min,
byte[] max)
zremrangeByScore in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zunion(ZParams params, byte[]... keys)
zunion in interface SortedSetBinaryCommandsparams - keys - public java.util.List<Tuple> zunionWithScores(ZParams params, byte[]... keys)
zunionWithScores in interface SortedSetBinaryCommandsparams - 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 SortedSetBinaryCommandsdstkey - 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 SortedSetBinaryCommandsdstkey - sets - params - public java.util.List<byte[]> zinter(ZParams params, byte[]... keys)
zinter in interface SortedSetBinaryCommandsparams - keys - public java.util.List<Tuple> zinterWithScores(ZParams params, byte[]... keys)
zinterWithScores in interface SortedSetBinaryCommandsparams - 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 SortedSetBinaryCommandsdstkey - 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 SortedSetBinaryCommandsdstkey - sets - params - public long zintercard(byte[]... keys)
SortedSetBinaryCommandsZINTER, 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 SortedSetBinaryCommandskeys - group of setsSortedSetBinaryCommands.zinter(ZParams, byte[][])public long zintercard(long limit,
byte[]... keys)
SortedSetBinaryCommandsZINTER, 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 SortedSetBinaryCommandslimit - 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 SortedSetBinaryCommandspublic java.util.List<byte[]> zrangeByLex(byte[] key,
byte[] min,
byte[] max)
zrangeByLex in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrangeByLex(byte[] key,
byte[] min,
byte[] max,
int offset,
int count)
zrangeByLex in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrevrangeByLex(byte[] key,
byte[] max,
byte[] min)
zrevrangeByLex in interface SortedSetBinaryCommandspublic java.util.List<byte[]> zrevrangeByLex(byte[] key,
byte[] max,
byte[] min,
int offset,
int count)
zrevrangeByLex in interface SortedSetBinaryCommandspublic long zremrangeByLex(byte[] key,
byte[] min,
byte[] max)
zremrangeByLex in interface SortedSetBinaryCommandspublic KeyValue<byte[],java.util.List<Tuple>> zmpop(SortedSetOption option, byte[]... keys)
zmpop in interface SortedSetBinaryCommandspublic KeyValue<byte[],java.util.List<Tuple>> zmpop(SortedSetOption option, int count, byte[]... keys)
zmpop in interface SortedSetBinaryCommandspublic KeyValue<byte[],java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, byte[]... keys)
bzmpop in interface SortedSetBinaryCommandspublic KeyValue<byte[],java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, int count, byte[]... keys)
bzmpop in interface SortedSetBinaryCommandspublic 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 ServerCommandspublic 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 ServerCommandspublic java.lang.String bgsaveSchedule()
bgsaveSchedule in interface ServerCommandspublic 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 ServerCommandspublic 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 ServerCommandspublic 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 ServerCommandsJedisException - 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 ServerCommandsshutdownParams - set commands parametersJedisExceptionSaveModepublic java.lang.String shutdownAbort()
shutdownAbort in interface ServerCommandspublic 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
redis_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 ServerCommandspublic java.lang.String info(java.lang.String section)
ServerCommandsinfo in interface ServerCommandssection - (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 ServerCommandshost - port - @Deprecated public java.lang.String slaveofNoOne()
replicaofNoOne().ServerCommandsslaveofNoOne in interface ServerCommandspublic java.lang.String replicaof(java.lang.String host,
int port)
ServerCommandsreplicaof in interface ServerCommandshost - listening at the specified hostnameport - server listening at the specified portpublic java.lang.String replicaofNoOne()
ServerCommandsreplicaofNoOne in interface ServerCommandspublic java.util.List<java.lang.Object> roleBinary()
ControlBinaryCommandsroleBinary in interface ControlBinaryCommandspublic 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 ConfigCommandspattern - public java.util.Map<byte[],byte[]> configGet(byte[]... patterns)
ConfigCommandsconfigGet in interface ConfigCommandspatterns - names of Redis server's configurationpublic java.lang.String configResetStat()
configResetStat in interface ConfigCommandspublic 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 ConfigCommandspublic 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 ConfigCommandsparameter - value - public java.lang.String configSet(byte[]... parameterValues)
configSet in interface ConfigCommandspublic java.lang.String configSetBinary(java.util.Map<byte[],byte[]> parameterValues)
configSetBinary in interface ConfigCommandspublic long strlen(byte[] key)
strlen in interface StringBinaryCommandspublic LCSMatchResult lcs(byte[] keyA, byte[] keyB, LCSParams params)
StringBinaryCommandslcs in interface StringBinaryCommandspublic long lpushx(byte[] key,
byte[]... strings)
lpushx in interface ListBinaryCommandspublic long persist(byte[] key)
expire at turning the expire key into a normal key.
Time complexity: O(1)
persist in interface KeyBinaryCommandskey - public long rpushx(byte[] key,
byte[]... strings)
rpushx in interface ListBinaryCommandspublic byte[] echo(byte[] string)
echo in interface ServerCommandspublic long linsert(byte[] key,
ListPosition where,
byte[] pivot,
byte[] value)
linsert in interface ListBinaryCommandspublic byte[] brpoplpush(byte[] source,
byte[] destination,
int timeout)
brpoplpush in interface ListBinaryCommandspublic boolean setbit(byte[] key,
long offset,
boolean value)
setbit in interface BitBinaryCommandspublic boolean getbit(byte[] key,
long offset)
getbit in interface BitBinaryCommandspublic long bitpos(byte[] key,
boolean value)
bitpos in interface BitBinaryCommandspublic long bitpos(byte[] key,
boolean value,
BitPosParams params)
bitpos in interface BitBinaryCommandspublic long setrange(byte[] key,
long offset,
byte[] value)
setrange in interface StringBinaryCommandspublic byte[] getrange(byte[] key,
long startOffset,
long endOffset)
getrange in interface StringBinaryCommandspublic 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 ScriptingKeyBinaryCommandsscript - keys - args - public java.lang.Object evalReadonly(byte[] script,
java.util.List<byte[]> keys,
java.util.List<byte[]> args)
evalReadonly in interface ScriptingKeyBinaryCommandsprotected 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 ScriptingKeyBinaryCommandspublic java.lang.Object eval(byte[] script)
eval in interface ScriptingKeyBinaryCommandspublic java.lang.Object evalsha(byte[] sha1)
evalsha in interface ScriptingKeyBinaryCommandspublic java.lang.Object evalsha(byte[] sha1,
java.util.List<byte[]> keys,
java.util.List<byte[]> args)
evalsha in interface ScriptingKeyBinaryCommandspublic java.lang.Object evalshaReadonly(byte[] sha1,
java.util.List<byte[]> keys,
java.util.List<byte[]> args)
evalshaReadonly in interface ScriptingKeyBinaryCommandspublic java.lang.Object evalsha(byte[] sha1,
int keyCount,
byte[]... params)
evalsha in interface ScriptingKeyBinaryCommandspublic java.lang.String scriptFlush()
scriptFlush in interface ScriptingControlCommandspublic java.lang.String scriptFlush(FlushMode flushMode)
scriptFlush in interface ScriptingControlCommandspublic java.lang.Boolean scriptExists(byte[] sha1)
scriptExists in interface ScriptingControlCommandspublic java.util.List<java.lang.Boolean> scriptExists(byte[]... sha1)
scriptExists in interface ScriptingControlCommandspublic byte[] scriptLoad(byte[] script)
scriptLoad in interface ScriptingControlCommandspublic java.lang.String scriptKill()
scriptKill in interface ScriptingControlCommandspublic java.lang.String slowlogReset()
slowlogReset in interface SlowlogCommandspublic long slowlogLen()
slowlogLen in interface SlowlogCommandspublic java.util.List<java.lang.Object> slowlogGetBinary()
slowlogGetBinary in interface SlowlogCommandspublic java.util.List<java.lang.Object> slowlogGetBinary(long entries)
slowlogGetBinary in interface SlowlogCommandspublic java.lang.Long objectRefcount(byte[] key)
ControlBinaryCommandskey.objectRefcount in interface ControlBinaryCommandsobjectRefcount in interface KeyBinaryCommandskey - The key in Redis serverkeypublic byte[] objectEncoding(byte[] key)
ControlBinaryCommandskey.
See for details: OBJECT ENCODING key
objectEncoding in interface ControlBinaryCommandsobjectEncoding in interface KeyBinaryCommandskey - The key in Redis serverpublic java.lang.Long objectIdletime(byte[] key)
ControlBinaryCommandskey.
The command is only available when the maxmemory-policy configuration directive
is not set to one of the LFU policies.objectIdletime in interface ControlBinaryCommandsobjectIdletime in interface KeyBinaryCommandskey - The key in Redis serverpublic java.util.List<byte[]> objectHelpBinary()
ControlBinaryCommandsobjectHelpBinary in interface ControlBinaryCommandspublic java.lang.Long objectFreq(byte[] key)
ControlBinaryCommandskey.
The command is only available when the maxmemory-policy configuration directive is set to one of the LFU policies.
objectFreq in interface ControlBinaryCommandsobjectFreq in interface KeyBinaryCommandskey - The key in Redis serverpublic long bitcount(byte[] key)
bitcount in interface BitBinaryCommandspublic long bitcount(byte[] key,
long start,
long end)
bitcount in interface BitBinaryCommandspublic long bitcount(byte[] key,
long start,
long end,
BitCountOption option)
bitcount in interface BitBinaryCommandspublic long bitop(BitOP op, byte[] destKey, byte[]... srcKeys)
BitBinaryCommandsbitop in interface BitBinaryCommandsop - can be AND, OR, XOR, NOT, DIFF, DIFF1, ANDOR and ONEpublic byte[] dump(byte[] key)
dump in interface KeyBinaryCommandspublic java.lang.String restore(byte[] key,
long ttl,
byte[] serializedValue)
restore in interface KeyBinaryCommandspublic java.lang.String restore(byte[] key,
long ttl,
byte[] serializedValue,
RestoreParams params)
restore in interface KeyBinaryCommandspublic long pttl(byte[] key)
pttl in interface KeyBinaryCommandspublic 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 StringBinaryCommandskey - milliseconds - value - public byte[] memoryDoctorBinary()
ControlBinaryCommandsmemoryDoctorBinary in interface ControlBinaryCommandspublic java.lang.Long memoryUsage(byte[] key)
ControlBinaryCommandsSee for details: MEMORY USAGE key
memoryUsage in interface ControlBinaryCommandsmemoryUsage in interface KeyBinaryCommandskey - The key in Redis serverpublic java.lang.Long memoryUsage(byte[] key,
int samples)
ControlBinaryCommandsSee for details: MEMORY USAGE key SAMPLES count
memoryUsage in interface ControlBinaryCommandsmemoryUsage in interface KeyBinaryCommandskey - The key in Redis serverpublic java.lang.String failover()
failover in interface GenericControlCommandspublic java.lang.String failover(FailoverParams failoverParams)
failover in interface GenericControlCommandspublic java.lang.String failoverAbort()
failoverAbort in interface GenericControlCommandspublic byte[] aclWhoAmIBinary()
AccessControlLogBinaryCommandsaclWhoAmIBinary in interface AccessControlLogBinaryCommandspublic byte[] aclGenPassBinary()
AccessControlLogBinaryCommandsaclGenPassBinary in interface AccessControlLogBinaryCommandspublic byte[] aclGenPassBinary(int bits)
AccessControlLogBinaryCommandsaclGenPassBinary in interface AccessControlLogBinaryCommandsbits - the number of output bitspublic java.util.List<byte[]> aclListBinary()
AccessControlLogBinaryCommandsaclListBinary in interface AccessControlLogBinaryCommandspublic java.util.List<byte[]> aclUsersBinary()
AccessControlLogBinaryCommandsaclUsersBinary in interface AccessControlLogBinaryCommandspublic AccessControlUser aclGetUser(byte[] name)
AccessControlLogBinaryCommandsaclGetUser in interface AccessControlLogBinaryCommandsname - usernamepublic java.lang.String aclSetUser(byte[] name)
AccessControlLogBinaryCommandsaclSetUser in interface AccessControlLogBinaryCommandsname - user who receives an aclpublic java.lang.String aclSetUser(byte[] name,
byte[]... rules)
AccessControlLogBinaryCommandsaclSetUser in interface AccessControlLogBinaryCommandsname - user who receives an aclrules - the acl rules for the specified userpublic long aclDelUser(byte[]... names)
AccessControlLogBinaryCommandsaclDelUser in interface AccessControlLogBinaryCommandsnames - The username to deletepublic java.util.List<byte[]> aclCatBinary()
AccessControlLogBinaryCommandsaclCatBinary in interface AccessControlLogBinaryCommandspublic java.util.List<byte[]> aclCat(byte[] category)
AccessControlLogBinaryCommandsaclCat in interface AccessControlLogBinaryCommandscategory - The category for which to list available ACLspublic java.util.List<byte[]> aclLogBinary()
AccessControlLogBinaryCommandsaclLogBinary in interface AccessControlLogBinaryCommandspublic java.util.List<byte[]> aclLogBinary(int limit)
AccessControlLogBinaryCommandsaclLogBinary in interface AccessControlLogBinaryCommandslimit - The number of results to returnpublic java.lang.String aclLogReset()
AccessControlLogCommandsaclLogReset in interface AccessControlLogBinaryCommandsaclLogReset in interface AccessControlLogCommandspublic java.lang.String clientKill(byte[] ipPort)
ClientBinaryCommandsclientKill in interface ClientBinaryCommandsipPort - 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)
ClientCommandsclientKill in interface ClientBinaryCommandsclientKill in interface ClientCommandsip - 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)
ClientCommandsclientKill in interface ClientBinaryCommandsclientKill in interface ClientCommandsparams - Parameters defining what client connections to close.public byte[] clientGetnameBinary()
ClientBinaryCommandsclientGetnameBinary in interface ClientBinaryCommandspublic byte[] clientListBinary()
ClientBinaryCommandsclientListBinary in interface ClientBinaryCommandspublic byte[] clientListBinary(ClientType type)
ClientBinaryCommandsclientListBinary in interface ClientBinaryCommandspublic byte[] clientListBinary(long... clientIds)
ClientBinaryCommandsclientListBinary in interface ClientBinaryCommandsclientIds - Unique 64-bit client IDspublic byte[] clientInfoBinary()
ClientBinaryCommandsclientInfoBinary in interface ClientBinaryCommandspublic java.lang.String clientSetInfo(ClientAttributeOption attr, byte[] value)
ClientBinaryCommandsclientSetInfo in interface ClientBinaryCommandsattr - the attr optionvalue - the valuepublic java.lang.String clientSetname(byte[] name)
ClientBinaryCommandsclientSetname in interface ClientBinaryCommandsname - Current connection namepublic long clientId()
ClientCommandsclientId in interface ClientBinaryCommandsclientId in interface ClientCommandspublic long clientUnblock(long clientId)
clientUnblock in interface ClientBinaryCommandsclientUnblock in interface ClientCommandsclientId - public long clientUnblock(long clientId,
UnblockType unblockType)
clientUnblock in interface ClientBinaryCommandsclientUnblock in interface ClientCommandsclientId - unblockType - public java.lang.String clientPause(long timeout)
ClientCommandsclientPause in interface ClientBinaryCommandsclientPause in interface ClientCommandstimeout - WRITE|ALLpublic java.lang.String clientPause(long timeout,
ClientPauseMode mode)
ClientCommandsclientPause in interface ClientBinaryCommandsclientPause in interface ClientCommandstimeout - Command timeoutmode - WRITE|ALLpublic java.lang.String clientUnpause()
ClientCommandsclientUnpause in interface ClientBinaryCommandsclientUnpause in interface ClientCommandspublic java.lang.String clientNoEvictOn()
ClientCommandsclientNoEvictOn in interface ClientBinaryCommandsclientNoEvictOn in interface ClientCommandspublic java.lang.String clientNoEvictOff()
ClientCommandsclientNoEvictOff in interface ClientBinaryCommandsclientNoEvictOff in interface ClientCommandspublic java.lang.String clientNoTouchOn()
ClientCommandsclientNoTouchOn in interface ClientCommandspublic java.lang.String clientNoTouchOff()
ClientCommandsclientNoTouchOff in interface ClientCommandspublic TrackingInfo clientTrackingInfo()
clientTrackingInfo in interface ClientCommandspublic java.util.List<java.lang.String> time()
public java.lang.String migrate(java.lang.String host,
int port,
byte[] key,
int destinationDb,
int timeout)
DatabaseCommandsMIGRATE.migrate in interface DatabaseCommandsDatabaseCommands.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)
DatabaseCommandsMIGRATE.migrate in interface DatabaseCommandsDatabaseCommands.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 KeyBinaryCommandspublic java.lang.String migrate(java.lang.String host,
int port,
int timeout,
MigrateParams params,
byte[]... keys)
migrate in interface KeyBinaryCommandspublic long waitReplicas(int replicas,
long timeout)
ServerCommandsBlocks 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 ServerCommandsreplicas - 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)
ServerCommandswaitAOF in interface ServerCommandsnumLocal - 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 HyperLogLogBinaryCommandspublic long pfcount(byte[] key)
pfcount in interface HyperLogLogBinaryCommandspublic java.lang.String pfmerge(byte[] destkey,
byte[]... sourcekeys)
pfmerge in interface HyperLogLogBinaryCommandspublic long pfcount(byte[]... keys)
pfcount in interface HyperLogLogBinaryCommandspublic ScanResult<byte[]> scan(byte[] cursor)
scan in interface KeyBinaryCommandspublic ScanResult<byte[]> scan(byte[] cursor, ScanParams params)
scan in interface KeyBinaryCommandspublic ScanResult<byte[]> scan(byte[] cursor, ScanParams params, byte[] type)
scan in interface KeyBinaryCommandspublic ScanResult<java.util.Map.Entry<byte[],byte[]>> hscan(byte[] key, byte[] cursor, ScanParams params)
hscan in interface HashBinaryCommandspublic ScanResult<byte[]> hscanNoValues(byte[] key, byte[] cursor, ScanParams params)
hscanNoValues in interface HashBinaryCommandspublic ScanResult<byte[]> sscan(byte[] key, byte[] cursor)
sscan in interface SetBinaryCommandspublic ScanResult<byte[]> sscan(byte[] key, byte[] cursor, ScanParams params)
sscan in interface SetBinaryCommandspublic ScanResult<Tuple> zscan(byte[] key, byte[] cursor)
zscan in interface SortedSetBinaryCommandspublic ScanResult<Tuple> zscan(byte[] key, byte[] cursor, ScanParams params)
zscan in interface SortedSetBinaryCommandspublic long geoadd(byte[] key,
double longitude,
double latitude,
byte[] member)
geoadd in interface GeoBinaryCommandspublic long geoadd(byte[] key,
java.util.Map<byte[],GeoCoordinate> memberCoordinateMap)
geoadd in interface GeoBinaryCommandspublic long geoadd(byte[] key,
GeoAddParams params,
java.util.Map<byte[],GeoCoordinate> memberCoordinateMap)
geoadd in interface GeoBinaryCommandspublic java.lang.Double geodist(byte[] key,
byte[] member1,
byte[] member2)
geodist in interface GeoBinaryCommandspublic java.lang.Double geodist(byte[] key,
byte[] member1,
byte[] member2,
GeoUnit unit)
geodist in interface GeoBinaryCommandspublic java.util.List<byte[]> geohash(byte[] key,
byte[]... members)
geohash in interface GeoBinaryCommandspublic java.util.List<GeoCoordinate> geopos(byte[] key, byte[]... members)
geopos in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit)
georadius in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadiusReadonly(byte[] key, double longitude, double latitude, double radius, GeoUnit unit)
georadiusReadonly in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadius(byte[] key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
georadius in interface GeoBinaryCommandspublic long georadiusStore(byte[] key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
georadiusStore in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadiusReadonly(byte[] key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusReadonly in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit)
georadiusByMember in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit)
georadiusByMemberReadonly in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadiusByMember(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusByMember in interface GeoBinaryCommandspublic long georadiusByMemberStore(byte[] key,
byte[] member,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
georadiusByMemberStore in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> geosearch(byte[] key, byte[] member, double radius, GeoUnit unit)
geosearch in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> geosearch(byte[] key, GeoCoordinate coord, double radius, GeoUnit unit)
geosearch in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> geosearch(byte[] key, byte[] member, double width, double height, GeoUnit unit)
geosearch in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> geosearch(byte[] key, GeoCoordinate coord, double width, double height, GeoUnit unit)
geosearch in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> geosearch(byte[] key, GeoSearchParam params)
geosearch in interface GeoBinaryCommandspublic long geosearchStore(byte[] dest,
byte[] src,
byte[] member,
double radius,
GeoUnit unit)
geosearchStore in interface GeoBinaryCommandspublic long geosearchStore(byte[] dest,
byte[] src,
GeoCoordinate coord,
double radius,
GeoUnit unit)
geosearchStore in interface GeoBinaryCommandspublic long geosearchStore(byte[] dest,
byte[] src,
byte[] member,
double width,
double height,
GeoUnit unit)
geosearchStore in interface GeoBinaryCommandspublic long geosearchStore(byte[] dest,
byte[] src,
GeoCoordinate coord,
double width,
double height,
GeoUnit unit)
geosearchStore in interface GeoBinaryCommandspublic long geosearchStore(byte[] dest,
byte[] src,
GeoSearchParam params)
geosearchStore in interface GeoBinaryCommandspublic long geosearchStoreStoreDist(byte[] dest,
byte[] src,
GeoSearchParam params)
geosearchStoreStoreDist in interface GeoBinaryCommandspublic java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusByMemberReadonly in interface GeoBinaryCommandspublic java.util.List<java.lang.Long> bitfield(byte[] key,
byte[]... arguments)
bitfield in interface BitBinaryCommandspublic java.util.List<java.lang.Long> bitfieldReadonly(byte[] key,
byte[]... arguments)
bitfieldReadonly in interface BitBinaryCommandspublic long hstrlen(byte[] key,
byte[] field)
hstrlen in interface HashBinaryCommandspublic java.util.List<java.lang.Long> hexpire(byte[] key,
long seconds,
byte[]... fields)
HashBinaryCommandshexpire in interface HashBinaryCommandskey - hashseconds - time to expirepublic java.util.List<java.lang.Long> hexpire(byte[] key,
long seconds,
ExpiryOption condition,
byte[]... fields)
HashBinaryCommandshexpire in interface HashBinaryCommandskey - hashseconds - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hpexpire(byte[] key,
long milliseconds,
byte[]... fields)
HashBinaryCommandshpexpire in interface HashBinaryCommandskey - hashmilliseconds - time to expirepublic java.util.List<java.lang.Long> hpexpire(byte[] key,
long milliseconds,
ExpiryOption condition,
byte[]... fields)
HashBinaryCommandshpexpire in interface HashBinaryCommandskey - hashmilliseconds - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hexpireAt(byte[] key,
long unixTimeSeconds,
byte[]... fields)
HashBinaryCommandshexpireAt in interface HashBinaryCommandskey - hashunixTimeSeconds - time to expirepublic java.util.List<java.lang.Long> hexpireAt(byte[] key,
long unixTimeSeconds,
ExpiryOption condition,
byte[]... fields)
HashBinaryCommandshexpireAt in interface HashBinaryCommandskey - hashunixTimeSeconds - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hpexpireAt(byte[] key,
long unixTimeMillis,
byte[]... fields)
HashBinaryCommandshpexpireAt in interface HashBinaryCommandskey - hashunixTimeMillis - time to expirepublic java.util.List<java.lang.Long> hpexpireAt(byte[] key,
long unixTimeMillis,
ExpiryOption condition,
byte[]... fields)
HashBinaryCommandshpexpireAt in interface HashBinaryCommandskey - hashunixTimeMillis - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hexpireTime(byte[] key,
byte[]... fields)
HashBinaryCommandshexpireTime in interface HashBinaryCommandskey - hashpublic java.util.List<java.lang.Long> hpexpireTime(byte[] key,
byte[]... fields)
HashBinaryCommandshpexpireTime in interface HashBinaryCommandskey - hashpublic java.util.List<java.lang.Long> httl(byte[] key,
byte[]... fields)
HashBinaryCommandshttl in interface HashBinaryCommandskey - hashpublic java.util.List<java.lang.Long> hpttl(byte[] key,
byte[]... fields)
HashBinaryCommandshpttl in interface HashBinaryCommandskey - hashpublic java.util.List<java.lang.Long> hpersist(byte[] key,
byte[]... fields)
HashBinaryCommandshpersist in interface HashBinaryCommandskey - hash@Deprecated public java.util.List<java.lang.Object> xread(XReadParams xReadParams, java.util.Map.Entry<byte[],byte[]>... streams)
xreadBinary(XReadParams, Map) or
xreadBinaryAsMap(XReadParams, Map) for type safety and better stream entry
parsing.xread in interface StreamBinaryCommands@Deprecated
public java.util.List<java.lang.Object> xreadGroup(byte[] groupName,
byte[] consumer,
XReadGroupParams xReadGroupParams,
java.util.Map.Entry<byte[],byte[]>... streams)
xreadGroupBinary(byte[], byte[], XReadGroupParams, Map) or
xreadGroupBinaryAsMap(byte[], byte[], XReadGroupParams, Map) instead.xreadGroup in interface StreamBinaryCommandspublic java.util.List<java.util.Map.Entry<byte[],java.util.List<StreamEntryBinary>>> xreadBinary(XReadParams xReadParams, java.util.Map<byte[],StreamEntryID> streams)
StreamBinaryCommandsxreadBinary in interface StreamBinaryCommandsxReadParams - XReadParamsstreams - Map of stream name and ID to read from.public java.util.Map<byte[],java.util.List<StreamEntryBinary>> xreadBinaryAsMap(XReadParams xReadParams, java.util.Map<byte[],StreamEntryID> streams)
StreamBinaryCommandsxreadBinaryAsMap in interface StreamBinaryCommandsxReadParams - XReadParamsstreams - Map of stream name and ID to read from.public java.util.List<java.util.Map.Entry<byte[],java.util.List<StreamEntryBinary>>> xreadGroupBinary(byte[] groupName, byte[] consumer, XReadGroupParams xReadGroupParams, java.util.Map<byte[],StreamEntryID> streams)
StreamBinaryCommandsxreadGroupBinary in interface StreamBinaryCommandsgroupName - Consumer group name.consumer - Consumer name.xReadGroupParams - XReadGroupParamsstreams - Map of stream name and ID to read from.public java.util.Map<byte[],java.util.List<StreamEntryBinary>> xreadGroupBinaryAsMap(byte[] groupName, byte[] consumer, XReadGroupParams xReadGroupParams, java.util.Map<byte[],StreamEntryID> streams)
StreamBinaryCommandsxreadGroupBinaryAsMap in interface StreamBinaryCommandsgroupName - Consumer group name.consumer - Consumer name.xReadGroupParams - XReadGroupParamsstreams - Map of stream name and ID to read from.public byte[] xadd(byte[] key,
XAddParams params,
java.util.Map<byte[],byte[]> hash)
xadd in interface StreamBinaryCommandspublic long xlen(byte[] key)
xlen in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xrange(byte[] key,
byte[] start,
byte[] end)
xrange in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xrange(byte[] key,
byte[] start,
byte[] end,
int count)
xrange in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xrevrange(byte[] key,
byte[] end,
byte[] start)
xrevrange in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xrevrange(byte[] key,
byte[] end,
byte[] start,
int count)
xrevrange in interface StreamBinaryCommandspublic long xack(byte[] key,
byte[] group,
byte[]... ids)
xack in interface StreamBinaryCommandspublic java.util.List<StreamEntryDeletionResult> xackdel(byte[] key, byte[] group, byte[]... ids)
StreamBinaryCommandsxackdel in interface StreamBinaryCommandspublic java.util.List<StreamEntryDeletionResult> xackdel(byte[] key, byte[] group, StreamDeletionPolicy trimMode, byte[]... ids)
StreamBinaryCommandsxackdel in interface StreamBinaryCommandspublic java.lang.String xgroupCreate(byte[] key,
byte[] consumer,
byte[] id,
boolean makeStream)
xgroupCreate in interface StreamBinaryCommandspublic java.lang.String xgroupSetID(byte[] key,
byte[] consumer,
byte[] id)
xgroupSetID in interface StreamBinaryCommandspublic long xgroupDestroy(byte[] key,
byte[] consumer)
xgroupDestroy in interface StreamBinaryCommandspublic boolean xgroupCreateConsumer(byte[] key,
byte[] groupName,
byte[] consumerName)
xgroupCreateConsumer in interface StreamBinaryCommandspublic long xgroupDelConsumer(byte[] key,
byte[] groupName,
byte[] consumerName)
xgroupDelConsumer in interface StreamBinaryCommandspublic long xdel(byte[] key,
byte[]... ids)
xdel in interface StreamBinaryCommandspublic java.util.List<StreamEntryDeletionResult> xdelex(byte[] key, byte[]... ids)
StreamBinaryCommandsxdelex in interface StreamBinaryCommandspublic java.util.List<StreamEntryDeletionResult> xdelex(byte[] key, StreamDeletionPolicy trimMode, byte[]... ids)
StreamBinaryCommandsxdelex in interface StreamBinaryCommandspublic long xtrim(byte[] key,
long maxLen,
boolean approximateLength)
xtrim in interface StreamBinaryCommandspublic long xtrim(byte[] key,
XTrimParams params)
xtrim in interface StreamBinaryCommandspublic java.lang.Object xpending(byte[] key,
byte[] groupName)
xpending in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xpending(byte[] key,
byte[] groupName,
XPendingParams params)
xpending in interface StreamBinaryCommandspublic java.util.List<byte[]> xclaim(byte[] key,
byte[] group,
byte[] consumerName,
long minIdleTime,
XClaimParams params,
byte[]... ids)
xclaim in interface StreamBinaryCommandspublic java.util.List<byte[]> xclaimJustId(byte[] key,
byte[] group,
byte[] consumerName,
long minIdleTime,
XClaimParams params,
byte[]... ids)
xclaimJustId in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xautoclaim(byte[] key,
byte[] groupName,
byte[] consumerName,
long minIdleTime,
byte[] start,
XAutoClaimParams params)
xautoclaim in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xautoclaimJustId(byte[] key,
byte[] groupName,
byte[] consumerName,
long minIdleTime,
byte[] start,
XAutoClaimParams params)
xautoclaimJustId in interface StreamBinaryCommandspublic java.lang.Object xinfoStream(byte[] key)
xinfoStream in interface StreamBinaryCommandspublic java.lang.Object xinfoStreamFull(byte[] key)
StreamBinaryCommandsxinfoStreamFull in interface StreamBinaryCommandskey - Stream namepublic java.lang.Object xinfoStreamFull(byte[] key,
int count)
StreamBinaryCommandsxinfoStreamFull in interface StreamBinaryCommandskey - Stream namecount - stream info countpublic java.util.List<java.lang.Object> xinfoGroups(byte[] key)
xinfoGroups in interface StreamBinaryCommandspublic java.util.List<java.lang.Object> xinfoConsumers(byte[] key,
byte[] group)
xinfoConsumers in interface StreamBinaryCommandspublic 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 DatabaseCommandssrcKey - 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 KeyCommandssrcKey - 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 ServerCommandsmessage - public java.lang.String set(java.lang.String key,
java.lang.String value)
Time complexity: O(1)
set in interface StringCommandskey - value - public java.lang.String set(java.lang.String key,
java.lang.String value,
SetParams params)
set in interface StringCommandskey - 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 StringCommandskey - public java.lang.String setGet(java.lang.String key,
java.lang.String value)
setGet in interface StringCommandspublic java.lang.String setGet(java.lang.String key,
java.lang.String value,
SetParams params)
setGet in interface StringCommandspublic java.lang.String getDel(java.lang.String key)
Time complexity: O(1)
getDel in interface StringCommandskey - public java.lang.String getEx(java.lang.String key,
GetExParams params)
StringCommandsGET,
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 StringCommandsparams - GetExParamspublic long exists(java.lang.String... keys)
exists in interface KeyCommandskeys - keyspublic boolean exists(java.lang.String key)
exists in interface KeyCommandskey - true if the key exists, otherwise falsepublic long del(java.lang.String... keys)
del in interface KeyCommandskeys - public long del(java.lang.String key)
KeyCommandsTime complexity: O(1)
del in interface KeyCommandspublic 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 KeyCommandskeys - KeyCommands.unlink(String)public long unlink(java.lang.String key)
KeyCommandsDEL: 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 KeyCommandspublic java.lang.String type(java.lang.String key)
type in interface KeyCommandskey - public java.util.Set<java.lang.String> keys(java.lang.String pattern)
KeyCommandsNote 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 KeyCommandspublic java.lang.String randomKey()
Time complexity: O(1)
randomKey in interface KeyCommandspublic java.lang.String rename(java.lang.String oldkey,
java.lang.String newkey)
Time complexity: O(1)
rename in interface KeyCommandsoldkey - newkey - public long renamenx(java.lang.String oldkey,
java.lang.String newkey)
Time complexity: O(1)
renamenx in interface KeyCommandsoldkey - 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 KeyCommandskey - seconds - public long expire(java.lang.String key,
long seconds,
ExpiryOption expiryOption)
EXPIRE but with optional expiry setting.expire in interface KeyCommandskey - seconds - time to expireexpiryOption - can be NX, XX, GT or LTexpire(String, long)public long pexpire(java.lang.String key,
long milliseconds)
KeyCommandsEXPIRE but the time
to live of the key is specified in milliseconds instead of seconds.
Time complexity: O(1)
pexpire in interface KeyCommandsmilliseconds - time to expirepublic long pexpire(java.lang.String key,
long milliseconds,
ExpiryOption expiryOption)
KeyCommandsEXPIRE but with optional expiry setting.pexpire in interface KeyCommandsmilliseconds - 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 KeyCommandskey - 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 KeyCommandskey - 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 KeyCommandskey - unixTime - public long expireAt(java.lang.String key,
long unixTime,
ExpiryOption expiryOption)
EXPIREAT but with ExpiryOption.expireAt in interface KeyCommandskey - 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 KeyCommandskey - millisecondsTimestamp - time to expirepublic long pexpireAt(java.lang.String key,
long millisecondsTimestamp,
ExpiryOption expiryOption)
pexpireAt in interface KeyCommandskey - 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 KeyCommandskey - public long touch(java.lang.String... keys)
touch in interface KeyCommandskeys - public long touch(java.lang.String key)
KeyCommandsTime complexity: O(N) where N is the number of keys that will be touched.
touch in interface KeyCommandspublic long move(java.lang.String key,
int dbIndex)
move in interface DatabaseCommandskey - dbIndex - @Deprecated
public java.lang.String getSet(java.lang.String key,
java.lang.String value)
setGet(java.lang.String, java.lang.String).Time complexity: O(1)
getSet in interface StringCommandskey - value - public java.util.List<java.lang.String> mget(java.lang.String... keys)
Time complexity: O(1) for every key
mget in interface StringCommandskeys - 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 StringCommandskey - 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 StringCommandskey - 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 StringCommandskeysvalues - 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 StringCommandskeysvalues - 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 StringCommandskey - 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 StringCommandskey - 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 StringCommandskey - 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 StringCommandskey - 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 StringCommandskey - 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 StringCommandskey - 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 StringCommandskey - 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 HashCommandskey - field - value - public long hset(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> hash)
hset in interface HashCommandspublic long hsetex(java.lang.String key,
HSetExParams params,
java.lang.String field,
java.lang.String value)
HashCommandshsetex in interface HashCommandskey - the key of the hashparams - the parameters for the HSETEX commandfield - the field in the hashvalue - the value to setHSetExParamspublic long hsetex(java.lang.String key,
HSetExParams params,
java.util.Map<java.lang.String,java.lang.String> hash)
HashCommandshsetex in interface HashCommandskey - the key of the hashparams - the parameters for the HSETEX commandhash - the map containing field-value pairs to set in the hashHSetExParamspublic 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 HashCommandskey - field - public java.util.List<java.lang.String> hgetex(java.lang.String key,
HGetExParams params,
java.lang.String... fields)
HashCommandshgetex in interface HashCommandskey - the key of the hashparams - additional parameters for the HGETEX commandfields - the fields whose values are to be retrievedHGetExParamspublic java.util.List<java.lang.String> hgetdel(java.lang.String key,
java.lang.String... fields)
HashCommandshgetdel in interface HashCommandskey - the key of the hashfields - the fields whose values are to be retrieved and then deletedpublic long hsetnx(java.lang.String key,
java.lang.String field,
java.lang.String value)
hsetnx in interface HashCommandskey - 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 HashCommandskey - 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 HashCommandskey - 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 HashCommandskey - 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 HashCommandskey - field - value - public boolean hexists(java.lang.String key,
java.lang.String field)
hexists in interface HashCommandskey - 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 HashCommandskey - fields - public long hlen(java.lang.String key)
Time complexity: O(1)
hlen in interface HashCommandskey - 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 HashCommandskey - 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 HashCommandskey - 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 HashCommandskey - public java.lang.String hrandfield(java.lang.String key)
Time complexity: O(N), where N is the number of fields returned
hrandfield in interface HashCommandskey - 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 HashCommandskey - 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 HashCommandskey - count - public long rpush(java.lang.String key,
java.lang.String... strings)
Time complexity: O(1)
rpush in interface ListCommandskey - strings - public long lpush(java.lang.String key,
java.lang.String... strings)
Time complexity: O(1)
lpush in interface ListCommandskey - strings - public long llen(java.lang.String key)
Time complexity: O(1)
llen in interface ListCommandskey - 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 ListCommandskey - 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 ListCommandskey - 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 ListCommandskey - 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 ListCommandskey - 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 ListCommandskey - 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 ListCommandskey - rpop(String)public java.util.List<java.lang.String> lpop(java.lang.String key,
int count)
ListCommandslpop in interface ListCommandspublic java.lang.Long lpos(java.lang.String key,
java.lang.String element)
ListCommandsTime complexity: O(N) where N is the number of elements in the list
lpos in interface ListCommandspublic java.lang.Long lpos(java.lang.String key,
java.lang.String element,
LPosParams params)
ListCommandsMaxlen 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 ListCommandsparams - LPosParamspublic java.util.List<java.lang.Long> lpos(java.lang.String key,
java.lang.String element,
LPosParams params,
long count)
ListCommandsTime complexity: O(N) where N is the number of elements in the list
lpos in interface ListCommandsparams - LPosParamspublic 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 ListCommandskey - lpop(String)public java.util.List<java.lang.String> rpop(java.lang.String key,
int count)
ListCommandsrpop in interface ListCommandscount - 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 ListCommandssrckey - dstkey - public long sadd(java.lang.String key,
java.lang.String... members)
Time complexity O(1)
sadd in interface SetCommandskey - members - public java.util.Set<java.lang.String> smembers(java.lang.String key)
SINTER.
Time complexity O(N)
smembers in interface SetCommandskey - public long srem(java.lang.String key,
java.lang.String... members)
Time complexity O(1)
srem in interface SetCommandskey - 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 SetCommandskey - public java.util.Set<java.lang.String> spop(java.lang.String key,
long count)
SetCommandsSetCommands.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 SetCommandspublic 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 SetCommandssrckey - dstkey - member - public long scard(java.lang.String key)
scard in interface SetCommandskey - public boolean sismember(java.lang.String key,
java.lang.String member)
Time complexity O(1)
sismember in interface SetCommandskey - 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 SetCommandskey - 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 SetCommandskeys - 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 SetCommandsdstkey - 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 SetCommandskeys - 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 SetCommandslimit - 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 SetCommandskeys - 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 SetCommandsdstkey - 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 SetCommandskeys - 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 SetCommandsdstkey - 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 SetCommandskey - 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 SetCommandskey - 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 SortedSetCommandskey - score - member - public long zadd(java.lang.String key,
double score,
java.lang.String member,
ZAddParams params)
SortedSetCommandsZADD but can be used with optional params.zadd in interface SortedSetCommandsparams - ZAddParamsSortedSetCommands.zadd(String, double, String)public long zadd(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Double> scoreMembers)
SortedSetCommandsZADD but for multiple members.zadd in interface SortedSetCommandsSortedSetCommands.zadd(String, double, String)public long zadd(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Double> scoreMembers,
ZAddParams params)
SortedSetCommandsZADD but can be used with optional params,
and fits for multiple members.zadd in interface SortedSetCommandsparams - ZAddParamsSortedSetCommands.zadd(String, double, String)public java.lang.Double zaddIncr(java.lang.String key,
double score,
java.lang.String member,
ZAddParams params)
SortedSetCommandsThe 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 SortedSetCommandsparams - ZAddParamspublic java.util.List<java.lang.String> zdiff(java.lang.String... keys)
SortedSetCommandsTime 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 SortedSetCommandskeys - group of setspublic java.util.List<Tuple> zdiffWithScores(java.lang.String... keys)
SortedSetCommandszdiffWithScores in interface SortedSetCommandskeys - group of sets@Deprecated
public long zdiffStore(java.lang.String dstkey,
java.lang.String... keys)
SortedSetCommandszdiffStore in interface SortedSetCommandskeys - group of setspublic long zdiffstore(java.lang.String dstkey,
java.lang.String... keys)
SortedSetCommandszdiffstore in interface SortedSetCommandskeys - group of setspublic java.util.List<java.lang.String> zrange(java.lang.String key,
long start,
long stop)
SortedSetCommandsTime 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 SortedSetCommandskey - 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 SortedSetCommandskey - 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 SortedSetCommandskey - increment - member - public java.lang.Double zincrby(java.lang.String key,
double increment,
java.lang.String member,
ZIncrByParams params)
SortedSetCommandsZINCRBY but can be used with optionals params.zincrby in interface SortedSetCommandsparams - ZIncrByParamsSortedSetCommands.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 SortedSetCommandskey - 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 SortedSetCommandskey - member - zrank(String, String)public KeyValue<java.lang.Long,java.lang.Double> zrankWithScore(java.lang.String key, java.lang.String member)
zrankWithScore in interface SortedSetCommandskey - the keymember - the memberpublic KeyValue<java.lang.Long,java.lang.Double> zrevrankWithScore(java.lang.String key, java.lang.String member)
zrevrankWithScore in interface SortedSetCommandskey - the keymember - the memberpublic java.util.List<java.lang.String> zrevrange(java.lang.String key,
long start,
long stop)
SortedSetCommandsTime 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 SortedSetCommandskey - the key to querystart - the minimum indexstop - the maximum indexpublic java.util.List<Tuple> zrangeWithScores(java.lang.String key, long start, long stop)
SortedSetCommandszrangeWithScores in interface SortedSetCommandskey - the key to querystart - the minimum indexstop - the maximum indexpublic java.util.List<Tuple> zrevrangeWithScores(java.lang.String key, long start, long stop)
SortedSetCommandsZREVRANGE but the reply will
include the scores of the returned elements.zrevrangeWithScores in interface SortedSetCommandskey - 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)
SortedSetCommandsZRANGE but can be used with additional params.zrange in interface SortedSetCommandskey - the key to queryzRangeParams - ZRangeParamsSortedSetCommands.zrange(String, long, long)public java.util.List<Tuple> zrangeWithScores(java.lang.String key, ZRangeParams zRangeParams)
SortedSetCommandsZRANGE but can be used with additional params.zrangeWithScores in interface SortedSetCommandskey - the key to queryzRangeParams - ZRangeParamsSortedSetCommands.zrangeWithScores(String, long, long)public long zrangestore(java.lang.String dest,
java.lang.String src,
ZRangeParams zRangeParams)
SortedSetCommandsZRANGE but stores the result in dest.zrangestore in interface SortedSetCommandsdest - the storing keysrc - the key to queryzRangeParams - ZRangeParamsSortedSetCommands.zrange(String, ZRangeParams)public java.lang.String zrandmember(java.lang.String key)
SortedSetCommandsTime complexity O(N) where N is the number of elements returned
zrandmember in interface SortedSetCommandspublic java.util.List<java.lang.String> zrandmember(java.lang.String key,
long count)
SortedSetCommandsZCARD), whichever is lower.
Time complexity O(N) where N is the number of elements returned
zrandmember in interface SortedSetCommandscount - choose up to count elementspublic java.util.List<Tuple> zrandmemberWithScores(java.lang.String key, long count)
SortedSetCommandsZRANDMEMBER but the replay will
include the scores with the result.zrandmemberWithScores in interface SortedSetCommandscount - choose up to count elementsSortedSetCommands.zrandmember(String, long)public long zcard(java.lang.String key)
Time complexity O(1)
zcard in interface SortedSetCommandskey - public java.lang.Double zscore(java.lang.String key,
java.lang.String member)
Time complexity: O(1)
zscore in interface SortedSetCommandskey - 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 SortedSetCommandskey - members - public Tuple zpopmax(java.lang.String key)
SortedSetCommandsTime complexity O(log(N)) with N being the number of elements in the sorted set
zpopmax in interface SortedSetCommandspublic java.util.List<Tuple> zpopmax(java.lang.String key, int count)
SortedSetCommandsTime 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 SortedSetCommandscount - the number of elements to poppublic Tuple zpopmin(java.lang.String key)
SortedSetCommandsTime complexity O(log(N)) with N being the number of elements in the sorted set
zpopmin in interface SortedSetCommandspublic java.util.List<Tuple> zpopmin(java.lang.String key, int count)
SortedSetCommandsTime 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 SortedSetCommandscount - 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 KeyCommandskey - 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 KeyCommandskey - sortingParams - sort(String),
sort(String, SortingParams, String)public long sort(java.lang.String key,
SortingParams sortingParams,
java.lang.String dstkey)
sort in interface KeyCommandskey - sortingParams - dstkey - sort(String, SortingParams),
sort(String),
sort(String, String)public java.util.List<java.lang.String> sortReadonly(java.lang.String key,
SortingParams sortingParams)
KeyCommandsSORT 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 KeyCommandskey - the key to sortsortingParams - SortingParamspublic 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 KeyCommandskey - 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)
ListCommandslmove in interface ListCommandsfrom - 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)
ListCommandsblmove in interface ListCommandsfrom - 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 ListCommandstimeout - 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)
ListCommandsListCommands.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 ListCommandstimeout - 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 ListCommandstimeout - 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)
ListCommandsListCommands.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 ListCommandstimeout - 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 ListCommandspublic KeyValue<java.lang.String,java.util.List<java.lang.String>> lmpop(ListDirection direction, int count, java.lang.String... keys)
lmpop in interface ListCommandspublic KeyValue<java.lang.String,java.util.List<java.lang.String>> blmpop(double timeout, ListDirection direction, java.lang.String... keys)
blmpop in interface ListCommandspublic KeyValue<java.lang.String,java.util.List<java.lang.String>> blmpop(double timeout, ListDirection direction, int count, java.lang.String... keys)
blmpop in interface ListCommandspublic KeyValue<java.lang.String,Tuple> bzpopmax(double timeout, java.lang.String... keys)
SortedSetCommandsZPOPMAXbzpopmax in interface SortedSetCommandstimeout - 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)
SortedSetCommandsZPOPMINbzpopmin in interface SortedSetCommandstimeout - 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 ListCommandsListCommands.blpop(int, String...)public KeyValue<java.lang.String,java.lang.String> blpop(double timeout, java.lang.String key)
blpop in interface ListCommandsListCommands.blpop(double, String...)public java.util.List<java.lang.String> brpop(int timeout,
java.lang.String key)
brpop in interface ListCommandsListCommands.brpop(int, String...)public KeyValue<java.lang.String,java.lang.String> brpop(double timeout, java.lang.String key)
brpop in interface ListCommandsListCommands.brpop(double, String...)public long zcount(java.lang.String key,
double min,
double max)
SortedSetCommandsTime complexity O(log(N)) with N being the number of elements in the sorted set.
zcount in interface SortedSetCommandskey - the key to querymin - minimum scoremax - maximum scorepublic long zcount(java.lang.String key,
java.lang.String min,
java.lang.String max)
SortedSetCommandsZCOUNT but with exclusive range.zcount in interface SortedSetCommandsSortedSetCommands.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 SortedSetCommandskey - 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)
SortedSetCommandsZRANGE but with exclusive range.zrangeByScore in interface SortedSetCommandsSortedSetCommands.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 SortedSetCommandskey - 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)
SortedSetCommandsZRANGE but with limit option,zrangeByScore in interface SortedSetCommandskey - 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 SortedSetCommandskey - 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)
SortedSetCommandsZRANGE but with exclusive range,
and return with scores.zrangeByScoreWithScores in interface SortedSetCommandsSortedSetCommands.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 SortedSetCommandskey - 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)
SortedSetCommandsZRANGE but with exclusive range,
with limit options and return with scores.zrangeByScoreWithScores in interface SortedSetCommandskey - 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)
SortedSetCommandsThe 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 SortedSetCommandskey - 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)
SortedSetCommandsZREVRANGE but with exclusive range.zrevrangeByScore in interface SortedSetCommandsSortedSetCommands.zrevrangeByScore(String, double, double)public java.util.List<java.lang.String> zrevrangeByScore(java.lang.String key,
double max,
double min,
int offset,
int count)
SortedSetCommandsZRANGE but with limit option,zrevrangeByScore in interface SortedSetCommandskey - 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)
SortedSetCommandsZREVRANGE but return with scores.zrevrangeByScoreWithScores in interface SortedSetCommandskey - 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)
SortedSetCommandsZREVRANGE but with
limit options and return with scores.zrevrangeByScoreWithScores in interface SortedSetCommandskey - 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)
SortedSetCommandsZREVRANGE but with
exclusive range, with limit options and return with scores.zrevrangeByScoreWithScores in interface SortedSetCommandskey - 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)
SortedSetCommandsZREVRANGE but with limit option,zrevrangeByScore in interface SortedSetCommandskey - 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)
SortedSetCommandsZREVRANGE but with exclusive range,
and return with scores.zrevrangeByScoreWithScores in interface SortedSetCommandsSortedSetCommands.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 SortedSetCommandskey - 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 SortedSetCommandskey - min - max - public long zremrangeByScore(java.lang.String key,
java.lang.String min,
java.lang.String max)
SortedSetCommandsZREMRANGE but with limit option.zremrangeByScore in interface SortedSetCommandsSortedSetCommands.zremrangeByScore(String, double, double)public java.util.List<java.lang.String> zunion(ZParams params, java.lang.String... keys)
zunion in interface SortedSetCommandsparams - keys - public java.util.List<Tuple> zunionWithScores(ZParams params, java.lang.String... keys)
zunionWithScores in interface SortedSetCommandsparams - 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 SortedSetCommandsdstkey - 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 SortedSetCommandsdstkey - 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 SortedSetCommandsparams - keys - public java.util.List<Tuple> zinterWithScores(ZParams params, java.lang.String... keys)
zinterWithScores in interface SortedSetCommandsparams - keys - public long zintercard(java.lang.String... keys)
SortedSetCommandsZINTER, 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 SortedSetCommandskeys - group of setsSortedSetCommands.zinter(ZParams, String...)public long zintercard(long limit,
java.lang.String... keys)
SortedSetCommandsZINTER, 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 SortedSetCommandslimit - 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 SortedSetCommandsdstkey - 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 SortedSetCommandsdstkey - 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)
SortedSetCommandsTime complexity O(log(N)) with N being the number of elements in the sorted set.
zlexcount in interface SortedSetCommandsmin - minimum valuemax - maximum valuepublic java.util.List<java.lang.String> zrangeByLex(java.lang.String key,
java.lang.String min,
java.lang.String max)
SortedSetCommandsTime 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 SortedSetCommandsmin - 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)
SortedSetCommandsZRANGE but with limit option.zrangeByLex in interface SortedSetCommandsmin - 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)
SortedSetCommandsTime 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 SortedSetCommandsmax - 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)
SortedSetCommandsZRANGE but with limit option.zrevrangeByLex in interface SortedSetCommandsmax - 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)
SortedSetCommandsTime 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 SortedSetCommandsmin - 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 SortedSetCommandspublic KeyValue<java.lang.String,java.util.List<Tuple>> zmpop(SortedSetOption option, int count, java.lang.String... keys)
zmpop in interface SortedSetCommandspublic KeyValue<java.lang.String,java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, java.lang.String... keys)
bzmpop in interface SortedSetCommandspublic KeyValue<java.lang.String,java.util.List<Tuple>> bzmpop(double timeout, SortedSetOption option, int count, java.lang.String... keys)
bzmpop in interface SortedSetCommandspublic long strlen(java.lang.String key)
StringCommandsstrlen in interface StringCommandspublic LCSMatchResult lcs(java.lang.String keyA, java.lang.String keyB, LCSParams params)
lcs in interface StringCommandskeyA - keyB - params - public long lpushx(java.lang.String key,
java.lang.String... strings)
ListCommandsLPUSH, no operation will be performed when key
does not yet exist.lpushx in interface ListCommandsstrings - 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 KeyCommandskey - public long rpushx(java.lang.String key,
java.lang.String... strings)
ListCommandsRPUSH, no operation will be performed when key
does not yet exist.rpushx in interface ListCommandsstrings - the strings to pushpublic java.lang.String echo(java.lang.String string)
echo in interface ServerCommandspublic long linsert(java.lang.String key,
ListPosition where,
java.lang.String pivot,
java.lang.String value)
ListCommandsWhen key does not exist, it is considered an empty list and no operation is performed.
linsert in interface ListCommandswhere - 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 ListCommandssource - destination - timeout - public boolean setbit(java.lang.String key,
long offset,
boolean value)
setbit in interface BitCommandskey - offset - value - public boolean getbit(java.lang.String key,
long offset)
getbit in interface BitCommandskey - offset - public long setrange(java.lang.String key,
long offset,
java.lang.String value)
StringCommandsTime complexity: O(1)
setrange in interface StringCommandspublic java.lang.String getrange(java.lang.String key,
long startOffset,
long endOffset)
StringCommandsTime complexity: O(N) where N is the length of the returned string
getrange in interface StringCommandspublic long bitpos(java.lang.String key,
boolean value)
BitCommandsbitpos in interface BitCommandsvalue - the bit valuepublic long bitpos(java.lang.String key,
boolean value,
BitPosParams params)
BitCommandsbitpos in interface BitCommandsvalue - the bit valueparams - BitPosParamspublic java.util.List<java.lang.Object> role()
ControlCommandsrole in interface ControlCommandspublic 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 ConfigCommandspattern - public java.util.Map<java.lang.String,java.lang.String> configGet(java.lang.String... patterns)
ConfigCommandsconfigGet in interface ConfigCommandspatterns - 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 ConfigCommandsparameter - value - public java.lang.String configSet(java.lang.String... parameterValues)
configSet in interface ConfigCommandspublic java.lang.String configSet(java.util.Map<java.lang.String,java.lang.String> parameterValues)
configSet in interface ConfigCommandspublic 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)
ScriptingKeyCommandseval in interface ScriptingKeyCommandsscript - 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)
ScriptingKeyCommandseval in interface ScriptingKeyCommandsscript - 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)
ScriptingKeyCommandsEVALevalReadonly in interface ScriptingKeyCommandsscript - 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)
ScriptingKeyCommandseval in interface ScriptingKeyCommandsscript - 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)
ScriptingKeyCommandsEVAL, 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 ScriptingKeyCommandssha1 - 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)
ScriptingKeyCommandsScriptingKeyCommands.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 ScriptingKeyCommandssha1 - 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)
ScriptingKeyCommandsEVALevalshaReadonly in interface ScriptingKeyCommandssha1 - the scriptScriptingKeyCommands.evalsha(String, List, List)public java.lang.Object evalsha(java.lang.String sha1,
int keyCount,
java.lang.String... params)
ScriptingKeyCommandsScriptingKeyCommands.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 ScriptingKeyCommandssha1 - the scriptScriptingKeyCommands.eval(String, int, String...)public java.lang.Boolean scriptExists(java.lang.String sha1)
scriptExists in interface ScriptingControlCommandspublic java.util.List<java.lang.Boolean> scriptExists(java.lang.String... sha1)
scriptExists in interface ScriptingControlCommandspublic java.lang.String scriptLoad(java.lang.String script)
scriptLoad in interface ScriptingControlCommandspublic java.util.List<Slowlog> slowlogGet()
slowlogGet in interface SlowlogCommandspublic java.util.List<Slowlog> slowlogGet(long entries)
slowlogGet in interface SlowlogCommandspublic java.lang.Long objectRefcount(java.lang.String key)
KeyCommandsTime complexity: O(1)
objectRefcount in interface ControlCommandsobjectRefcount in interface KeyCommandskey - The key in Redis serverpublic java.lang.String objectEncoding(java.lang.String key)
KeyCommandsTime complexity: O(1)
objectEncoding in interface ControlCommandsobjectEncoding in interface KeyCommandskey - The key in Redis serverpublic java.lang.Long objectIdletime(java.lang.String key)
KeyCommandsTime complexity: O(1)
objectIdletime in interface ControlCommandsobjectIdletime in interface KeyCommandskey - The key in Redis serverpublic java.util.List<java.lang.String> objectHelp()
ControlCommandsobjectHelp in interface ControlCommandspublic java.lang.Long objectFreq(java.lang.String key)
KeyCommandsTime complexity: O(1)
objectFreq in interface ControlCommandsobjectFreq in interface KeyCommandskey - The key in Redis serverpublic long bitcount(java.lang.String key)
BitCommandsbitcount in interface BitCommandspublic long bitcount(java.lang.String key,
long start,
long end)
BitCommandsLike 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 BitCommandsstart - byte start indexend - byte end indexpublic long bitcount(java.lang.String key,
long start,
long end,
BitCountOption option)
bitcount in interface BitCommandsstart - 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)
BitCommandsbitop in interface BitCommandsop - can be AND, OR, XOR, NOT, DIFF, DIFF1, ANDOR and ONEpublic long commandCount()
CommandCommandscommandCount in interface CommandCommandspublic java.util.Map<java.lang.String,CommandDocument> commandDocs(java.lang.String... commands)
CommandCommandscommandDocs in interface CommandCommandscommands - specify the names of one or more commandsCommandDocumentpublic java.util.List<java.lang.String> commandGetKeys(java.lang.String... command)
CommandCommandscommandGetKeys in interface CommandCommandspublic java.util.List<KeyValue<java.lang.String,java.util.List<java.lang.String>>> commandGetKeysAndFlags(java.lang.String... command)
CommandCommandscommandGetKeysAndFlags in interface CommandCommandsKeyValuepublic java.util.Map<java.lang.String,CommandInfo> commandInfo(java.lang.String... commands)
CommandCommandscommandInfo in interface CommandCommandsCommandInfopublic java.util.Map<java.lang.String,CommandInfo> command()
CommandCommandscommand in interface CommandCommandsCommandInfopublic java.util.List<java.lang.String> commandList()
CommandCommandscommandList in interface CommandCommandspublic java.util.List<java.lang.String> commandListFilterBy(CommandListFilterByParams filterByParams)
CommandCommandscommandListFilterBy in interface CommandCommandsfilterByParams - CommandListFilterByParamspublic java.lang.String sentinelMyId()
sentinelMyId in interface SentinelCommandspublic 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 SentinelCommandspublic java.util.Map<java.lang.String,java.lang.String> sentinelMaster(java.lang.String masterName)
sentinelMaster in interface SentinelCommandspublic java.util.List<java.util.Map<java.lang.String,java.lang.String>> sentinelSentinels(java.lang.String masterName)
sentinelSentinels in interface SentinelCommandspublic 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 SentinelCommandsmasterName - public java.lang.Long sentinelReset(java.lang.String pattern)
redis 127.0.0.1:26381> sentinel reset mymaster (integer) 1
sentinelReset in interface SentinelCommandspattern - @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 SentinelCommandsmasterName - public java.util.List<java.util.Map<java.lang.String,java.lang.String>> sentinelReplicas(java.lang.String masterName)
sentinelReplicas in interface SentinelCommandspublic java.lang.String sentinelFailover(java.lang.String masterName)
sentinelFailover in interface SentinelCommandspublic java.lang.String sentinelMonitor(java.lang.String masterName,
java.lang.String ip,
int port,
int quorum)
sentinelMonitor in interface SentinelCommandspublic java.lang.String sentinelRemove(java.lang.String masterName)
sentinelRemove in interface SentinelCommandspublic java.lang.String sentinelSet(java.lang.String masterName,
java.util.Map<java.lang.String,java.lang.String> parameterMap)
sentinelSet in interface SentinelCommandspublic byte[] dump(java.lang.String key)
KeyCommandsTime 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 KeyCommandspublic java.lang.String restore(java.lang.String key,
long ttl,
byte[] serializedValue)
KeyCommandsDUMP).
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 KeyCommandsttl - 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)
KeyCommandsDUMP).
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 KeyCommandsttl - If ttl is 0 the key is created without any expire, otherwise the specified expire
time (in milliseconds) is set.params - RestoreParamspublic long pttl(java.lang.String key)
KeyCommandsEXPIRE set.
Time complexity: O(1)
pttl in interface KeyCommandspublic 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 StringCommandskey - milliseconds - value - public java.lang.String aclSetUser(java.lang.String name)
AccessControlLogCommandsaclSetUser in interface AccessControlLogCommandsname - user who receives an aclpublic java.lang.String aclSetUser(java.lang.String name,
java.lang.String... rules)
AccessControlLogCommandsaclSetUser in interface AccessControlLogCommandsname - user who receives an aclrules - the acl rules for the specified userpublic long aclDelUser(java.lang.String... names)
AccessControlLogCommandsaclDelUser in interface AccessControlLogCommandsnames - The usernames to deletepublic AccessControlUser aclGetUser(java.lang.String name)
AccessControlLogCommandsaclGetUser in interface AccessControlLogCommandsname - usernamepublic java.util.List<java.lang.String> aclUsers()
AccessControlLogCommandsaclUsers in interface AccessControlLogCommandspublic java.util.List<java.lang.String> aclList()
AccessControlLogCommandsaclList in interface AccessControlLogCommandspublic java.lang.String aclWhoAmI()
AccessControlLogCommandsaclWhoAmI in interface AccessControlLogCommandspublic java.util.List<java.lang.String> aclCat()
AccessControlLogCommandsaclCat in interface AccessControlLogCommandspublic java.util.List<java.lang.String> aclCat(java.lang.String category)
AccessControlLogCommandsaclCat in interface AccessControlLogCommandscategory - The category for which to list available ACLspublic java.util.List<AccessControlLogEntry> aclLog()
AccessControlLogCommandsaclLog in interface AccessControlLogCommandspublic java.util.List<AccessControlLogEntry> aclLog(int limit)
AccessControlLogCommandsaclLog in interface AccessControlLogCommandslimit - The number of results to returnpublic java.lang.String aclLoad()
AccessControlLogCommandsaclLoad in interface AccessControlLogBinaryCommandsaclLoad in interface AccessControlLogCommandspublic java.lang.String aclSave()
AccessControlLogCommandsaclSave in interface AccessControlLogBinaryCommandsaclSave in interface AccessControlLogCommandspublic java.lang.String aclGenPass()
AccessControlLogCommandsaclGenPass in interface AccessControlLogCommandspublic java.lang.String aclGenPass(int bits)
AccessControlLogCommandsaclGenPass in interface AccessControlLogCommandsbits - the number of output bitspublic java.lang.String aclDryRun(java.lang.String username,
java.lang.String command,
java.lang.String... args)
aclDryRun in interface AccessControlLogCommandspublic java.lang.String aclDryRun(java.lang.String username,
CommandArguments commandArgs)
aclDryRun in interface AccessControlLogCommandspublic byte[] aclDryRunBinary(byte[] username,
byte[] command,
byte[]... args)
aclDryRunBinary in interface AccessControlLogBinaryCommandspublic byte[] aclDryRunBinary(byte[] username,
CommandArguments commandArgs)
aclDryRunBinary in interface AccessControlLogBinaryCommandspublic java.lang.String clientKill(java.lang.String ipPort)
ClientCommandsclientKill in interface ClientCommandsipPort - The ip:port should match a line returned by the CLIENT LIST command (addr field).public java.lang.String clientGetname()
ClientCommandsclientGetname in interface ClientCommandspublic java.lang.String clientList()
ClientCommandsclientList in interface ClientCommandspublic java.lang.String clientList(ClientType type)
ClientCommandsclientList in interface ClientCommandspublic java.lang.String clientList(long... clientIds)
ClientCommandsclientList in interface ClientCommandsclientIds - Unique 64-bit client IDspublic java.lang.String clientInfo()
ClientCommandsclientInfo in interface ClientCommandspublic java.lang.String clientSetInfo(ClientAttributeOption attr, java.lang.String value)
ClientCommandsclientSetInfo in interface ClientCommandsattr - the attr optionvalue - the valuepublic java.lang.String clientSetname(java.lang.String name)
ClientCommandsclientSetname in interface ClientCommandsname - current connection namepublic java.lang.String migrate(java.lang.String host,
int port,
java.lang.String key,
int destinationDb,
int timeout)
DatabaseCommandsmigrate in interface DatabaseCommandshost - 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)
DatabaseCommandsmigrate in interface DatabaseCommandshost - target hostport - target portdestinationDB - target dbtimeout - the maximum idle time in any moment of the communication with the
destination instance in milliseconds.params - MigrateParamskeys - to migratepublic java.lang.String migrate(java.lang.String host,
int port,
java.lang.String key,
int timeout)
KeyCommandsmigrate in interface KeyCommandstimeout - 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)
KeyCommandsmigrate in interface KeyCommandstimeout - the maximum idle time in any moment of the communication with the
destination instance in milliseconds.params - MigrateParamspublic ScanResult<java.lang.String> scan(java.lang.String cursor)
scan in interface KeyCommandspublic ScanResult<java.lang.String> scan(java.lang.String cursor, ScanParams params)
scan in interface KeyCommandspublic ScanResult<java.lang.String> scan(java.lang.String cursor, ScanParams params, java.lang.String type)
scan in interface KeyCommandspublic 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 HashCommandspublic ScanResult<java.lang.String> hscanNoValues(java.lang.String key, java.lang.String cursor, ScanParams params)
hscanNoValues in interface HashCommandspublic ScanResult<java.lang.String> sscan(java.lang.String key, java.lang.String cursor, ScanParams params)
sscan in interface SetCommandspublic ScanResult<Tuple> zscan(java.lang.String key, java.lang.String cursor, ScanParams params)
zscan in interface SortedSetCommandspublic java.lang.String readonly()
readonly in interface ClusterCommandspublic java.lang.String readwrite()
readwrite in interface ClusterCommandspublic java.lang.String clusterNodes()
clusterNodes in interface ClusterCommandspublic java.lang.String clusterMeet(java.lang.String ip,
int port)
clusterMeet in interface ClusterCommandspublic java.lang.String clusterReset()
clusterReset in interface ClusterCommandspublic java.lang.String clusterReset(ClusterResetType resetType)
ClusterCommandsresetType can be null for default behavior.clusterReset in interface ClusterCommandspublic java.lang.String clusterAddSlots(int... slots)
clusterAddSlots in interface ClusterCommandspublic java.lang.String clusterDelSlots(int... slots)
clusterDelSlots in interface ClusterCommandspublic java.lang.String clusterInfo()
clusterInfo in interface ClusterCommandspublic java.util.List<java.lang.String> clusterGetKeysInSlot(int slot,
int count)
clusterGetKeysInSlot in interface ClusterCommandspublic java.util.List<byte[]> clusterGetKeysInSlotBinary(int slot,
int count)
clusterGetKeysInSlotBinary in interface ClusterCommandspublic java.lang.String clusterSetSlotNode(int slot,
java.lang.String nodeId)
clusterSetSlotNode in interface ClusterCommandspublic java.lang.String clusterSetSlotMigrating(int slot,
java.lang.String nodeId)
clusterSetSlotMigrating in interface ClusterCommandspublic java.lang.String clusterSetSlotImporting(int slot,
java.lang.String nodeId)
clusterSetSlotImporting in interface ClusterCommandspublic java.lang.String clusterSetSlotStable(int slot)
clusterSetSlotStable in interface ClusterCommandspublic java.lang.String clusterForget(java.lang.String nodeId)
clusterForget in interface ClusterCommandspublic java.lang.String clusterFlushSlots()
clusterFlushSlots in interface ClusterCommandspublic long clusterKeySlot(java.lang.String key)
clusterKeySlot in interface ClusterCommandspublic long clusterCountFailureReports(java.lang.String nodeId)
clusterCountFailureReports in interface ClusterCommandspublic long clusterCountKeysInSlot(int slot)
clusterCountKeysInSlot in interface ClusterCommandspublic java.lang.String clusterSaveConfig()
clusterSaveConfig in interface ClusterCommandspublic java.lang.String clusterSetConfigEpoch(long configEpoch)
ClusterCommandsclusterSetConfigEpoch in interface ClusterCommandspublic java.lang.String clusterBumpEpoch()
ClusterCommandsclusterBumpEpoch in interface ClusterCommandspublic 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)
ClusterCommandsCLUSTER SLAVES command is deprecated since Redis 5.clusterSlaves in interface ClusterCommandspublic java.util.List<java.lang.String> clusterReplicas(java.lang.String nodeId)
clusterReplicas in interface ClusterCommandspublic java.lang.String clusterFailover()
clusterFailover in interface ClusterCommandspublic java.lang.String clusterFailover(ClusterFailoverOption failoverOption)
clusterFailover in interface ClusterCommands@Deprecated public java.util.List<java.lang.Object> clusterSlots()
ClusterCommandsCLUSTER SLOTS command is deprecated since Redis 7.clusterSlots in interface ClusterCommandspublic java.util.List<ClusterShardInfo> clusterShards()
ClusterCommandsCLUSTER SHARDS returns details about the shards of the cluster.
This command replaces the CLUSTER SLOTS command from Redis 7,
by providing a more efficient and extensible representation of the cluster.clusterShards in interface ClusterCommandspublic java.lang.String clusterMyId()
clusterMyId in interface ClusterCommandspublic java.lang.String clusterMyShardId()
clusterMyShardId in interface ClusterCommandspublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> clusterLinks()
ClusterCommandsclusterLinks in interface ClusterCommandspublic java.lang.String clusterAddSlotsRange(int... ranges)
ClusterCommandsclusterAddSlotsRange in interface ClusterCommandsranges - slots rangepublic java.lang.String clusterDelSlotsRange(int... ranges)
ClusterCommandsclusterDelSlotsRange in interface ClusterCommandsranges - slots rangepublic java.lang.String asking()
asking in interface ClusterCommandspublic long pfadd(java.lang.String key,
java.lang.String... elements)
pfadd in interface HyperLogLogCommandspublic long pfcount(java.lang.String key)
pfcount in interface HyperLogLogCommandspublic long pfcount(java.lang.String... keys)
pfcount in interface HyperLogLogCommandspublic java.lang.String pfmerge(java.lang.String destkey,
java.lang.String... sourcekeys)
pfmerge in interface HyperLogLogCommandspublic java.lang.Object fcall(java.lang.String name,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
FunctionCommandsfcall in interface FunctionCommandspublic java.lang.Object fcallReadonly(java.lang.String name,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args)
FunctionCommandsFCALL
command that cannot execute commands that modify data.fcallReadonly in interface FunctionCommandspublic java.lang.String functionDelete(java.lang.String libraryName)
FunctionCommandsfunctionDelete in interface FunctionCommandspublic 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 FunctionCommandsfunctionCode - the source code.public java.lang.String functionLoadReplace(java.lang.String functionCode)
FunctionCommandsfunctionLoadReplace in interface FunctionCommandsfunctionCode - the source codepublic FunctionStats functionStats()
FunctionCommandsfunctionStats in interface FunctionCommandsFunctionStatspublic java.lang.String functionFlush()
FunctionCommandsfunctionFlush in interface FunctionBinaryCommandsfunctionFlush in interface FunctionCommandspublic java.lang.String functionFlush(FlushMode mode)
FunctionCommandsfunctionFlush in interface FunctionBinaryCommandsfunctionFlush in interface FunctionCommandsmode - ASYNC: Asynchronously flush the libraries, SYNC: Synchronously flush the libraries.public java.lang.String functionKill()
FunctionCommandsfunctionKill in interface FunctionBinaryCommandsfunctionKill in interface FunctionCommandspublic java.util.List<LibraryInfo> functionList()
FunctionCommandsfunctionList in interface FunctionCommandsLibraryInfopublic java.util.List<LibraryInfo> functionList(java.lang.String libraryNamePattern)
FunctionCommandsfunctionList in interface FunctionCommandslibraryNamePattern - a pattern for matching library namesLibraryInfopublic java.util.List<LibraryInfo> functionListWithCode()
FunctionCommandsFUNCTION LIST but include the
libraries source implementation in the reply.functionListWithCode in interface FunctionCommandsLibraryInfoFunctionCommands.functionList()public java.util.List<LibraryInfo> functionListWithCode(java.lang.String libraryNamePattern)
FunctionCommandsFUNCTION LIST but include the
libraries source implementation in the reply.functionListWithCode in interface FunctionCommandslibraryNamePattern - a pattern for matching library namesLibraryInfoFunctionCommands.functionList(String)public long geoadd(java.lang.String key,
double longitude,
double latitude,
java.lang.String member)
GeoCommandsTime complexity: O(log(N)) where N is the number of elements in the sorted set.
geoadd in interface GeoCommandspublic long geoadd(java.lang.String key,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
GeoCommandsTime complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.
geoadd in interface GeoCommandsmemberCoordinateMap - Members names with their geo coordinatespublic long geoadd(java.lang.String key,
GeoAddParams params,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
GeoCommandsTime complexity: O(log(N)) for each item added
geoadd in interface GeoCommandsparams - Additional optionsmemberCoordinateMap - Members names with their geo coordinatespublic java.lang.Double geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2)
GeoCommandsTime complexity: O(log(N))
geodist in interface GeoCommandspublic java.lang.Double geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2,
GeoUnit unit)
GeoCommandsTime complexity: O(log(N))
geodist in interface GeoCommandsunit - 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)
GeoCommandsTime complexity: O(log(N)) for each member requested
geohash in interface GeoCommandspublic java.util.List<GeoCoordinate> geopos(java.lang.String key, java.lang.String... members)
GeoCommandsTime complexity: O(N) where N is the number of members requested.
geopos in interface GeoCommandspublic java.util.List<GeoRadiusResponse> georadius(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit)
GeoCommandsTime 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 GeoCommandslongitude - 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)
GeoCommandsGEORADIUS,
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 GeoCommandslongitude - 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)
GeoCommandsGeoRadiusParam:
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 GeoCommandslongitude - of the center pointlatitude - of the center pointradius - of the areaunit - can be M, KM, MI or FTparam - GeoRadiusParampublic long georadiusStore(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
GeoCommandsGEORADIUS
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 GeoCommandslongitude - of the center pointlatitude - of the center pointradius - of the areaunit - can be M, KM, MI or FTparam - GeoRadiusParamstoreParam - GeoRadiusStoreParampublic java.util.List<GeoRadiusResponse> georadiusReadonly(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
GeoCommandsGEORADIUS,
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 GeoCommandslongitude - of the center pointlatitude - of the center pointradius - of the areaunit - can be M, KM, MI or FTparam - GeoRadiusParamGeoCommands.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)
GeoCommandsGEORADIUS
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 GeoCommandsmember - 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)
GeoCommandsGEORADIUSBYMEMBER
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 GeoCommandsmember - 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)
GeoCommandsGEORADIUS
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 GeoCommandsmember - represents the center of the arearadius - of the areaunit - can be M, KM, MI or FTparam - GeoRadiusParampublic long georadiusByMemberStore(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
GeoCommandsGEORADIUSBYMEMBER
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 GeoCommandsmember - represents the center of the arearadius - of the areaunit - can be M, KM, MI or FTparam - GeoRadiusParamstoreParam - GeoRadiusStoreParampublic java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param)
GeoCommandsGEORADIUSBYMEMBER
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 GeoCommandsmember - represents the center of the arearadius - of the areaunit - can be M, KM, MI or FTparam - GeoRadiusParampublic 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 GeoCommandsmember - 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 GeoCommandscoord - 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)
GeoCommandsThe 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 GeoCommandsmember - 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)
GeoCommandsThe 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 GeoCommandscoord - 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)
GeoCommandsTime 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 GeoCommandsparams - GeoSearchParampublic long geosearchStore(java.lang.String dest,
java.lang.String src,
java.lang.String member,
double radius,
GeoUnit unit)
GeoCommandsGEOSEARCH
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 GeoCommandssrc - 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)
GeoCommandsGEOSEARCH
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 GeoCommandscoord - 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)
GeoCommandsGEOSEARCH
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 GeoCommandsmember - 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)
GeoCommandsGEOSEARCH
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 GeoCommandscoord - 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)
GeoCommandsGEOSEARCH
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 GeoCommandsparams - GeoSearchParampublic long geosearchStoreStoreDist(java.lang.String dest,
java.lang.String src,
GeoSearchParam params)
GeoCommandsGEOSEARCHSTORE
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 GeoCommandsparams - GeoSearchParampublic java.lang.String moduleLoad(java.lang.String path)
ModuleCommandsmoduleLoad in interface ModuleCommandspath - should be the absolute path of the library, including the full filenamepublic java.lang.String moduleLoad(java.lang.String path,
java.lang.String... args)
ModuleCommandsmoduleLoad in interface ModuleCommandspath - 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)
ModuleCommandsThis 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 ModuleCommandspath - should be the absolute path of the library, including the full filenameparams - as in descriptionpublic java.lang.String moduleUnload(java.lang.String name)
ModuleCommandsMODULE LIST command, and may differ from the dynamic
library's filename.moduleUnload in interface ModuleCommandspublic java.util.List<Module> moduleList()
ModuleCommandsmoduleList in interface GenericControlCommandsmoduleList in interface ModuleCommandsModulepublic java.util.List<java.lang.Long> bitfield(java.lang.String key,
java.lang.String... arguments)
BitCommandsbitfield in interface BitCommandsarguments - may be used with optional argumentspublic java.util.List<java.lang.Long> bitfieldReadonly(java.lang.String key,
java.lang.String... arguments)
BitCommandsBITFIELDbitfieldReadonly in interface BitCommandspublic long hstrlen(java.lang.String key,
java.lang.String field)
hstrlen in interface HashCommandspublic java.util.List<java.lang.Long> hexpire(java.lang.String key,
long seconds,
java.lang.String... fields)
HashCommandshexpire in interface HashCommandskey - hashseconds - time to expirepublic java.util.List<java.lang.Long> hexpire(java.lang.String key,
long seconds,
ExpiryOption condition,
java.lang.String... fields)
HashCommandshexpire in interface HashCommandskey - hashseconds - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hpexpire(java.lang.String key,
long milliseconds,
java.lang.String... fields)
HashCommandshpexpire in interface HashCommandskey - hashmilliseconds - time to expirepublic java.util.List<java.lang.Long> hpexpire(java.lang.String key,
long milliseconds,
ExpiryOption condition,
java.lang.String... fields)
HashCommandshpexpire in interface HashCommandskey - hashmilliseconds - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hexpireAt(java.lang.String key,
long unixTimeSeconds,
java.lang.String... fields)
HashCommandshexpireAt in interface HashCommandskey - hashunixTimeSeconds - time to expirepublic java.util.List<java.lang.Long> hexpireAt(java.lang.String key,
long unixTimeSeconds,
ExpiryOption condition,
java.lang.String... fields)
HashCommandshexpireAt in interface HashCommandskey - hashunixTimeSeconds - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hpexpireAt(java.lang.String key,
long unixTimeMillis,
java.lang.String... fields)
HashCommandshpexpireAt in interface HashCommandskey - hashunixTimeMillis - time to expirepublic java.util.List<java.lang.Long> hpexpireAt(java.lang.String key,
long unixTimeMillis,
ExpiryOption condition,
java.lang.String... fields)
HashCommandshpexpireAt in interface HashCommandskey - hashunixTimeMillis - time to expirecondition - can be NX, XX, GT or LTpublic java.util.List<java.lang.Long> hexpireTime(java.lang.String key,
java.lang.String... fields)
HashCommandshexpireTime in interface HashCommandskey - hashpublic java.util.List<java.lang.Long> hpexpireTime(java.lang.String key,
java.lang.String... fields)
HashCommandshpexpireTime in interface HashCommandskey - hashpublic java.util.List<java.lang.Long> httl(java.lang.String key,
java.lang.String... fields)
HashCommandshttl in interface HashCommandskey - hashpublic java.util.List<java.lang.Long> hpttl(java.lang.String key,
java.lang.String... fields)
HashCommandshpttl in interface HashCommandskey - hashpublic java.util.List<java.lang.Long> hpersist(java.lang.String key,
java.lang.String... fields)
HashCommandshpersist in interface HashCommandskey - hashpublic java.lang.String memoryDoctor()
ControlCommandsmemoryDoctor in interface ControlCommandspublic java.lang.Long memoryUsage(java.lang.String key)
KeyCommandsTime complexity: O(1)
memoryUsage in interface ControlCommandsmemoryUsage in interface KeyCommandskey - The key in Redis serverpublic java.lang.Long memoryUsage(java.lang.String key,
int samples)
KeyCommandsTime complexity: O(1)
memoryUsage in interface ControlCommandsmemoryUsage in interface KeyCommandskey - 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()
ControlCommandsmemoryPurge in interface ControlCommandspublic java.util.Map<java.lang.String,java.lang.Object> memoryStats()
ControlCommandsmemoryStats in interface ControlCommandspublic java.lang.String lolwut()
lolwut in interface ServerCommandspublic java.lang.String lolwut(LolwutParams lolwutParams)
lolwut in interface ServerCommandspublic java.lang.String reset()
reset in interface ServerCommandspublic java.lang.String latencyDoctor()
ServerCommandsThis 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 ServerCommandspublic java.util.Map<java.lang.String,LatencyLatestInfo> latencyLatest()
latencyLatest in interface ServerCommandspublic java.util.List<LatencyHistoryInfo> latencyHistory(LatencyEvent event)
latencyHistory in interface ServerCommandspublic long latencyReset(LatencyEvent... events)
latencyReset in interface ServerCommandspublic StreamEntryID xadd(java.lang.String key, StreamEntryID id, java.util.Map<java.lang.String,java.lang.String> hash)
StreamCommandsxadd in interface StreamCommandspublic StreamEntryID xadd(java.lang.String key, XAddParams params, java.util.Map<java.lang.String,java.lang.String> hash)
xadd in interface StreamCommandspublic long xlen(java.lang.String key)
StreamCommandsxlen in interface StreamCommandspublic java.util.List<StreamEntry> xrange(java.lang.String key, StreamEntryID start, StreamEntryID end)
StreamCommandsxrange in interface StreamCommandsstart - 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)
StreamCommandsxrange in interface StreamCommandsstart - 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)
StreamCommandsxrevrange in interface StreamCommandsend - 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)
StreamCommandsxrevrange in interface StreamCommandsend - 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 StreamCommandspublic java.util.List<StreamEntry> xrange(java.lang.String key, java.lang.String start, java.lang.String end, int count)
xrange in interface StreamCommandspublic java.util.List<StreamEntry> xrevrange(java.lang.String key, java.lang.String end, java.lang.String start)
xrevrange in interface StreamCommandspublic java.util.List<StreamEntry> xrevrange(java.lang.String key, java.lang.String end, java.lang.String start, int count)
xrevrange in interface StreamCommandspublic 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)
StreamCommandsxread in interface StreamCommandspublic java.util.Map<java.lang.String,java.util.List<StreamEntry>> xreadAsMap(XReadParams xReadParams, java.util.Map<java.lang.String,StreamEntryID> streams)
StreamCommandsxreadAsMap in interface StreamCommandspublic long xack(java.lang.String key,
java.lang.String group,
StreamEntryID... ids)
StreamCommandsxack in interface StreamCommandspublic java.util.List<StreamEntryDeletionResult> xackdel(java.lang.String key, java.lang.String group, StreamEntryID... ids)
StreamCommandsxackdel in interface StreamCommandspublic java.util.List<StreamEntryDeletionResult> xackdel(java.lang.String key, java.lang.String group, StreamDeletionPolicy trimMode, StreamEntryID... ids)
StreamCommandsxackdel in interface StreamCommandspublic java.lang.String xgroupCreate(java.lang.String key,
java.lang.String groupName,
StreamEntryID id,
boolean makeStream)
StreamCommandsXGROUP CREATE key groupName <id or $>xgroupCreate in interface StreamCommandspublic java.lang.String xgroupSetID(java.lang.String key,
java.lang.String groupName,
StreamEntryID id)
StreamCommandsXGROUP SETID key groupName <id or $>xgroupSetID in interface StreamCommandspublic long xgroupDestroy(java.lang.String key,
java.lang.String groupName)
StreamCommandsxgroupDestroy in interface StreamCommandspublic boolean xgroupCreateConsumer(java.lang.String key,
java.lang.String groupName,
java.lang.String consumerName)
StreamCommandsxgroupCreateConsumer in interface StreamCommandspublic long xgroupDelConsumer(java.lang.String key,
java.lang.String groupName,
java.lang.String consumerName)
StreamCommandsxgroupDelConsumer in interface StreamCommandspublic long xdel(java.lang.String key,
StreamEntryID... ids)
StreamCommandsxdel in interface StreamCommandspublic java.util.List<StreamEntryDeletionResult> xdelex(java.lang.String key, StreamEntryID... ids)
StreamCommandsxdelex in interface StreamCommandspublic java.util.List<StreamEntryDeletionResult> xdelex(java.lang.String key, StreamDeletionPolicy trimMode, StreamEntryID... ids)
StreamCommandsxdelex in interface StreamCommandspublic long xtrim(java.lang.String key,
long maxLen,
boolean approximateLength)
StreamCommandsxtrim in interface StreamCommandspublic long xtrim(java.lang.String key,
XTrimParams params)
StreamCommandsxtrim in interface StreamCommandspublic 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)
StreamCommandsxreadGroup in interface StreamCommandspublic java.util.Map<java.lang.String,java.util.List<StreamEntry>> xreadGroupAsMap(java.lang.String groupName, java.lang.String consumer, XReadGroupParams xReadGroupParams, java.util.Map<java.lang.String,StreamEntryID> streams)
StreamCommandsxreadGroupAsMap in interface StreamCommandspublic StreamPendingSummary xpending(java.lang.String key, java.lang.String groupName)
StreamCommandsxpending in interface StreamCommandspublic java.util.List<StreamPendingEntry> xpending(java.lang.String key, java.lang.String groupName, XPendingParams params)
StreamCommandsxpending in interface StreamCommandspublic java.util.List<StreamEntry> xclaim(java.lang.String key, java.lang.String group, java.lang.String consumerName, long minIdleTime, XClaimParams params, StreamEntryID... ids)
StreamCommandsXCLAIM key group consumer min-idle-time <ID-1> ... <ID-N>
[IDLE <milliseconds>] [TIME <mstime>] [RETRYCOUNT <count>]
[FORCE]xclaim in interface StreamCommandspublic java.util.List<StreamEntryID> xclaimJustId(java.lang.String key, java.lang.String group, java.lang.String consumerName, long minIdleTime, XClaimParams params, StreamEntryID... ids)
StreamCommandsXCLAIM key group consumer min-idle-time <ID-1> ... <ID-N>
[IDLE <milliseconds>] [TIME <mstime>] [RETRYCOUNT <count>]
[FORCE] JUSTIDxclaimJustId in interface StreamCommandspublic 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)
StreamCommandsxautoclaim in interface StreamCommandskey - 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 - XAutoClaimParamspublic 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)
StreamCommandsxautoclaimJustId in interface StreamCommandskey - 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 - XAutoClaimParamspublic StreamInfo xinfoStream(java.lang.String key)
StreamCommandsxinfoStream in interface StreamCommandskey - Stream nameStreamInfo that contains information about the streampublic StreamFullInfo xinfoStreamFull(java.lang.String key)
StreamCommandsxinfoStreamFull in interface StreamCommandskey - Stream nameStreamFullInfo that contains information about the streampublic StreamFullInfo xinfoStreamFull(java.lang.String key, int count)
StreamCommandsxinfoStreamFull in interface StreamCommandskey - Stream namecount - stream info countStreamFullInfo that contains information about the streampublic java.util.List<StreamGroupInfo> xinfoGroups(java.lang.String key)
StreamCommandsxinfoGroups in interface StreamCommandskey - Stream nameStreamGroupInfo containing information about groupspublic java.util.List<StreamConsumersInfo> xinfoConsumers(java.lang.String key, java.lang.String group)
StreamCommandsxinfoConsumers in interface StreamCommandskey - 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)
StreamCommandsxinfoConsumers2 in interface StreamCommandskey - 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)
FunctionBinaryCommandsfcall in interface FunctionBinaryCommandspublic java.lang.Object fcallReadonly(byte[] name,
java.util.List<byte[]> keys,
java.util.List<byte[]> args)
fcallReadonly in interface FunctionBinaryCommandspublic java.lang.String functionDelete(byte[] libraryName)
FunctionBinaryCommandsfunctionDelete in interface FunctionBinaryCommandspublic byte[] functionDump()
FunctionCommandsFUNCTION RESTORE command.functionDump in interface FunctionBinaryCommandsfunctionDump in interface FunctionCommandspublic java.util.List<java.lang.Object> functionListBinary()
FunctionBinaryCommandsfunctionListBinary in interface FunctionBinaryCommandsLibraryInfopublic java.util.List<java.lang.Object> functionList(byte[] libraryNamePattern)
FunctionBinaryCommandsfunctionList in interface FunctionBinaryCommandslibraryNamePattern - a pattern for matching library namesLibraryInfopublic java.util.List<java.lang.Object> functionListWithCodeBinary()
FunctionBinaryCommandsFUNCTION LIST but include the
libraries source implementation in the reply.functionListWithCodeBinary in interface FunctionBinaryCommandsLibraryInfoFunctionCommands.functionList()public java.util.List<java.lang.Object> functionListWithCode(byte[] libraryNamePattern)
FunctionBinaryCommandsFUNCTION LIST but include the
libraries source implementation in the reply.functionListWithCode in interface FunctionBinaryCommandslibraryNamePattern - a pattern for matching library namesLibraryInfoFunctionBinaryCommands.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 FunctionBinaryCommandsfunctionCode - the source code.public java.lang.String functionLoadReplace(byte[] functionCode)
FunctionBinaryCommandsfunctionLoadReplace in interface FunctionBinaryCommandsfunctionCode - the source codepublic java.lang.String functionRestore(byte[] serializedValue)
FunctionCommandsfunctionRestore in interface FunctionBinaryCommandsfunctionRestore in interface FunctionCommandsserializedValue - the serialized payloadpublic java.lang.String functionRestore(byte[] serializedValue,
FunctionRestorePolicy policy)
FunctionCommandsfunctionRestore in interface FunctionBinaryCommandsfunctionRestore in interface FunctionCommandsserializedValue - the serialized payloadpolicy - can be FLUSH, APPEND or REPLACEpublic java.lang.Object functionStatsBinary()
FunctionBinaryCommandsfunctionStatsBinary in interface FunctionBinaryCommandsFunctionStatspublic java.lang.Object sendCommand(ProtocolCommand cmd, java.lang.String... args)
public java.lang.Object sendBlockingCommand(ProtocolCommand cmd, java.lang.String... args)
public boolean vadd(java.lang.String key,
float[] vector,
java.lang.String element)
VectorSetCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vadd in interface VectorSetCommandskey - the name of the key that will hold the vector set datavector - the vector as floating point numberselement - the name of the element that is being added to the vector setpublic boolean vadd(java.lang.String key,
float[] vector,
java.lang.String element,
VAddParams params)
VectorSetCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vadd in interface VectorSetCommandskey - the name of the key that will hold the vector set datavector - the vector as floating point numberselement - the name of the element that is being added to the vector setparams - additional parameters for the VADD commandpublic boolean vaddFP32(java.lang.String key,
byte[] vectorBlob,
java.lang.String element)
VectorSetCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vaddFP32 in interface VectorSetCommandskey - the name of the key that will hold the vector set datavectorBlob - the vector as FP32 binary blobelement - the name of the element that is being added to the vector setpublic boolean vaddFP32(java.lang.String key,
byte[] vectorBlob,
java.lang.String element,
VAddParams params)
VectorSetCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vaddFP32 in interface VectorSetCommandskey - the name of the key that will hold the vector set datavectorBlob - the vector as FP32 binary blobelement - the name of the element that is being added to the vector setparams - additional parameters for the VADD commandpublic boolean vadd(java.lang.String key,
float[] vector,
java.lang.String element,
int reduceDim,
VAddParams params)
VectorSetCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vadd in interface VectorSetCommandskey - the name of the key that will hold the vector set datavector - the vector as floating point numberselement - the name of the element that is being added to the vector setreduceDim - the target dimension after reduction using random projectionparams - additional parameters for the VADD commandpublic boolean vaddFP32(java.lang.String key,
byte[] vectorBlob,
java.lang.String element,
int reduceDim,
VAddParams params)
VectorSetCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vaddFP32 in interface VectorSetCommandskey - the name of the key that will hold the vector set datavectorBlob - the vector as FP32 binary blobelement - the name of the element that is being added to the vector setreduceDim - the target dimension after reduction using random projectionparams - additional parameters for the VADD commandpublic java.util.List<java.lang.String> vsim(java.lang.String key,
float[] vector)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsim in interface VectorSetCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referencepublic java.util.List<java.lang.String> vsim(java.lang.String key,
float[] vector,
VSimParams params)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsim in interface VectorSetCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referenceparams - additional parameters for the VSIM commandpublic java.util.Map<java.lang.String,java.lang.Double> vsimWithScores(java.lang.String key,
float[] vector,
VSimParams params)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimWithScores in interface VectorSetCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES will be automatically
added)public java.util.Map<java.lang.String,VSimScoreAttribs> vsimWithScoresAndAttribs(java.lang.String key, float[] vector, VSimParams params)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimWithScoresAndAttribs in interface VectorSetCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES and WITHATTRIBS will be
automatically added)public java.util.List<java.lang.String> vsimByElement(java.lang.String key,
java.lang.String element)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElement in interface VectorSetCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referencepublic java.util.List<java.lang.String> vsimByElement(java.lang.String key,
java.lang.String element,
VSimParams params)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElement in interface VectorSetCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referenceparams - additional parameters for the VSIM commandpublic java.util.Map<java.lang.String,java.lang.Double> vsimByElementWithScores(java.lang.String key,
java.lang.String element,
VSimParams params)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElementWithScores in interface VectorSetCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES will be automatically
added)public java.util.Map<java.lang.String,VSimScoreAttribs> vsimByElementWithScoresAndAttribs(java.lang.String key, java.lang.String element, VSimParams params)
VectorSetCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElementWithScoresAndAttribs in interface VectorSetCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES and WITHATTRIBS will be
automatically added)public long vdim(java.lang.String key)
VectorSetCommandsTime complexity: O(1)
vdim in interface VectorSetCommandskey - the name of the key that holds the vector setpublic long vcard(java.lang.String key)
VectorSetCommandsTime complexity: O(1)
vcard in interface VectorSetCommandskey - the name of the key that holds the vector setpublic java.util.List<java.lang.Double> vemb(java.lang.String key,
java.lang.String element)
VectorSetCommandsTime complexity: O(1)
vemb in interface VectorSetCommandskey - the name of the key that holds the vector setelement - the name of the element whose vector you want to retrievepublic RawVector vembRaw(java.lang.String key, java.lang.String element)
VectorSetCommandsTime complexity: O(1)
vembRaw in interface VectorSetCommandskey - the name of the key that holds the vector setelement - the name of the element whose vector you want to retrievepublic boolean vrem(java.lang.String key,
java.lang.String element)
VectorSetCommandsTime complexity: O(log(N)) for each element removed, where N is the number of elements in the vector set
vrem in interface VectorSetCommandskey - the name of the key that holds the vector setelement - the name of the element to remove from the vector setpublic java.util.List<java.util.List<java.lang.String>> vlinks(java.lang.String key,
java.lang.String element)
VectorSetCommandsTime complexity: O(1)
vlinks in interface VectorSetCommandskey - the name of the key that holds the vector setelement - the name of the element whose HNSW neighbors you want to inspectpublic java.util.List<java.util.Map<java.lang.String,java.lang.Double>> vlinksWithScores(java.lang.String key,
java.lang.String element)
VectorSetCommandsTime complexity: O(1)
vlinksWithScores in interface VectorSetCommandskey - the name of the key that holds the vector setelement - the name of the element whose HNSW neighbors you want to inspectpublic java.lang.String vrandmember(java.lang.String key)
VectorSetCommandsTime complexity: O(1)
vrandmember in interface VectorSetCommandskey - the name of the key that holds the vector setpublic java.util.List<java.lang.String> vrandmember(java.lang.String key,
int count)
VectorSetCommandsTime complexity: O(N) where N is the absolute value of the count argument
vrandmember in interface VectorSetCommandskey - the name of the key that holds the vector setcount - the number of elements to return. Positive values return distinct elements;
negative values allow duplicatespublic java.lang.String vgetattr(java.lang.String key,
java.lang.String element)
VectorSetCommandsTime complexity: O(1)
vgetattr in interface VectorSetCommandskey - the name of the key that holds the vector setelement - the name of the element whose attributes to retrievepublic boolean vsetattr(java.lang.String key,
java.lang.String element,
java.lang.String attributes)
VectorSetCommandsTime complexity: O(1)
vsetattr in interface VectorSetCommandskey - the name of the key that holds the vector setelement - the name of the element whose attributes to setattributes - the attributes to set as a JSON stringpublic VectorInfo vinfo(java.lang.String key)
VectorSetCommandsTime complexity: O(1)
vinfo in interface VectorSetCommandskey - the name of the key that holds the vector setpublic boolean vadd(byte[] key,
float[] vector,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vadd in interface VectorSetBinaryCommandskey - the name of the key that will hold the vector set datavector - the vector as floating point numberselement - the name of the element that is being added to the vector setpublic boolean vadd(byte[] key,
float[] vector,
byte[] element,
VAddParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vadd in interface VectorSetBinaryCommandskey - the name of the key that will hold the vector set datavector - the vector as floating point numberselement - the name of the element that is being added to the vector setparams - additional parameters for the VADD commandpublic boolean vaddFP32(byte[] key,
byte[] vectorBlob,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vaddFP32 in interface VectorSetBinaryCommandskey - the name of the key that will hold the vector set datavectorBlob - the vector as FP32 binary blobelement - the name of the element that is being added to the vector setpublic boolean vaddFP32(byte[] key,
byte[] vectorBlob,
byte[] element,
VAddParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vaddFP32 in interface VectorSetBinaryCommandskey - the name of the key that will hold the vector set datavectorBlob - the vector as FP32 binary blobelement - the name of the element that is being added to the vector setparams - additional parameters for the VADD commandpublic boolean vadd(byte[] key,
float[] vector,
byte[] element,
int reduceDim,
VAddParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vadd in interface VectorSetBinaryCommandskey - the name of the key that will hold the vector set datavector - the vector as floating point numberselement - the name of the element that is being added to the vector setreduceDim - the target dimension after reduction using random projectionparams - additional parameters for the VADD commandpublic boolean vaddFP32(byte[] key,
byte[] vectorBlob,
byte[] element,
int reduceDim,
VAddParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) for each element added, where N is the number of elements in the vector set.
vaddFP32 in interface VectorSetBinaryCommandskey - the name of the key that will hold the vector set datavectorBlob - the vector as FP32 binary blobelement - the name of the element that is being added to the vector setreduceDim - the target dimension after reduction using random projectionparams - additional parameters for the VADD commandpublic java.util.List<byte[]> vsim(byte[] key,
float[] vector)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsim in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referencepublic java.util.List<byte[]> vsim(byte[] key,
float[] vector,
VSimParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsim in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referenceparams - additional parameters for the VSIM commandpublic java.util.Map<byte[],java.lang.Double> vsimWithScores(byte[] key,
float[] vector,
VSimParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimWithScores in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES will be automatically
added)public java.util.Map<byte[],VSimScoreAttribs> vsimWithScoresAndAttribs(byte[] key, float[] vector, VSimParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimWithScoresAndAttribs in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set datavector - the vector to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES and WITHATTRIBS will be
automatically added)public java.util.List<byte[]> vsimByElement(byte[] key,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElement in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referencepublic java.util.List<byte[]> vsimByElement(byte[] key,
byte[] element,
VSimParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElement in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referenceparams - additional parameters for the VSIM commandpublic java.util.Map<byte[],java.lang.Double> vsimByElementWithScores(byte[] key,
byte[] element,
VSimParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElementWithScores in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES will be automatically
added)public java.util.Map<byte[],VSimScoreAttribs> vsimByElementWithScoresAndAttribs(byte[] key, byte[] element, VSimParams params)
VectorSetBinaryCommandsTime complexity: O(log(N)) where N is the number of elements in the vector set.
vsimByElementWithScoresAndAttribs in interface VectorSetBinaryCommandskey - the name of the key that holds the vector set dataelement - the name of the element to use as similarity referenceparams - additional parameters for the VSIM command (WITHSCORES and WITHATTRIBS will be
automatically added)public long vdim(byte[] key)
VectorSetBinaryCommandsTime complexity: O(1)
vdim in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setpublic long vcard(byte[] key)
VectorSetBinaryCommandsTime complexity: O(1)
vcard in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setpublic java.util.List<java.lang.Double> vemb(byte[] key,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(1)
vemb in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setelement - the name of the element whose vector you want to retrievepublic RawVector vembRaw(byte[] key, byte[] element)
VectorSetBinaryCommandsTime complexity: O(1)
vembRaw in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setelement - the name of the element whose vector you want to retrievepublic boolean vrem(byte[] key,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(log(N)) for each element removed, where N is the number of elements in the vector set
vrem in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setelement - the name of the element to remove from the vector setpublic java.util.List<java.util.List<byte[]>> vlinks(byte[] key,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(1)
vlinks in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setelement - the name of the element whose HNSW neighbors you want to inspectpublic java.util.List<java.util.Map<byte[],java.lang.Double>> vlinksWithScores(byte[] key,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(1)
vlinksWithScores in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setelement - the name of the element whose HNSW neighbors you want to inspectpublic byte[] vrandmember(byte[] key)
VectorSetBinaryCommandsTime complexity: O(1)
vrandmember in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setpublic java.util.List<byte[]> vrandmember(byte[] key,
int count)
VectorSetBinaryCommandsTime complexity: O(N) where N is the absolute value of the count argument
vrandmember in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setcount - the number of elements to return. Positive values return distinct elements;
negative values allow duplicatespublic byte[] vgetattr(byte[] key,
byte[] element)
VectorSetBinaryCommandsTime complexity: O(1)
vgetattr in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setelement - the name of the element whose attributes to retrievepublic boolean vsetattr(byte[] key,
byte[] element,
byte[] attributes)
VectorSetBinaryCommandsTime complexity: O(1)
vsetattr in interface VectorSetBinaryCommandskey - the name of the key that holds the vector setelement - the name of the element whose attributes to setattributes - the attributes to set as a JSON stringCopyright © 2025. All rights reserved.