public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommands, AdvancedJedisCommands, ScriptingCommands, BasicCommands, ClusterCommands, SentinelCommands, ModuleCommands
构造器和说明 |
---|
Jedis() |
Jedis(HostAndPort hp) |
Jedis(HostAndPort hp,
JedisClientConfig config) |
Jedis(JedisShardInfo shardInfo) |
Jedis(JedisSocketFactory jedisSocketFactory)
已过时。
This constructor will be removed in future major release.
Use
Jedis(redis.clients.jedis.JedisSocketFactory, redis.clients.jedis.JedisClientConfig) . |
Jedis(JedisSocketFactory jedisSocketFactory,
JedisClientConfig clientConfig) |
Jedis(java.lang.String uri)
已过时。
This constructor will not support a host string in future. It will accept only a
uri string.
JedisURIHelper#isValid(java.net.URI) can used before this. If this
constructor was being used with a host, it can be replaced with
Jedis(java.lang.String, int) with the host and Protocol.DEFAULT_PORT . |
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.net.URI uri) |
Jedis(java.net.URI uri,
int timeout) |
Jedis(java.net.URI uri,
int connectionTimeout,
int soTimeout) |
Jedis(java.net.URI uri,
int connectionTimeout,
int soTimeout,
int infiniteSoTimeout,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.net.URI uri,
int connectionTimeout,
int soTimeout,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.net.URI uri,
int timeout,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
Jedis(java.net.URI uri,
JedisClientConfig config) |
Jedis(java.net.URI uri,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.SSLParameters sslParameters,
javax.net.ssl.HostnameVerifier hostnameVerifier) |
限定符和类型 | 方法和说明 |
---|---|
java.util.List<java.lang.String> |
aclCat() |
java.util.List<java.lang.String> |
aclCat(java.lang.String category) |
java.lang.Long |
aclDelUser(java.lang.String name) |
java.lang.String |
aclGenPass() |
AccessControlUser |
aclGetUser(java.lang.String name) |
java.util.List<java.lang.String> |
aclList() |
java.lang.String |
aclLoad() |
java.util.List<AccessControlLogEntry> |
aclLog() |
java.util.List<AccessControlLogEntry> |
aclLog(int limit) |
java.lang.String |
aclLog(java.lang.String options) |
java.lang.String |
aclSave() |
java.lang.String |
aclSetUser(java.lang.String name) |
java.lang.String |
aclSetUser(java.lang.String name,
java.lang.String... params) |
java.util.List<java.lang.String> |
aclUsers() |
java.lang.String |
aclWhoAmI() |
java.lang.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.Long |
bitcount(java.lang.String key) |
java.lang.Long |
bitcount(java.lang.String key,
long start,
long end) |
java.util.List<java.lang.Long> |
bitfield(java.lang.String key,
java.lang.String... arguments)
Executes BITFIELD Redis command
|
java.util.List<java.lang.Long> |
bitfieldReadonly(java.lang.String key,
java.lang.String... arguments) |
java.lang.Long |
bitop(BitOP op,
java.lang.String destKey,
java.lang.String... srcKeys) |
java.lang.Long |
bitpos(java.lang.String key,
boolean value) |
java.lang.Long |
bitpos(java.lang.String key,
boolean value,
BitPosParams params) |
java.lang.String |
blmove(java.lang.String srcKey,
java.lang.String dstKey,
ListDirection from,
ListDirection to,
double timeout) |
KeyedListElement |
blpop(double timeout,
java.lang.String... keys) |
KeyedListElement |
blpop(double timeout,
java.lang.String key) |
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) |
java.util.List<java.lang.String> |
blpop(java.lang.String... args) |
KeyedListElement |
brpop(double timeout,
java.lang.String... keys) |
KeyedListElement |
brpop(double timeout,
java.lang.String key) |
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) |
java.util.List<java.lang.String> |
brpop(java.lang.String... args) |
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
|
KeyedZSetElement |
bzpopmax(double timeout,
java.lang.String... keys) |
KeyedZSetElement |
bzpopmin(double timeout,
java.lang.String... keys) |
java.lang.String |
clientGetname() |
java.lang.Long |
clientId() |
java.lang.String |
clientInfo() |
java.lang.String |
clientKill(java.lang.String ipPort) |
java.lang.String |
clientList() |
java.lang.String |
clientList(long... clientIds) |
java.lang.String |
clientSetname(java.lang.String name) |
java.lang.Long |
clientUnblock(long clientId,
UnblockType unblockType)
Unblock a client blocked in a blocking command from a different connection.
|
void |
close() |
java.lang.String |
clusterAddSlots(int... slots) |
java.lang.Long |
clusterCountKeysInSlot(int slot) |
java.lang.String |
clusterDelSlots(int... slots) |
java.lang.String |
clusterFailover() |
java.lang.String |
clusterFlushSlots() |
java.lang.String |
clusterForget(java.lang.String nodeId) |
java.util.List<java.lang.String> |
clusterGetKeysInSlot(int slot,
int count) |
java.lang.String |
clusterInfo() |
java.lang.Long |
clusterKeySlot(java.lang.String key) |
java.lang.String |
clusterMeet(java.lang.String ip,
int port) |
java.lang.String |
clusterNodes() |
java.lang.String |
clusterReplicate(java.lang.String nodeId) |
java.lang.String |
clusterReset(ClusterReset resetType) |
java.lang.String |
clusterSaveConfig() |
java.lang.String |
clusterSetSlotImporting(int slot,
java.lang.String nodeId) |
java.lang.String |
clusterSetSlotMigrating(int slot,
java.lang.String nodeId) |
java.lang.String |
clusterSetSlotNode(int slot,
java.lang.String nodeId) |
java.lang.String |
clusterSetSlotStable(int slot) |
java.util.List<java.lang.String> |
clusterSlaves(java.lang.String nodeId) |
java.util.List<java.lang.Object> |
clusterSlots() |
java.util.List<java.lang.String> |
configGet(java.lang.String pattern)
Retrieve the configuration of a running Redis server.
|
java.lang.String |
configSet(java.lang.String parameter,
java.lang.String value)
Alter the configuration of a running Redis server.
|
java.lang.Boolean |
copy(java.lang.String srcKey,
java.lang.String dstKey,
boolean replace)
COPY source destination [DB destination-db] [REPLACE]
|
java.lang.Boolean |
copy(java.lang.String srcKey,
java.lang.String dstKey,
int db,
boolean replace)
COPY source destination [DB destination-db] [REPLACE]
|
java.lang.Long |
decr(java.lang.String key)
Decrement the number stored at key by one.
|
java.lang.Long |
decrBy(java.lang.String key,
long decrement)
IDECRBY work just like
INCR but instead to decrement by 1 the decrement
is integer. |
java.lang.Long |
del(java.lang.String... keys)
Remove the specified keys.
|
java.lang.Long |
del(java.lang.String key) |
byte[] |
dump(java.lang.String key) |
java.lang.String |
echo(java.lang.String string) |
java.lang.Object |
eval(java.lang.String script) |
java.lang.Object |
eval(java.lang.String script,
int keyCount,
java.lang.String... params) |
java.lang.Object |
eval(java.lang.String script,
java.util.List<java.lang.String> keys,
java.util.List<java.lang.String> args) |
java.lang.Object |
evalsha(java.lang.String sha1) |
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) |
java.lang.Long |
exists(java.lang.String... keys)
Test if the specified keys exist.
|
java.lang.Boolean |
exists(java.lang.String key)
Test if the specified key exists.
|
java.lang.Long |
expire(java.lang.String key,
long seconds)
Set a timeout on the specified key.
|
java.lang.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). |
java.lang.Long |
geoadd(java.lang.String key,
double longitude,
double latitude,
java.lang.String member) |
java.lang.Long |
geoadd(java.lang.String key,
GeoAddParams params,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap) |
java.lang.Long |
geoadd(java.lang.String key,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap) |
java.lang.Double |
geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2) |
java.lang.Double |
geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2,
GeoUnit unit) |
java.util.List<java.lang.String> |
geohash(java.lang.String key,
java.lang.String... members) |
java.util.List<GeoCoordinate> |
geopos(java.lang.String key,
java.lang.String... members) |
java.util.List<GeoRadiusResponse> |
georadius(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadius(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.util.List<GeoRadiusResponse> |
georadiusByMember(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadiusByMember(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.lang.Long |
georadiusByMemberStore(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam) |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit) |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param) |
java.lang.Long |
georadiusStore(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam) |
java.lang.String |
get(java.lang.String key)
Get the value of the specified key.
|
java.lang.Boolean |
getbit(java.lang.String key,
long offset)
Returns the bit value at offset in the string value stored at key
|
java.lang.String |
getDel(java.lang.String key)
Get the value of key and delete the key.
|
java.lang.String |
getEx(java.lang.String key,
GetExParams params) |
java.lang.String |
getrange(java.lang.String key,
long startOffset,
long endOffset) |
java.lang.String |
getSet(java.lang.String key,
java.lang.String value)
GETSET is an atomic set this value and return the old value command.
|
java.lang.Long |
hdel(java.lang.String key,
java.lang.String... fields)
Remove the specified field from an hash stored at key.
|
java.lang.Boolean |
hexists(java.lang.String key,
java.lang.String field)
Test for existence of a specified field in a hash.
|
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<java.lang.String,java.lang.String> |
hgetAll(java.lang.String key)
Return all the fields and associated values in a hash.
|
java.lang.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.
|
java.lang.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<java.lang.String> |
hkeys(java.lang.String key)
Return all the fields in a hash.
|
java.lang.Long |
hlen(java.lang.String key)
Return the number of items in a hash.
|
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(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> hash)
Set the respective fields to the respective values.
|
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.Map<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<java.lang.String,java.lang.String>> |
hscan(java.lang.String key,
java.lang.String cursor) |
ScanResult<java.util.Map.Entry<java.lang.String,java.lang.String>> |
hscan(java.lang.String key,
java.lang.String cursor,
ScanParams params) |
java.lang.Long |
hset(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> hash) |
java.lang.Long |
hset(java.lang.String key,
java.lang.String field,
java.lang.String value)
Set the specified hash field to the specified value.
|
java.lang.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.
|
java.lang.Long |
hstrlen(java.lang.String key,
java.lang.String field)
Used for HSTRLEN Redis command
|
java.util.List<java.lang.String> |
hvals(java.lang.String key)
Return all the values in a hash.
|
java.lang.Long |
incr(java.lang.String key)
Increment the number stored at key by one.
|
java.lang.Long |
incrBy(java.lang.String key,
long increment)
INCRBY work just like
INCR but instead to increment by 1 the increment is
integer. |
java.lang.Double |
incrByFloat(java.lang.String key,
double increment)
INCRBYFLOAT
INCRBYFLOAT commands are limited to double precision floating point values.
|
java.util.Set<java.lang.String> |
keys(java.lang.String pattern)
Returns all the keys matching the glob-style pattern.
|
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.
|
java.lang.Long |
linsert(java.lang.String key,
ListPosition where,
java.lang.String pivot,
java.lang.String value) |
java.lang.Long |
llen(java.lang.String key)
Return the length of the list stored at the specified key.
|
java.lang.String |
lmove(java.lang.String srcKey,
java.lang.String dstKey,
ListDirection from,
ListDirection to) |
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) |
java.lang.Long |
lpos(java.lang.String key,
java.lang.String element) |
java.lang.Long |
lpos(java.lang.String key,
java.lang.String element,
LPosParams params) |
java.util.List<java.lang.Long> |
lpos(java.lang.String key,
java.lang.String element,
LPosParams params,
long count) |
java.lang.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.
|
java.lang.Long |
lpushx(java.lang.String key,
java.lang.String... string) |
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.
|
java.lang.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(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(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() |
java.lang.Long |
memoryUsage(java.lang.String key) |
java.lang.Long |
memoryUsage(java.lang.String key,
int samples) |
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,
int destinationDB,
int timeout,
MigrateParams params,
java.lang.String... keys) |
java.lang.String |
migrate(java.lang.String host,
int port,
java.lang.String key,
int destinationDb,
int timeout) |
java.util.List<Module> |
moduleList() |
java.lang.String |
moduleLoad(java.lang.String path) |
java.lang.String |
moduleUnload(java.lang.String name) |
java.lang.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(java.lang.String... keysvalues)
Set the the respective keys to the respective values.
|
java.lang.Long |
msetnx(java.lang.String... keysvalues)
Set the the respective keys to the respective values.
|
java.lang.String |
objectEncoding(java.lang.String key) |
java.lang.Long |
objectFreq(java.lang.String key) |
java.util.List<java.lang.String> |
objectHelp() |
java.lang.Long |
objectIdletime(java.lang.String key) |
java.lang.Long |
objectRefcount(java.lang.String key) |
java.lang.Long |
persist(java.lang.String key)
Undo a
expire at turning the expire key into a normal key. |
java.lang.Long |
pexpire(java.lang.String key,
long milliseconds) |
java.lang.Long |
pexpireAt(java.lang.String key,
long millisecondsTimestamp) |
java.lang.Long |
pfadd(java.lang.String key,
java.lang.String... elements) |
long |
pfcount(java.lang.String... keys) |
long |
pfcount(java.lang.String key) |
java.lang.String |
pfmerge(java.lang.String destkey,
java.lang.String... sourcekeys) |
java.lang.String |
ping(java.lang.String message)
Works same as ping() but returns argument message instead of PONG.
|
java.lang.String |
psetex(java.lang.String key,
long milliseconds,
java.lang.String value)
PSETEX works exactly like
JedisCommands.setex(String, int, String) with the sole difference that the
expire time is specified in milliseconds instead of seconds. |
void |
psubscribe(JedisPubSub jedisPubSub,
java.lang.String... patterns) |
java.lang.Long |
pttl(java.lang.String key) |
java.lang.Long |
publish(java.lang.String channel,
java.lang.String message) |
java.util.List<java.lang.String> |
pubsubChannels(java.lang.String pattern) |
java.lang.Long |
pubsubNumPat() |
java.util.Map<java.lang.String,java.lang.String> |
pubsubNumSub(java.lang.String... channels) |
java.lang.String |
randomKey()
Return a randomly selected key from the currently selected DB.
|
java.lang.String |
readonly() |
java.lang.String |
rename(java.lang.String oldkey,
java.lang.String newkey)
Atomically renames the key oldkey to newkey.
|
java.lang.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 |
restore(java.lang.String key,
long ttl,
byte[] serializedValue) |
java.lang.String |
restore(java.lang.String key,
long ttl,
byte[] serializedValue,
RestoreParams params) |
java.lang.String |
restoreReplace(java.lang.String key,
long ttl,
byte[] serializedValue) |
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) |
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.
|
java.lang.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.
|
java.lang.Long |
rpushx(java.lang.String key,
java.lang.String... string) |
java.lang.Long |
sadd(java.lang.String key,
java.lang.String... members)
Add the specified member to the set value stored at key.
|
ScanResult<java.lang.String> |
scan(java.lang.String cursor) |
ScanResult<java.lang.String> |
scan(java.lang.String cursor,
ScanParams params)
Iterates the set of keys in the currently selected Redis database.
|
java.lang.Long |
scard(java.lang.String key)
Return the set cardinality (number of elements).
|
java.util.List<java.lang.Boolean> |
scriptExists(java.lang.String... sha1) |
java.lang.Boolean |
scriptExists(java.lang.String sha1) |
java.lang.String |
scriptLoad(java.lang.String script) |
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.
|
java.lang.Long |
sdiffstore(java.lang.String dstkey,
java.lang.String... keys)
This command works exactly like {@link #sdiff(String...)
|
java.lang.Object |
sendBlockingCommand(ProtocolCommand cmd,
java.lang.String... 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.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 |
sentinelRemove(java.lang.String masterName) |
java.lang.Long |
sentinelReset(java.lang.String pattern)
redis 127.0.0.1:26381> sentinel reset mymaster
(integer) 1
|
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)
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"
|
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.
|
java.lang.Boolean |
setbit(java.lang.String key,
long offset,
boolean value)
Sets or clears the bit at offset in the string value stored at key
|
java.lang.Boolean |
setbit(java.lang.String key,
long offset,
java.lang.String value) |
void |
setDataSource(JedisPoolAbstract jedisPool) |
java.lang.String |
setex(java.lang.String key,
long seconds,
java.lang.String value)
|
java.lang.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. |
java.lang.Long |
setrange(java.lang.String key,
long offset,
java.lang.String value) |
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.
|
java.lang.Long |
sinterstore(java.lang.String dstkey,
java.lang.String... keys)
This command works exactly like {@link #sinter(String...)
|
java.lang.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.util.List<Slowlog> |
slowlogGet() |
java.util.List<Slowlog> |
slowlogGet(long entries) |
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(java.lang.String key,
java.lang.String... members)
Returns whether each member is a member of the set stored at key.
|
java.lang.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<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 sortingParameters)
Sort a Set or a List accordingly to the specified parameters.
|
java.lang.Long |
sort(java.lang.String key,
SortingParams sortingParameters,
java.lang.String dstkey)
Sort a Set or a List accordingly to the specified parameters and store the result at dstkey.
|
java.lang.Long |
sort(java.lang.String key,
java.lang.String dstkey)
Sort a Set or a List and Store the Result at dstkey.
|
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) |
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.
|
java.lang.Long |
srem(java.lang.String key,
java.lang.String... members)
Remove the specified member from the set value stored at key.
|
ScanResult<java.lang.String> |
sscan(java.lang.String key,
java.lang.String cursor) |
ScanResult<java.lang.String> |
sscan(java.lang.String key,
java.lang.String cursor,
ScanParams params) |
java.lang.Long |
strlen(java.lang.String key) |
void |
subscribe(JedisPubSub jedisPubSub,
java.lang.String... channels) |
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<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.
|
java.lang.Long |
sunionstore(java.lang.String dstkey,
java.lang.String... keys)
This command works exactly like {@link #sunion(String...)
|
java.lang.Long |
touch(java.lang.String... keys)
Alters the last access time of a key(s).
|
java.lang.Long |
touch(java.lang.String key) |
java.lang.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(java.lang.String key)
Return the type of the value stored at key in form of a string.
|
java.lang.Long |
unlink(java.lang.String... keys)
This command is very similar to DEL: it removes the specified keys.
|
java.lang.Long |
unlink(java.lang.String key) |
java.lang.String |
watch(java.lang.String... keys) |
long |
xack(java.lang.String key,
java.lang.String group,
StreamEntryID... ids)
XACK key group ID [ID ...]
|
StreamEntryID |
xadd(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> hash,
XAddParams params)
XADD key [NOMKSTREAM] [MAXLEN|MINID [=|~] threshold [LIMIT count]] *|ID field value [field value ...]
|
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,
StreamEntryID id,
java.util.Map<java.lang.String,java.lang.String> hash,
long maxLen,
boolean approximateLength)
XADD key MAXLEN ~ LEN ID field string [field string ...]
|
java.util.List<StreamEntry> |
xclaim(java.lang.String key,
java.lang.String group,
java.lang.String consumername,
long minIdleTime,
long newIdleTime,
int retries,
boolean force,
StreamEntryID... ids)
XCLAIM
|
java.util.List<StreamEntry> |
xclaim(java.lang.String key,
java.lang.String group,
java.lang.String consumername,
long minIdleTime,
XClaimParams params,
StreamEntryID... ids)
XCLAIM
|
java.util.List<StreamEntryID> |
xclaimJustId(java.lang.String key,
java.lang.String group,
java.lang.String consumername,
long minIdleTime,
XClaimParams params,
StreamEntryID... ids)
XCLAIM
|
long |
xdel(java.lang.String key,
StreamEntryID... ids)
XDEL key ID [ID ...]
|
java.lang.String |
xgroupCreate(java.lang.String key,
java.lang.String groupname,
StreamEntryID id,
boolean makeStream)
XGROUP CREATE
|
java.lang.Long |
xgroupDelConsumer(java.lang.String key,
java.lang.String groupname,
java.lang.String consumerName)
XGROUP DELCONSUMER
|
long |
xgroupDestroy(java.lang.String key,
java.lang.String groupname)
XGROUP DESTROY
|
java.lang.String |
xgroupSetID(java.lang.String key,
java.lang.String groupname,
StreamEntryID id)
XGROUP SETID
|
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<StreamGroupInfo> |
xinfoGroup(java.lang.String key)
Introspection command used in order to retrieve different information about groups in the stream
|
StreamInfo |
xinfoStream(java.lang.String key)
Introspection command used in order to retrieve different information about the stream
|
java.lang.Long |
xlen(java.lang.String key)
XLEN key
|
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,
StreamEntryID start,
StreamEntryID end,
int count,
java.lang.String consumername)
XPENDING key group [start end count] [consumer]
|
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<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<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> |
xread(int count,
long block,
java.util.Map.Entry<java.lang.String,StreamEntryID>... streams)
XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...]
|
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) |
java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> |
xreadGroup(java.lang.String groupname,
java.lang.String consumer,
int count,
long block,
boolean noAck,
java.util.Map.Entry<java.lang.String,StreamEntryID>... streams)
XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...]
|
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) |
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
|
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]
|
java.lang.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.
|
java.lang.Long |
zadd(java.lang.String key,
double score,
java.lang.String member,
ZAddParams params) |
java.lang.Long |
zadd(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Double> scoreMembers) |
java.lang.Long |
zadd(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Double> scoreMembers,
ZAddParams params) |
java.lang.Double |
zaddIncr(java.lang.String key,
double score,
java.lang.String member,
ZAddParams params) |
java.lang.Long |
zcard(java.lang.String key)
Return the sorted set cardinality (number of elements).
|
java.lang.Long |
zcount(java.lang.String key,
double min,
double max) |
java.lang.Long |
zcount(java.lang.String key,
java.lang.String min,
java.lang.String max) |
java.util.Set<java.lang.String> |
zdiff(java.lang.String... keys) |
java.lang.Long |
zdiffStore(java.lang.String dstkey,
java.lang.String... keys) |
java.util.Set<Tuple> |
zdiffWithScores(java.lang.String... keys) |
java.lang.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) |
java.util.Set<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 client.
|
java.lang.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.
|
java.lang.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.Set<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 client.
|
java.lang.Long |
zlexcount(java.lang.String key,
java.lang.String min,
java.lang.String max) |
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(java.lang.String key) |
java.util.Set<Tuple> |
zpopmax(java.lang.String key,
int count) |
Tuple |
zpopmin(java.lang.String key) |
java.util.Set<Tuple> |
zpopmin(java.lang.String key,
int count) |
java.lang.String |
zrandmember(java.lang.String key) |
java.util.Set<java.lang.String> |
zrandmember(java.lang.String key,
long count) |
java.util.Set<Tuple> |
zrandmemberWithScores(java.lang.String key,
long count) |
java.util.Set<java.lang.String> |
zrange(java.lang.String key,
long start,
long stop) |
java.util.Set<java.lang.String> |
zrangeByLex(java.lang.String key,
java.lang.String min,
java.lang.String max) |
java.util.Set<java.lang.String> |
zrangeByLex(java.lang.String key,
java.lang.String min,
java.lang.String max,
int offset,
int count) |
java.util.Set<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.Set<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.Set<java.lang.String> |
zrangeByScore(java.lang.String key,
java.lang.String min,
java.lang.String max) |
java.util.Set<java.lang.String> |
zrangeByScore(java.lang.String key,
java.lang.String min,
java.lang.String max,
int offset,
int count) |
java.util.Set<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.Set<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.Set<Tuple> |
zrangeByScoreWithScores(java.lang.String key,
java.lang.String min,
java.lang.String max) |
java.util.Set<Tuple> |
zrangeByScoreWithScores(java.lang.String key,
java.lang.String min,
java.lang.String max,
int offset,
int count) |
java.util.Set<Tuple> |
zrangeWithScores(java.lang.String key,
long start,
long stop) |
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.
|
java.lang.Long |
zrem(java.lang.String key,
java.lang.String... members)
Remove the specified member from the sorted set value stored at key.
|
java.lang.Long |
zremrangeByLex(java.lang.String key,
java.lang.String min,
java.lang.String max) |
java.lang.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.
|
java.lang.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).
|
java.lang.Long |
zremrangeByScore(java.lang.String key,
java.lang.String min,
java.lang.String max) |
java.util.Set<java.lang.String> |
zrevrange(java.lang.String key,
long start,
long stop) |
java.util.Set<java.lang.String> |
zrevrangeByLex(java.lang.String key,
java.lang.String max,
java.lang.String min) |
java.util.Set<java.lang.String> |
zrevrangeByLex(java.lang.String key,
java.lang.String max,
java.lang.String min,
int offset,
int count) |
java.util.Set<java.lang.String> |
zrevrangeByScore(java.lang.String key,
double max,
double min) |
java.util.Set<java.lang.String> |
zrevrangeByScore(java.lang.String key,
double max,
double min,
int offset,
int count) |
java.util.Set<java.lang.String> |
zrevrangeByScore(java.lang.String key,
java.lang.String max,
java.lang.String min) |
java.util.Set<java.lang.String> |
zrevrangeByScore(java.lang.String key,
java.lang.String max,
java.lang.String min,
int offset,
int count) |
java.util.Set<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
double max,
double min) |
java.util.Set<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
double max,
double min,
int offset,
int count) |
java.util.Set<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
java.lang.String max,
java.lang.String min) |
java.util.Set<Tuple> |
zrevrangeByScoreWithScores(java.lang.String key,
java.lang.String max,
java.lang.String min,
int offset,
int count) |
java.util.Set<Tuple> |
zrevrangeWithScores(java.lang.String key,
long start,
long stop) |
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.
|
ScanResult<Tuple> |
zscan(java.lang.String key,
java.lang.String cursor) |
ScanResult<Tuple> |
zscan(java.lang.String key,
java.lang.String cursor,
ScanParams params) |
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.Set<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 client.
|
java.lang.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.
|
java.lang.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.Set<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 client.
|
aclCat, aclCatBinary, aclDelUser, aclGenPassBinary, aclGetUser, aclListBinary, aclLog, aclLogBinary, aclLogBinary, aclSetUser, aclSetUser, aclUsersBinary, aclWhoAmIBinary, append, auth, auth, bgrewriteaof, bgsave, bitcount, bitcount, bitfield, bitfieldReadonly, bitop, bitpos, bitpos, blmove, blpop, blpop, blpop, brpop, brpop, brpop, brpoplpush, bzpopmax, bzpopmin, clientGetnameBinary, clientInfoBinary, clientKill, clientKill, clientKill, clientListBinary, clientListBinary, clientPause, clientSetname, configGet, configResetStat, configRewrite, configSet, connect, copy, copy, dbSize, debug, decr, decrBy, del, del, disconnect, dump, echo, eval, eval, eval, eval, evalsha, evalsha, evalsha, exists, exists, expire, expireAt, flushAll, flushAll, flushDB, flushDB, geoadd, geoadd, geoadd, geodist, geodist, geohash, geopos, georadius, georadius, georadiusByMember, georadiusByMember, georadiusByMemberReadonly, georadiusByMemberReadonly, georadiusByMemberStore, georadiusReadonly, georadiusReadonly, georadiusStore, get, getbit, getClient, getDB, getDel, getEx, getrange, getSet, hdel, hexists, hget, hgetAll, hincrBy, hincrByFloat, hkeys, hlen, hmget, hmset, hrandfield, hrandfield, hrandfieldWithValues, hscan, hscan, hset, hset, hsetnx, hstrlen, hvals, incr, incrBy, incrByFloat, info, info, isBroken, isConnected, keys, lastsave, lindex, linsert, llen, lmove, lpop, lpop, lpos, lpos, lpos, lpush, lpushx, lrange, lrem, lset, ltrim, memoryDoctorBinary, memoryUsage, memoryUsage, mget, migrate, migrate, monitor, move, mset, msetnx, multi, objectEncoding, objectFreq, objectHelpBinary, objectIdletime, objectRefcount, persist, pexpire, pexpireAt, pfadd, pfcount, pfcount, pfmerge, ping, ping, pipelined, psetex, psubscribe, pttl, publish, quit, randomBinaryKey, rename, renamenx, resetState, restore, restore, restoreReplace, rpop, rpop, rpoplpush, rpush, rpushx, sadd, save, scan, scan, scard, scriptExists, scriptExists, scriptFlush, scriptFlush, scriptKill, scriptLoad, sdiff, sdiffstore, select, sendBlockingCommand, sendCommand, sendCommand, set, set, setbit, setbit, setex, setnx, setrange, shutdown, sinter, sinterstore, sismember, slaveof, slaveofNoOne, slowlogGetBinary, slowlogGetBinary, slowlogLen, slowlogReset, smembers, smismember, smove, sort, sort, sort, sort, spop, spop, srandmember, srandmember, srem, sscan, sscan, strlen, subscribe, substr, sunion, sunionstore, swapDB, sync, time, toString, touch, touch, ttl, type, unlink, unlink, unwatch, waitReplicas, watch, xack, xadd, xadd, xclaim, xclaim, xclaimJustId, xdel, xgroupCreate, xgroupDelConsumer, xgroupDestroy, xgroupSetID, xinfoConsumers, xinfoConsumersBinary, xinfoGroup, xinfoGroupBinary, xinfoStream, xinfoStreamBinary, xlen, xpending, xpending, xpending, xrange, xrange, xread, xread, xreadGroup, xreadGroup, xrevrange, xrevrange, xtrim, xtrim, zadd, zadd, zadd, zadd, zaddIncr, zcard, zcount, zcount, zdiff, zdiffStore, zdiffWithScores, zincrby, zincrby, zinter, zinterstore, zinterstore, zinterWithScores, zlexcount, zmscore, zpopmax, zpopmax, zpopmin, zpopmin, zrandmember, zrandmember, zrandmemberWithScores, zrange, zrangeByLex, zrangeByLex, zrangeByScore, zrangeByScore, zrangeByScore, zrangeByScore, zrangeByScoreWithScores, zrangeByScoreWithScores, zrangeByScoreWithScores, zrangeByScoreWithScores, zrangeWithScores, zrank, zrem, zremrangeByLex, zremrangeByRank, zremrangeByScore, zremrangeByScore, zrevrange, zrevrangeByLex, zrevrangeByLex, zrevrangeByScore, zrevrangeByScore, zrevrangeByScore, zrevrangeByScore, zrevrangeByScoreWithScores, zrevrangeByScoreWithScores, zrevrangeByScoreWithScores, zrevrangeByScoreWithScores, zrevrangeWithScores, zrevrank, zscan, zscan, zscore, zunion, zunionstore, zunionstore, zunionWithScores
expire, restore, restoreReplace, setex
unwatch
clientKill, clientKill, slowlogLen, slowlogReset
auth, auth, bgrewriteaof, bgsave, configResetStat, configRewrite, dbSize, debug, flushAll, flushAll, flushDB, flushDB, getDB, info, info, lastsave, ping, quit, save, select, shutdown, slaveof, slaveofNoOne, swapDB, waitReplicas
expire, restore, restoreReplace, setex, xrange
public Jedis()
@Deprecated public Jedis(java.lang.String uri)
JedisURIHelper#isValid(java.net.URI)
can used before this. If this
constructor was being used with a host, it can be replaced with
Jedis(java.lang.String, int)
with the host and Protocol.DEFAULT_PORT
.uri
- public Jedis(HostAndPort hp)
public Jedis(HostAndPort hp, JedisClientConfig config)
public Jedis(java.lang.String host, int port)
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(JedisShardInfo shardInfo)
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)
@Deprecated public Jedis(JedisSocketFactory jedisSocketFactory)
Jedis(redis.clients.jedis.JedisSocketFactory, redis.clients.jedis.JedisClientConfig)
.public Jedis(JedisSocketFactory jedisSocketFactory, JedisClientConfig clientConfig)
public java.lang.Boolean copy(java.lang.String srcKey, java.lang.String dstKey, int db, boolean replace)
copy
在接口中 MultiKeyCommands
srcKey
- the source key.dstKey
- the destination key.db
- replace
- public java.lang.Boolean copy(java.lang.String srcKey, java.lang.String dstKey, boolean replace)
copy
在接口中 MultiKeyCommands
srcKey
- the source key.dstKey
- the destination key.replace
- public java.lang.String ping(java.lang.String message)
message
- public java.lang.String set(java.lang.String key, java.lang.String value)
Time complexity: O(1)
set
在接口中 JedisCommands
key
- value
- public java.lang.String set(java.lang.String key, java.lang.String value, SetParams params)
set
在接口中 JedisCommands
key
- value
- params
- NX|XX, NX -- Only set the key if it does not already exist. XX -- Only set the
key if it already exist. EX|PX, expire time units: EX = seconds; PX = millisecondspublic java.lang.String get(java.lang.String key)
Time complexity: O(1)
get
在接口中 JedisCommands
key
- public java.lang.String getDel(java.lang.String key)
Time complexity: O(1)
getDel
在接口中 JedisCommands
key
- public java.lang.String getEx(java.lang.String key, GetExParams params)
getEx
在接口中 JedisCommands
public java.lang.Long exists(java.lang.String... keys)
exists
在接口中 MultiKeyCommands
keys
- public java.lang.Boolean exists(java.lang.String key)
exists
在接口中 JedisCommands
key
- public java.lang.Long del(java.lang.String... keys)
del
在接口中 MultiKeyCommands
keys
- public java.lang.Long del(java.lang.String key)
del
在接口中 JedisCommands
public java.lang.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
在接口中 MultiKeyCommands
keys
- public java.lang.Long unlink(java.lang.String key)
unlink
在接口中 JedisCommands
public java.lang.String type(java.lang.String key)
type
在接口中 JedisCommands
key
- public java.util.Set<java.lang.String> keys(java.lang.String pattern)
MultiKeyCommands
MultiKeyCommands.scan(String, ScanParams)
or sets.
While the time complexity for this operation is O(N), the constant times are fairly low. For example, Redis running on an entry level laptop can scan a 1 million key database in 40 milliseconds.
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
在接口中 MultiKeyCommands
public java.lang.String randomKey()
Time complexity: O(1)
randomKey
在接口中 MultiKeyCommands
public java.lang.String rename(java.lang.String oldkey, java.lang.String newkey)
Time complexity: O(1)
rename
在接口中 MultiKeyCommands
oldkey
- newkey
- public java.lang.Long renamenx(java.lang.String oldkey, java.lang.String newkey)
Time complexity: O(1)
renamenx
在接口中 MultiKeyCommands
oldkey
- newkey
- public java.lang.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
在接口中 JedisCommands
key
- seconds
- public java.lang.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
在接口中 JedisCommands
key
- unixTime
- public java.lang.Long ttl(java.lang.String key)
EXPIRE
set. This introspection capability allows a Redis client to
check how many seconds a given key will continue to be part of the dataset.ttl
在接口中 JedisCommands
key
- public java.lang.Long touch(java.lang.String... keys)
touch
在接口中 MultiKeyCommands
keys
- public java.lang.Long touch(java.lang.String key)
touch
在接口中 JedisCommands
public java.lang.Long move(java.lang.String key, int dbIndex)
move
在接口中 JedisCommands
key
- dbIndex
- public java.lang.String getSet(java.lang.String key, java.lang.String value)
Time complexity: O(1)
getSet
在接口中 JedisCommands
key
- value
- public java.util.List<java.lang.String> mget(java.lang.String... keys)
Time complexity: O(1) for every key
mget
在接口中 MultiKeyCommands
keys
- public java.lang.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
在接口中 JedisCommands
key
- value
- public java.lang.String setex(java.lang.String key, long seconds, java.lang.String value)
SET
+ EXPIRE
. The operation is
atomic.
Time complexity: O(1)
setex
在接口中 JedisCommands
key
- seconds
- value
- public java.lang.String mset(java.lang.String... keysvalues)
MSETNX
will not perform any operation at all even if
just a single key already exists.
Because of this semantic MSETNX can be used in order to set different keys representing different fields of an unique logic object in a way that ensures that either all the fields or none at all are set.
Both MSET and MSETNX are atomic operations. This means that for instance if the keys A and B are modified, another client talking to Redis can either see the changes to both A and B at once, or no modification at all.
mset
在接口中 MultiKeyCommands
keysvalues
- msetnx(String...)
public java.lang.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 client talking to Redis can either see the changes to both A and B at once, or no modification at all.
msetnx
在接口中 MultiKeyCommands
keysvalues
- mset(String...)
public java.lang.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
在接口中 JedisCommands
key
- decrement
- incr(String)
,
decr(String)
,
incrBy(String, long)
public java.lang.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
在接口中 JedisCommands
key
- incr(String)
,
incrBy(String, long)
,
decrBy(String, long)
public java.lang.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
在接口中 JedisCommands
key
- increment
- incr(String)
,
decr(String)
,
decrBy(String, long)
public java.lang.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
在接口中 JedisCommands
key
- increment
- public java.lang.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
在接口中 JedisCommands
key
- incrBy(String, long)
,
decr(String)
,
decrBy(String, long)
public java.lang.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
在接口中 JedisCommands
key
- value
- public java.lang.String substr(java.lang.String key, int start, int end)
The function handles out of range requests without raising an error, but just limiting the resulting range to the actual length of the string.
Time complexity: O(start+n) (with start being the start index and n the total length of the requested range). Note that the lookup part of this command is O(1) so for small strings this is actually an O(1) command.
substr
在接口中 JedisCommands
key
- start
- end
- public java.lang.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
在接口中 JedisCommands
key
- field
- value
- public java.lang.Long hset(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> hash)
hset
在接口中 JedisCommands
public java.lang.String hget(java.lang.String key, java.lang.String field)
If the field is not found or the key does not exist, a special 'nil' value is returned.
Time complexity: O(1)
hget
在接口中 JedisCommands
key
- field
- public java.lang.Long hsetnx(java.lang.String key, java.lang.String field, java.lang.String value)
hsetnx
在接口中 JedisCommands
key
- field
- value
- public java.lang.String hmset(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> hash)
If key does not exist, a new key holding a hash is created.
Time complexity: O(N) (with N being the number of fields)
hmset
在接口中 JedisCommands
key
- hash
- public java.util.List<java.lang.String> hmget(java.lang.String key, java.lang.String... fields)
If some of the specified fields do not exist, nil values are returned. Non existing keys are considered like empty hashes.
Time complexity: O(N) (with N being the number of fields)
hmget
在接口中 JedisCommands
key
- fields
- public java.lang.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
在接口中 JedisCommands
key
- field
- value
- public java.lang.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
在接口中 JedisCommands
key
- field
- value
- public java.lang.Boolean hexists(java.lang.String key, java.lang.String field)
hexists
在接口中 JedisCommands
key
- field
- public java.lang.Long hdel(java.lang.String key, java.lang.String... fields)
Time complexity: O(1)
hdel
在接口中 JedisCommands
key
- fields
- public java.lang.Long hlen(java.lang.String key)
Time complexity: O(1)
hlen
在接口中 JedisCommands
key
- public java.util.Set<java.lang.String> hkeys(java.lang.String key)
Time complexity: O(N), where N is the total number of entries
hkeys
在接口中 JedisCommands
key
- public java.util.List<java.lang.String> hvals(java.lang.String key)
Time complexity: O(N), where N is the total number of entries
hvals
在接口中 JedisCommands
key
- public java.util.Map<java.lang.String,java.lang.String> hgetAll(java.lang.String key)
Time complexity: O(N), where N is the total number of entries
hgetAll
在接口中 JedisCommands
key
- public java.lang.String hrandfield(java.lang.String key)
Time complexity: O(N), where N is the number of fields returned
hrandfield
在接口中 JedisCommands
key
- public java.util.List<java.lang.String> hrandfield(java.lang.String key, long count)
Time complexity: O(N), where N is the number of fields returned
hrandfield
在接口中 JedisCommands
key
- count
- public java.util.Map<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
在接口中 JedisCommands
key
- count
- public java.lang.Long rpush(java.lang.String key, java.lang.String... strings)
Time complexity: O(1)
rpush
在接口中 JedisCommands
key
- strings
- public java.lang.Long lpush(java.lang.String key, java.lang.String... strings)
Time complexity: O(1)
lpush
在接口中 JedisCommands
key
- strings
- public java.lang.Long llen(java.lang.String key)
Time complexity: O(1)
llen
在接口中 JedisCommands
key
- public java.util.List<java.lang.String> lrange(java.lang.String key, long start, long stop)
For example LRANGE foobar 0 2 will return the first three elements of the list.
start and end can also be negative numbers indicating offsets from the end of the list. For example -1 is the last element of the list, -2 the penultimate element and so on.
Consistency with range functions in various programming languages
Note that if you have a list of numbers from 0 to 100, LRANGE 0 10 will return 11 elements, that is, rightmost item is included. This may or may not be consistent with behavior of range-related functions in your programming language of choice (think Ruby's Range.new, Array#slice or Python's range() function).
LRANGE behavior is consistent with one of Tcl.
Out-of-range indexes
Indexes out of range will not produce an error: if start is over the end of the list, or start > end, an empty list is returned. If end is over the end of the list Redis will threat it just like the last element of the list.
Time complexity: O(start+n) (with n being the length of the range and start being the start offset)
lrange
在接口中 JedisCommands
key
- start
- stop
- public java.lang.String ltrim(java.lang.String key, long start, long stop)
For example LTRIM foobar 0 2 will modify the list stored at foobar key so that only the first three elements of the list will remain.
start and end can also be negative numbers indicating offsets from the end of the list. For example -1 is the last element of the list, -2 the penultimate element and so on.
Indexes out of range will not produce an error: if start is over the end of the list, or start > end, an empty list is left as value. If end over the end of the list Redis will threat it just like the last element of the list.
Hint: the obvious use of LTRIM is together with LPUSH/RPUSH. For example:
lpush("mylist", "someelement"); ltrim("mylist", 0, 99); *
The above two commands will push elements in the list taking care that the list will not grow without limits. This is very useful when using Redis to store logs for example. It is important to note that when used in this way LTRIM is an O(1) operation because in the average case just one element is removed from the tail of the list.
Time complexity: O(n) (with n being len of list - len of range)
ltrim
在接口中 JedisCommands
key
- start
- stop
- public java.lang.String lindex(java.lang.String key, long index)
If the value stored at key is not of list type an error is returned. If the index is out of range a 'nil' reply is returned.
Note that even if the average time complexity is O(n) asking for the first or the last element of the list is O(1).
Time complexity: O(n) (with n being the length of the list)
lindex
在接口中 JedisCommands
key
- index
- public java.lang.String lset(java.lang.String key, long index, java.lang.String value)
Out of range indexes will generate an error.
Similarly to other list commands accepting indexes, the index can be negative to access elements starting from the end of the list. So -1 is the last element, -2 is the penultimate, and so forth.
Time complexity:
O(N) (with N being the length of the list), setting the first or last elements of the list is O(1).
lset
在接口中 JedisCommands
key
- index
- value
- lindex(String, long)
public java.lang.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
在接口中 JedisCommands
key
- count
- value
- public java.lang.String lpop(java.lang.String key)
If the key does not exist or the list is already empty the special value 'nil' is returned.
lpop
在接口中 JedisCommands
key
- rpop(String)
public java.util.List<java.lang.String> lpop(java.lang.String key, int count)
lpop
在接口中 JedisCommands
public java.lang.Long lpos(java.lang.String key, java.lang.String element)
lpos
在接口中 JedisCommands
public java.lang.Long lpos(java.lang.String key, java.lang.String element, LPosParams params)
lpos
在接口中 JedisCommands
public java.util.List<java.lang.Long> lpos(java.lang.String key, java.lang.String element, LPosParams params, long count)
lpos
在接口中 JedisCommands
public java.lang.String rpop(java.lang.String key)
If the key does not exist or the list is already empty the special value 'nil' is returned.
rpop
在接口中 JedisCommands
key
- lpop(String)
public java.util.List<java.lang.String> rpop(java.lang.String key, int count)
rpop
在接口中 JedisCommands
public 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
在接口中 MultiKeyCommands
srckey
- dstkey
- public java.lang.Long sadd(java.lang.String key, java.lang.String... members)
Time complexity O(1)
sadd
在接口中 JedisCommands
key
- members
- public java.util.Set<java.lang.String> smembers(java.lang.String key)
SINTER
.
Time complexity O(N)
smembers
在接口中 JedisCommands
key
- public java.lang.Long srem(java.lang.String key, java.lang.String... members)
Time complexity O(1)
srem
在接口中 JedisCommands
key
- members
- public java.lang.String spop(java.lang.String key)
The srandmember(String)
command does a similar work but the returned element is not
removed from the Set.
Time complexity O(1)
spop
在接口中 JedisCommands
key
- public java.util.Set<java.lang.String> spop(java.lang.String key, long count)
spop
在接口中 JedisCommands
public java.lang.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
在接口中 MultiKeyCommands
srckey
- dstkey
- member
- public java.lang.Long scard(java.lang.String key)
scard
在接口中 JedisCommands
key
- public java.lang.Boolean sismember(java.lang.String key, java.lang.String member)
Time complexity O(1)
sismember
在接口中 JedisCommands
key
- member
- public 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
在接口中 JedisCommands
key
- members
- public java.util.Set<java.lang.String> sinter(java.lang.String... keys)
LRANGE
the result is sent to the
client 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
在接口中 MultiKeyCommands
keys
- public java.lang.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
在接口中 MultiKeyCommands
dstkey
- keys
- public java.util.Set<java.lang.String> sunion(java.lang.String... keys)
LRANGE
the result is sent to the client 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
在接口中 MultiKeyCommands
keys
- public java.lang.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
在接口中 MultiKeyCommands
dstkey
- keys
- public java.util.Set<java.lang.String> sdiff(java.lang.String... keys)
Example:
key1 = [x, a, b, c] key2 = [c] key3 = [a, d] SDIFF key1,key2,key3 => [x, b]Non existing keys are considered like empty sets.
Time complexity:
O(N) with N being the total number of elements of all the sets
sdiff
在接口中 MultiKeyCommands
keys
- public java.lang.Long sdiffstore(java.lang.String dstkey, java.lang.String... keys)
SDIFF
but instead of being returned
the resulting set is stored in dstkey.sdiffstore
在接口中 MultiKeyCommands
dstkey
- keys
- public java.lang.String srandmember(java.lang.String key)
The SPOP command does a similar work but the returned element is popped (removed) from the Set.
Time complexity O(1)
srandmember
在接口中 JedisCommands
key
- public java.util.List<java.lang.String> srandmember(java.lang.String key, int count)
The SPOP command does a similar work but the returned elements is popped (removed) from the Set.
Time complexity O(1)
srandmember
在接口中 JedisCommands
key
- count
- if positive, return an array of distinct elements.
If negative the behavior changes and the command is allowed to
return the same element multiple timespublic java.lang.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
在接口中 JedisCommands
key
- score
- member
- public java.lang.Long zadd(java.lang.String key, double score, java.lang.String member, ZAddParams params)
zadd
在接口中 JedisCommands
public java.lang.Long zadd(java.lang.String key, java.util.Map<java.lang.String,java.lang.Double> scoreMembers)
zadd
在接口中 JedisCommands
public java.lang.Long zadd(java.lang.String key, java.util.Map<java.lang.String,java.lang.Double> scoreMembers, ZAddParams params)
zadd
在接口中 JedisCommands
public java.lang.Double zaddIncr(java.lang.String key, double score, java.lang.String member, ZAddParams params)
zaddIncr
在接口中 JedisCommands
public java.util.Set<java.lang.String> zdiff(java.lang.String... keys)
zdiff
在接口中 MultiKeyCommands
public java.util.Set<Tuple> zdiffWithScores(java.lang.String... keys)
zdiffWithScores
在接口中 MultiKeyCommands
public java.lang.Long zdiffStore(java.lang.String dstkey, java.lang.String... keys)
zdiffStore
在接口中 MultiKeyCommands
public java.util.Set<java.lang.String> zrange(java.lang.String key, long start, long stop)
zrange
在接口中 JedisCommands
public java.lang.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
在接口中 JedisCommands
key
- members
- public java.lang.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
在接口中 JedisCommands
key
- increment
- member
- public java.lang.Double zincrby(java.lang.String key, double increment, java.lang.String member, ZIncrByParams params)
zincrby
在接口中 JedisCommands
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
在接口中 JedisCommands
key
- member
- zrevrank(String, String)
public java.lang.Long zrevrank(java.lang.String key, java.lang.String member)
When the given member does not exist in the sorted set, the special value 'nil' is returned. The returned rank (or index) of the member is 0-based for both commands.
Time complexity:
O(log(N))
zrevrank
在接口中 JedisCommands
key
- member
- zrank(String, String)
public java.util.Set<java.lang.String> zrevrange(java.lang.String key, long start, long stop)
zrevrange
在接口中 JedisCommands
public java.util.Set<Tuple> zrangeWithScores(java.lang.String key, long start, long stop)
zrangeWithScores
在接口中 JedisCommands
public java.util.Set<Tuple> zrevrangeWithScores(java.lang.String key, long start, long stop)
zrevrangeWithScores
在接口中 JedisCommands
public java.lang.String zrandmember(java.lang.String key)
zrandmember
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrandmember(java.lang.String key, long count)
zrandmember
在接口中 JedisCommands
public java.util.Set<Tuple> zrandmemberWithScores(java.lang.String key, long count)
zrandmemberWithScores
在接口中 JedisCommands
public java.lang.Long zcard(java.lang.String key)
Time complexity O(1)
zcard
在接口中 JedisCommands
key
- public java.lang.Double zscore(java.lang.String key, java.lang.String member)
Time complexity: O(1)
zscore
在接口中 JedisCommands
key
- member
- public java.util.List<java.lang.Double> zmscore(java.lang.String key, java.lang.String... members)
Time complexity: O(N) where N is the number of members being requested.
zmscore
在接口中 JedisCommands
key
- members
- public Tuple zpopmax(java.lang.String key)
zpopmax
在接口中 JedisCommands
public java.util.Set<Tuple> zpopmax(java.lang.String key, int count)
zpopmax
在接口中 JedisCommands
public Tuple zpopmin(java.lang.String key)
zpopmin
在接口中 JedisCommands
public java.util.Set<Tuple> zpopmin(java.lang.String key, int count)
zpopmin
在接口中 JedisCommands
public java.lang.String watch(java.lang.String... keys)
watch
在接口中 MultiKeyCommands
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
在接口中 JedisCommands
key
- sort(String, String)
,
sort(String, SortingParams)
,
sort(String, SortingParams, String)
public java.util.List<java.lang.String> sort(java.lang.String key, SortingParams sortingParameters)
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
在接口中 JedisCommands
key
- sortingParameters
- sort(String)
,
sort(String, SortingParams, String)
public java.lang.Long sort(java.lang.String key, SortingParams sortingParameters, java.lang.String dstkey)
sort
在接口中 MultiKeyCommands
key
- sortingParameters
- dstkey
- sort(String, SortingParams)
,
sort(String)
,
sort(String, String)
public java.lang.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
在接口中 MultiKeyCommands
key
- dstkey
- sort(String)
,
sort(String, SortingParams)
,
sort(String, SortingParams, String)
public java.lang.String lmove(java.lang.String srcKey, java.lang.String dstKey, ListDirection from, ListDirection to)
lmove
在接口中 MultiKeyCommands
public java.lang.String blmove(java.lang.String srcKey, java.lang.String dstKey, ListDirection from, ListDirection to, double timeout)
blmove
在接口中 MultiKeyCommands
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 client performs a LPUSH or an RPUSH operation against one of the lists.
Once new data is present on one of the lists, the client finally returns with the name of the key unblocking it and the popped value.
When blocking, if a non-zero timeout is specified, the client 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
在接口中 MultiKeyCommands
timeout
- keys
- When a non-zero timeout is specified, and the BLPOP operation timed out, the return value is a nil multi bulk reply. Most client values will return false or nil accordingly to the programming language used.
brpop(int, String...)
public KeyedListElement blpop(double timeout, java.lang.String... keys)
blpop
在接口中 MultiKeyCommands
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 client performs a LPUSH or an RPUSH operation against one of the lists.
Once new data is present on one of the lists, the client finally returns with the name of the key unblocking it and the popped value.
When blocking, if a non-zero timeout is specified, the client 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
在接口中 MultiKeyCommands
timeout
- keys
- When a non-zero timeout is specified, and the BLPOP operation timed out, the return value is a nil multi bulk reply. Most client values will return false or nil accordingly to the programming language used.
blpop(int, String...)
public KeyedListElement brpop(double timeout, java.lang.String... keys)
brpop
在接口中 MultiKeyCommands
public java.util.List<java.lang.String> blpop(java.lang.String... args)
blpop
在接口中 MultiKeyCommands
public java.util.List<java.lang.String> brpop(java.lang.String... args)
brpop
在接口中 MultiKeyCommands
public KeyedZSetElement bzpopmax(double timeout, java.lang.String... keys)
bzpopmax
在接口中 MultiKeyCommands
public KeyedZSetElement bzpopmin(double timeout, java.lang.String... keys)
bzpopmin
在接口中 MultiKeyCommands
public java.util.List<java.lang.String> blpop(int timeout, java.lang.String key)
blpop
在接口中 JedisCommands
public KeyedListElement blpop(double timeout, java.lang.String key)
blpop
在接口中 JedisCommands
public java.util.List<java.lang.String> brpop(int timeout, java.lang.String key)
brpop
在接口中 JedisCommands
public KeyedListElement brpop(double timeout, java.lang.String key)
brpop
在接口中 JedisCommands
public java.lang.Long zcount(java.lang.String key, double min, double max)
zcount
在接口中 JedisCommands
public java.lang.Long zcount(java.lang.String key, java.lang.String min, java.lang.String max)
zcount
在接口中 JedisCommands
public java.util.Set<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's possible
to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
the commands needs to traverse the list for offset elements and this adds up to the O(M)
figure.
The ZCOUNT
command is similar to
ZRANGEBYSCORE
but instead of returning the
actual elements in the specified interval, it just returns the number of matching elements.
Exclusive intervals and infinity
min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".
Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:
ZRANGEBYSCORE zset (1.3 5
Will return all the values with score > 1.3 and <= 5, while for instance:
ZRANGEBYSCORE zset (5 (10
Will return all the values with score > 5 and < 10 (5 and 10 excluded).
Time complexity:
O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))
zrangeByScore
在接口中 JedisCommands
key
- min
- a double or Double.NEGATIVE_INFINITY for "-inf"max
- a double or Double.POSITIVE_INFINITY for "+inf"zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, String, String)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.Set<java.lang.String> zrangeByScore(java.lang.String key, java.lang.String min, java.lang.String max)
zrangeByScore
在接口中 JedisCommands
public java.util.Set<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's possible
to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
the commands needs to traverse the list for offset elements and this adds up to the O(M)
figure.
The ZCOUNT
command is similar to
ZRANGEBYSCORE
but instead of returning the
actual elements in the specified interval, it just returns the number of matching elements.
Exclusive intervals and infinity
min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".
Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:
ZRANGEBYSCORE zset (1.3 5
Will return all the values with score > 1.3 and <= 5, while for instance:
ZRANGEBYSCORE zset (5 (10
Will return all the values with score > 5 and < 10 (5 and 10 excluded).
Time complexity:
O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))
zrangeByScore
在接口中 JedisCommands
key
- min
- max
- offset
- count
- zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.Set<java.lang.String> zrangeByScore(java.lang.String key, java.lang.String min, java.lang.String max, int offset, int count)
zrangeByScore
在接口中 JedisCommands
public java.util.Set<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's possible
to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
the commands needs to traverse the list for offset elements and this adds up to the O(M)
figure.
The ZCOUNT
command is similar to
ZRANGEBYSCORE
but instead of returning the
actual elements in the specified interval, it just returns the number of matching elements.
Exclusive intervals and infinity
min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".
Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:
ZRANGEBYSCORE zset (1.3 5
Will return all the values with score > 1.3 and <= 5, while for instance:
ZRANGEBYSCORE zset (5 (10
Will return all the values with score > 5 and < 10 (5 and 10 excluded).
Time complexity:
O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))
zrangeByScoreWithScores
在接口中 JedisCommands
key
- min
- max
- zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.Set<Tuple> zrangeByScoreWithScores(java.lang.String key, java.lang.String min, java.lang.String max)
zrangeByScoreWithScores
在接口中 JedisCommands
public java.util.Set<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's possible
to get only a range of the matching elements in an SQL-alike way. Note that if offset is large
the commands needs to traverse the list for offset elements and this adds up to the O(M)
figure.
The ZCOUNT
command is similar to
ZRANGEBYSCORE
but instead of returning the
actual elements in the specified interval, it just returns the number of matching elements.
Exclusive intervals and infinity
min and max can be -inf and +inf, so that you are not required to know what's the greatest or smallest element in order to take, for instance, elements "up to a given value".
Also while the interval is for default closed (inclusive) it's possible to specify open intervals prefixing the score with a "(" character, so for instance:
ZRANGEBYSCORE zset (1.3 5
Will return all the values with score > 1.3 and <= 5, while for instance:
ZRANGEBYSCORE zset (5 (10
Will return all the values with score > 5 and < 10 (5 and 10 excluded).
Time complexity:
O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements returned by the command, so if M is constant (for instance you always ask for the first ten elements with LIMIT) you can consider it O(log(N))
zrangeByScoreWithScores
在接口中 JedisCommands
key
- min
- max
- offset
- count
- zrangeByScore(String, double, double)
,
zrangeByScore(String, double, double, int, int)
,
zrangeByScoreWithScores(String, double, double)
,
zrangeByScoreWithScores(String, double, double, int, int)
,
zcount(String, double, double)
public java.util.Set<Tuple> zrangeByScoreWithScores(java.lang.String key, java.lang.String min, java.lang.String max, int offset, int count)
zrangeByScoreWithScores
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrevrangeByScore(java.lang.String key, double max, double min)
zrevrangeByScore
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrevrangeByScore(java.lang.String key, java.lang.String max, java.lang.String min)
zrevrangeByScore
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrevrangeByScore(java.lang.String key, double max, double min, int offset, int count)
zrevrangeByScore
在接口中 JedisCommands
public java.util.Set<Tuple> zrevrangeByScoreWithScores(java.lang.String key, double max, double min)
zrevrangeByScoreWithScores
在接口中 JedisCommands
public java.util.Set<Tuple> zrevrangeByScoreWithScores(java.lang.String key, double max, double min, int offset, int count)
zrevrangeByScoreWithScores
在接口中 JedisCommands
public java.util.Set<Tuple> zrevrangeByScoreWithScores(java.lang.String key, java.lang.String max, java.lang.String min, int offset, int count)
zrevrangeByScoreWithScores
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrevrangeByScore(java.lang.String key, java.lang.String max, java.lang.String min, int offset, int count)
zrevrangeByScore
在接口中 JedisCommands
public java.util.Set<Tuple> zrevrangeByScoreWithScores(java.lang.String key, java.lang.String max, java.lang.String min)
zrevrangeByScoreWithScores
在接口中 JedisCommands
public java.lang.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
在接口中 JedisCommands
key
- start
- stop
- public java.lang.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
在接口中 JedisCommands
key
- min
- max
- public java.lang.Long zremrangeByScore(java.lang.String key, java.lang.String min, java.lang.String max)
zremrangeByScore
在接口中 JedisCommands
public java.util.Set<java.lang.String> zunion(ZParams params, java.lang.String... keys)
zunion
在接口中 MultiKeyCommands
params
- keys
- public java.util.Set<Tuple> zunionWithScores(ZParams params, java.lang.String... keys)
zunionWithScores
在接口中 MultiKeyCommands
params
- keys
- public java.lang.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's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.
Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set
zunionstore
在接口中 MultiKeyCommands
dstkey
- sets
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public java.lang.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's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.
Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set
zunionstore
在接口中 MultiKeyCommands
dstkey
- sets
- params
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public java.util.Set<java.lang.String> zinter(ZParams params, java.lang.String... keys)
zinter
在接口中 MultiKeyCommands
params
- keys
- public java.util.Set<Tuple> zinterWithScores(ZParams params, java.lang.String... keys)
zinterWithScores
在接口中 MultiKeyCommands
params
- keys
- public java.lang.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's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.
Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set
zinterstore
在接口中 MultiKeyCommands
dstkey
- sets
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public java.lang.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's possible to specify how the results of the union or intersection are aggregated. This option defaults to SUM, where the score of an element is summed across the inputs where it exists. When this option is set to be either MIN or MAX, the resulting set will contain the minimum or maximum score of an element across the inputs where it exists.
Time complexity: O(N) + O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set
zinterstore
在接口中 MultiKeyCommands
dstkey
- sets
- params
- zunionstore(String, String...)
,
zunionstore(String, ZParams, String...)
,
zinterstore(String, String...)
,
zinterstore(String, ZParams, String...)
public java.lang.Long zlexcount(java.lang.String key, java.lang.String min, java.lang.String max)
zlexcount
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrangeByLex(java.lang.String key, java.lang.String min, java.lang.String max)
zrangeByLex
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrangeByLex(java.lang.String key, java.lang.String min, java.lang.String max, int offset, int count)
zrangeByLex
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrevrangeByLex(java.lang.String key, java.lang.String max, java.lang.String min)
zrevrangeByLex
在接口中 JedisCommands
public java.util.Set<java.lang.String> zrevrangeByLex(java.lang.String key, java.lang.String max, java.lang.String min, int offset, int count)
zrevrangeByLex
在接口中 JedisCommands
public java.lang.Long zremrangeByLex(java.lang.String key, java.lang.String min, java.lang.String max)
zremrangeByLex
在接口中 JedisCommands
public java.lang.Long strlen(java.lang.String key)
strlen
在接口中 JedisCommands
public java.lang.Long lpushx(java.lang.String key, java.lang.String... string)
lpushx
在接口中 JedisCommands
public java.lang.Long persist(java.lang.String key)
expire
at turning the expire key into a normal key.
Time complexity: O(1)
persist
在接口中 JedisCommands
key
- public java.lang.Long rpushx(java.lang.String key, java.lang.String... string)
rpushx
在接口中 JedisCommands
public java.lang.String echo(java.lang.String string)
echo
在接口中 JedisCommands
public java.lang.Long linsert(java.lang.String key, ListPosition where, java.lang.String pivot, java.lang.String value)
linsert
在接口中 JedisCommands
public java.lang.String brpoplpush(java.lang.String source, java.lang.String destination, int timeout)
brpoplpush
在接口中 MultiKeyCommands
source
- destination
- timeout
- public java.lang.Boolean setbit(java.lang.String key, long offset, boolean value)
setbit
在接口中 JedisCommands
key
- offset
- value
- public java.lang.Boolean setbit(java.lang.String key, long offset, java.lang.String value)
setbit
在接口中 JedisCommands
public java.lang.Boolean getbit(java.lang.String key, long offset)
getbit
在接口中 JedisCommands
key
- offset
- public java.lang.Long setrange(java.lang.String key, long offset, java.lang.String value)
setrange
在接口中 JedisCommands
public java.lang.String getrange(java.lang.String key, long startOffset, long endOffset)
getrange
在接口中 JedisCommands
public java.lang.Long bitpos(java.lang.String key, boolean value)
bitpos
在接口中 JedisCommands
public java.lang.Long bitpos(java.lang.String key, boolean value, BitPosParams params)
bitpos
在接口中 JedisCommands
public java.util.List<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
在接口中 AdvancedJedisCommands
pattern
- public 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
在接口中 AdvancedJedisCommands
parameter
- value
- public void subscribe(JedisPubSub jedisPubSub, java.lang.String... channels)
subscribe
在接口中 MultiKeyCommands
public java.lang.Long publish(java.lang.String channel, java.lang.String message)
publish
在接口中 MultiKeyCommands
public void psubscribe(JedisPubSub jedisPubSub, java.lang.String... patterns)
psubscribe
在接口中 MultiKeyCommands
public java.lang.Object eval(java.lang.String script, int keyCount, java.lang.String... params)
eval
在接口中 ScriptingCommands
public java.lang.Object eval(java.lang.String script, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
eval
在接口中 ScriptingCommands
public java.lang.Object eval(java.lang.String script)
eval
在接口中 ScriptingCommands
public java.lang.Object evalsha(java.lang.String sha1)
evalsha
在接口中 ScriptingCommands
public java.lang.Object evalsha(java.lang.String sha1, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> args)
evalsha
在接口中 ScriptingCommands
public java.lang.Object evalsha(java.lang.String sha1, int keyCount, java.lang.String... params)
evalsha
在接口中 ScriptingCommands
public java.lang.Boolean scriptExists(java.lang.String sha1)
scriptExists
在接口中 ScriptingCommands
public java.util.List<java.lang.Boolean> scriptExists(java.lang.String... sha1)
scriptExists
在接口中 ScriptingCommands
public java.lang.String scriptLoad(java.lang.String script)
scriptLoad
在接口中 ScriptingCommands
public java.util.List<Slowlog> slowlogGet()
slowlogGet
在接口中 AdvancedJedisCommands
public java.util.List<Slowlog> slowlogGet(long entries)
slowlogGet
在接口中 AdvancedJedisCommands
public java.lang.Long objectRefcount(java.lang.String key)
objectRefcount
在接口中 AdvancedJedisCommands
public java.lang.String objectEncoding(java.lang.String key)
objectEncoding
在接口中 AdvancedJedisCommands
public java.lang.Long objectIdletime(java.lang.String key)
objectIdletime
在接口中 AdvancedJedisCommands
public java.util.List<java.lang.String> objectHelp()
objectHelp
在接口中 AdvancedJedisCommands
public java.lang.Long objectFreq(java.lang.String key)
objectFreq
在接口中 AdvancedJedisCommands
public java.lang.Long bitcount(java.lang.String key)
bitcount
在接口中 JedisCommands
public java.lang.Long bitcount(java.lang.String key, long start, long end)
bitcount
在接口中 JedisCommands
public java.lang.Long bitop(BitOP op, java.lang.String destKey, java.lang.String... srcKeys)
bitop
在接口中 MultiKeyCommands
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> sentinelMasters()
redis 127.0.0.1:26381> sentinel masters 1) 1) "name" 2) "mymaster" 3) "ip" 4) "127.0.0.1" 5) "port" 6) "6379" 7) "runid" 8) "93d4d4e6e9c06d0eea36e27f31924ac26576081d" 9) "flags" 10) "master" 11) "pending-commands" 12) "0" 13) "last-ok-ping-reply" 14) "423" 15) "last-ping-reply" 16) "423" 17) "info-refresh" 18) "6107" 19) "num-slaves" 20) "1" 21) "num-other-sentinels" 22) "2" 23) "quorum" 24) "2"
sentinelMasters
在接口中 SentinelCommands
public java.util.List<java.lang.String> sentinelGetMasterAddrByName(java.lang.String masterName)
redis 127.0.0.1:26381> sentinel get-master-addr-by-name mymaster 1) "127.0.0.1" 2) "6379"
sentinelGetMasterAddrByName
在接口中 SentinelCommands
masterName
- public java.lang.Long sentinelReset(java.lang.String pattern)
redis 127.0.0.1:26381> sentinel reset mymaster (integer) 1
sentinelReset
在接口中 SentinelCommands
pattern
- 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
在接口中 SentinelCommands
masterName
- public java.lang.String sentinelFailover(java.lang.String masterName)
sentinelFailover
在接口中 SentinelCommands
public java.lang.String sentinelMonitor(java.lang.String masterName, java.lang.String ip, int port, int quorum)
sentinelMonitor
在接口中 SentinelCommands
public java.lang.String sentinelRemove(java.lang.String masterName)
sentinelRemove
在接口中 SentinelCommands
public java.lang.String sentinelSet(java.lang.String masterName, java.util.Map<java.lang.String,java.lang.String> parameterMap)
sentinelSet
在接口中 SentinelCommands
public byte[] dump(java.lang.String key)
dump
在接口中 JedisCommands
public java.lang.String restore(java.lang.String key, long ttl, byte[] serializedValue)
restore
在接口中 JedisCommands
public java.lang.String restoreReplace(java.lang.String key, long ttl, byte[] serializedValue)
restoreReplace
在接口中 JedisCommands
public java.lang.String restore(java.lang.String key, long ttl, byte[] serializedValue, RestoreParams params)
restore
在接口中 JedisCommands
public java.lang.Long pexpire(java.lang.String key, long milliseconds)
pexpire
在接口中 JedisCommands
public java.lang.Long pexpireAt(java.lang.String key, long millisecondsTimestamp)
pexpireAt
在接口中 JedisCommands
public java.lang.Long pttl(java.lang.String key)
pttl
在接口中 JedisCommands
public java.lang.String psetex(java.lang.String key, long milliseconds, java.lang.String value)
JedisCommands.setex(String, int, String)
with the sole difference that the
expire time is specified in milliseconds instead of seconds. Time complexity: O(1)psetex
在接口中 JedisCommands
key
- milliseconds
- value
- public java.lang.String clientKill(java.lang.String ipPort)
clientKill
在接口中 AdvancedJedisCommands
public java.lang.String clientGetname()
clientGetname
在接口中 AdvancedJedisCommands
public java.lang.String clientList()
clientList
在接口中 AdvancedJedisCommands
public java.lang.String clientList(long... clientIds)
clientList
在接口中 AdvancedJedisCommands
public java.lang.String clientInfo()
clientInfo
在接口中 AdvancedJedisCommands
public java.lang.String clientSetname(java.lang.String name)
clientSetname
在接口中 AdvancedJedisCommands
public java.lang.Long clientId()
clientId
在接口中 AdvancedBinaryJedisCommands
clientId
在接口中 AdvancedJedisCommands
clientId
在类中 BinaryJedis
public java.lang.Long clientUnblock(long clientId, UnblockType unblockType)
clientUnblock
在接口中 AdvancedBinaryJedisCommands
clientUnblock
在接口中 AdvancedJedisCommands
clientUnblock
在类中 BinaryJedis
clientId
- unblockType
- could be null
by default the client is unblocked as if the timeout
of the command was reachedpublic java.lang.String migrate(java.lang.String host, int port, java.lang.String key, int destinationDb, int timeout)
migrate
在接口中 AdvancedJedisCommands
public java.lang.String migrate(java.lang.String host, int port, int destinationDB, int timeout, MigrateParams params, java.lang.String... keys)
migrate
在接口中 AdvancedJedisCommands
public ScanResult<java.lang.String> scan(java.lang.String cursor)
scan
在接口中 MultiKeyCommands
MultiKeyCommands.scan(String, ScanParams)
public ScanResult<java.lang.String> scan(java.lang.String cursor, ScanParams params)
MultiKeyCommands
Since this command allows for incremental iteration, returning only a small number of elements
per call, it can be used in production without the downside of commands like
MultiKeyCommands.keys(String)
or JedisCommands.smembers(String)
)} that may block the server
for a long time (even several seconds) when called against big collections of keys or elements.
SCAN basic usage
SCAN is a cursor based iterator. This means that at every call of the command, the server
returns an updated cursor that the user needs to use as the cursor argument in the next call.
An iteration starts when the cursor is set to 0, and terminates when the cursor returned by the
server is 0.
Scan guarantees
The SCAN command, and the other commands in the SCAN family, are able to provide to the user a
set of guarantees associated to full iterations.
Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the DB.
scan
在接口中 MultiKeyCommands
cursor
- The cursor.params
- the scan parameters. For example a glob-style match patternpublic ScanResult<java.util.Map.Entry<java.lang.String,java.lang.String>> hscan(java.lang.String key, java.lang.String cursor)
hscan
在接口中 JedisCommands
public ScanResult<java.util.Map.Entry<java.lang.String,java.lang.String>> hscan(java.lang.String key, java.lang.String cursor, ScanParams params)
hscan
在接口中 JedisCommands
public ScanResult<java.lang.String> sscan(java.lang.String key, java.lang.String cursor)
sscan
在接口中 JedisCommands
public ScanResult<java.lang.String> sscan(java.lang.String key, java.lang.String cursor, ScanParams params)
sscan
在接口中 JedisCommands
public ScanResult<Tuple> zscan(java.lang.String key, java.lang.String cursor)
zscan
在接口中 JedisCommands
public ScanResult<Tuple> zscan(java.lang.String key, java.lang.String cursor, ScanParams params)
zscan
在接口中 JedisCommands
public java.lang.String clusterNodes()
clusterNodes
在接口中 ClusterCommands
public java.lang.String readonly()
readonly
在接口中 ClusterCommands
public java.lang.String clusterMeet(java.lang.String ip, int port)
clusterMeet
在接口中 ClusterCommands
public java.lang.String clusterReset(ClusterReset resetType)
clusterReset
在接口中 ClusterCommands
public java.lang.String clusterAddSlots(int... slots)
clusterAddSlots
在接口中 ClusterCommands
public java.lang.String clusterDelSlots(int... slots)
clusterDelSlots
在接口中 ClusterCommands
public java.lang.String clusterInfo()
clusterInfo
在接口中 ClusterCommands
public java.util.List<java.lang.String> clusterGetKeysInSlot(int slot, int count)
clusterGetKeysInSlot
在接口中 ClusterCommands
public java.lang.String clusterSetSlotNode(int slot, java.lang.String nodeId)
clusterSetSlotNode
在接口中 ClusterCommands
public java.lang.String clusterSetSlotMigrating(int slot, java.lang.String nodeId)
clusterSetSlotMigrating
在接口中 ClusterCommands
public java.lang.String clusterSetSlotImporting(int slot, java.lang.String nodeId)
clusterSetSlotImporting
在接口中 ClusterCommands
public java.lang.String clusterSetSlotStable(int slot)
clusterSetSlotStable
在接口中 ClusterCommands
public java.lang.String clusterForget(java.lang.String nodeId)
clusterForget
在接口中 ClusterCommands
public java.lang.String clusterFlushSlots()
clusterFlushSlots
在接口中 ClusterCommands
public java.lang.Long clusterKeySlot(java.lang.String key)
clusterKeySlot
在接口中 ClusterCommands
public java.lang.Long clusterCountKeysInSlot(int slot)
clusterCountKeysInSlot
在接口中 ClusterCommands
public java.lang.String clusterSaveConfig()
clusterSaveConfig
在接口中 ClusterCommands
public java.lang.String clusterReplicate(java.lang.String nodeId)
clusterReplicate
在接口中 ClusterCommands
public java.util.List<java.lang.String> clusterSlaves(java.lang.String nodeId)
clusterSlaves
在接口中 ClusterCommands
public java.lang.String clusterFailover()
clusterFailover
在接口中 ClusterCommands
public java.util.List<java.lang.Object> clusterSlots()
clusterSlots
在接口中 ClusterCommands
public java.lang.String asking()
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.String> pubsubNumSub(java.lang.String... channels)
public void close()
close
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable
close
在类中 BinaryJedis
public void setDataSource(JedisPoolAbstract jedisPool)
public java.lang.Long pfadd(java.lang.String key, java.lang.String... elements)
pfadd
在接口中 JedisCommands
public long pfcount(java.lang.String key)
pfcount
在接口中 JedisCommands
public long pfcount(java.lang.String... keys)
pfcount
在接口中 MultiKeyCommands
public java.lang.String pfmerge(java.lang.String destkey, java.lang.String... sourcekeys)
pfmerge
在接口中 MultiKeyCommands
public java.lang.Long geoadd(java.lang.String key, double longitude, double latitude, java.lang.String member)
geoadd
在接口中 JedisCommands
public java.lang.Long geoadd(java.lang.String key, java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
geoadd
在接口中 JedisCommands
public java.lang.Long geoadd(java.lang.String key, GeoAddParams params, java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
geoadd
在接口中 JedisCommands
public java.lang.Double geodist(java.lang.String key, java.lang.String member1, java.lang.String member2)
geodist
在接口中 JedisCommands
public java.lang.Double geodist(java.lang.String key, java.lang.String member1, java.lang.String member2, GeoUnit unit)
geodist
在接口中 JedisCommands
public java.util.List<java.lang.String> geohash(java.lang.String key, java.lang.String... members)
geohash
在接口中 JedisCommands
public java.util.List<GeoCoordinate> geopos(java.lang.String key, java.lang.String... members)
geopos
在接口中 JedisCommands
public java.util.List<GeoRadiusResponse> georadius(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit)
georadius
在接口中 JedisCommands
public java.util.List<GeoRadiusResponse> georadiusReadonly(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit)
georadiusReadonly
在接口中 JedisCommands
public java.util.List<GeoRadiusResponse> georadius(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
georadius
在接口中 JedisCommands
public java.lang.Long georadiusStore(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
georadiusStore
在接口中 MultiKeyCommands
public java.util.List<GeoRadiusResponse> georadiusReadonly(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusReadonly
在接口中 JedisCommands
public java.util.List<GeoRadiusResponse> georadiusByMember(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
georadiusByMember
在接口中 JedisCommands
public java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
georadiusByMemberReadonly
在接口中 JedisCommands
public java.util.List<GeoRadiusResponse> georadiusByMember(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusByMember
在接口中 JedisCommands
public java.lang.Long georadiusByMemberStore(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
georadiusByMemberStore
在接口中 MultiKeyCommands
public java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param)
georadiusByMemberReadonly
在接口中 JedisCommands
public java.lang.String moduleLoad(java.lang.String path)
moduleLoad
在接口中 ModuleCommands
public java.lang.String moduleUnload(java.lang.String name)
moduleUnload
在接口中 ModuleCommands
public java.util.List<Module> moduleList()
moduleList
在接口中 ModuleCommands
public java.lang.String aclSetUser(java.lang.String name)
aclSetUser
在接口中 AdvancedJedisCommands
public java.lang.String aclSetUser(java.lang.String name, java.lang.String... params)
aclSetUser
在接口中 AdvancedJedisCommands
public java.lang.Long aclDelUser(java.lang.String name)
aclDelUser
在接口中 AdvancedJedisCommands
public AccessControlUser aclGetUser(java.lang.String name)
aclGetUser
在接口中 AdvancedJedisCommands
public java.util.List<java.lang.String> aclUsers()
aclUsers
在接口中 AdvancedJedisCommands
public java.util.List<java.lang.String> aclList()
aclList
在接口中 AdvancedJedisCommands
public java.lang.String aclWhoAmI()
aclWhoAmI
在接口中 AdvancedJedisCommands
public java.util.List<java.lang.String> aclCat()
aclCat
在接口中 AdvancedJedisCommands
public java.util.List<java.lang.String> aclCat(java.lang.String category)
aclCat
在接口中 AdvancedJedisCommands
public java.util.List<AccessControlLogEntry> aclLog()
aclLog
在接口中 AdvancedJedisCommands
public java.util.List<AccessControlLogEntry> aclLog(int limit)
aclLog
在接口中 AdvancedJedisCommands
public java.lang.String aclLog(java.lang.String options)
aclLog
在接口中 AdvancedJedisCommands
public java.lang.String aclGenPass()
aclGenPass
在接口中 AdvancedJedisCommands
public java.lang.String aclLoad()
aclLoad
在接口中 AdvancedBinaryJedisCommands
aclLoad
在接口中 AdvancedJedisCommands
aclLoad
在类中 BinaryJedis
public java.lang.String aclSave()
aclSave
在接口中 AdvancedBinaryJedisCommands
aclSave
在接口中 AdvancedJedisCommands
aclSave
在类中 BinaryJedis
public java.util.List<java.lang.Long> bitfield(java.lang.String key, java.lang.String... arguments)
JedisCommands
bitfield
在接口中 JedisCommands
public java.util.List<java.lang.Long> bitfieldReadonly(java.lang.String key, java.lang.String... arguments)
bitfieldReadonly
在接口中 JedisCommands
public java.lang.Long hstrlen(java.lang.String key, java.lang.String field)
JedisCommands
hstrlen
在接口中 JedisCommands
public java.lang.String memoryDoctor()
memoryDoctor
在接口中 AdvancedJedisCommands
public java.lang.Long memoryUsage(java.lang.String key)
memoryUsage
在接口中 AdvancedJedisCommands
public java.lang.Long memoryUsage(java.lang.String key, int samples)
memoryUsage
在接口中 AdvancedJedisCommands
public StreamEntryID xadd(java.lang.String key, StreamEntryID id, java.util.Map<java.lang.String,java.lang.String> hash)
JedisCommands
xadd
在接口中 JedisCommands
public StreamEntryID xadd(java.lang.String key, StreamEntryID id, java.util.Map<java.lang.String,java.lang.String> hash, long maxLen, boolean approximateLength)
JedisCommands
xadd
在接口中 JedisCommands
public StreamEntryID xadd(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> hash, XAddParams params)
JedisCommands
xadd
在接口中 JedisCommands
public java.lang.Long xlen(java.lang.String key)
JedisCommands
xlen
在接口中 JedisCommands
public java.util.List<StreamEntry> xrange(java.lang.String key, StreamEntryID start, StreamEntryID end)
JedisCommands
xrange
在接口中 JedisCommands
start
- minimum StreamEntryID
for the retrieved range, passing null
will indicate minimum ID possible in the streamend
- maximum StreamEntryID
for the retrieved range, passing null
will indicate maximum ID possible in the streampublic java.util.List<StreamEntry> xrange(java.lang.String key, StreamEntryID start, StreamEntryID end, int count)
xrange
在接口中 JedisCommands
start
- minimum StreamEntryID
for the retrieved range, passing null
will indicate minimum ID possible in the streamend
- maximum StreamEntryID
for the retrieved range, passing null
will indicate maximum ID possible in the streamcount
- maximum number of entries returnedpublic java.util.List<StreamEntry> xrevrange(java.lang.String key, StreamEntryID end, StreamEntryID start)
JedisCommands
xrevrange
在接口中 JedisCommands
end
- maximum StreamEntryID
for the retrieved range, passing null
will indicate maximum ID possible in the streamstart
- minimum StreamEntryID
for the retrieved range, passing null
will indicate minimum ID possible in the streampublic java.util.List<StreamEntry> xrevrange(java.lang.String key, StreamEntryID end, StreamEntryID start, int count)
xrevrange
在接口中 JedisCommands
end
- maximum StreamEntryID
for the retrieved range, passing null
will indicate maximum ID possible in the streamstart
- minimum StreamEntryID
for the retrieved range, passing null
will indicate minimum ID possible in the streamcount
- The entries with IDs matching the specified range.public java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> xread(int count, long block, java.util.Map.Entry<java.lang.String,StreamEntryID>... streams)
xread
在接口中 MultiKeyCommands
public java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> xread(XReadParams xReadParams, java.util.Map<java.lang.String,StreamEntryID> streams)
xread
在接口中 MultiKeyCommands
public long xack(java.lang.String key, java.lang.String group, StreamEntryID... ids)
xack
在接口中 JedisCommands
public java.lang.String xgroupCreate(java.lang.String key, java.lang.String groupname, StreamEntryID id, boolean makeStream)
JedisCommands
xgroupCreate
在接口中 JedisCommands
public java.lang.String xgroupSetID(java.lang.String key, java.lang.String groupname, StreamEntryID id)
JedisCommands
xgroupSetID
在接口中 JedisCommands
public long xgroupDestroy(java.lang.String key, java.lang.String groupname)
JedisCommands
xgroupDestroy
在接口中 JedisCommands
public java.lang.Long xgroupDelConsumer(java.lang.String key, java.lang.String groupname, java.lang.String consumerName)
JedisCommands
xgroupDelConsumer
在接口中 JedisCommands
public long xdel(java.lang.String key, StreamEntryID... ids)
JedisCommands
xdel
在接口中 JedisCommands
public long xtrim(java.lang.String key, long maxLen, boolean approximateLength)
JedisCommands
xtrim
在接口中 JedisCommands
public long xtrim(java.lang.String key, XTrimParams params)
JedisCommands
xtrim
在接口中 JedisCommands
public java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> xreadGroup(java.lang.String groupname, java.lang.String consumer, int count, long block, boolean noAck, java.util.Map.Entry<java.lang.String,StreamEntryID>... streams)
xreadGroup
在接口中 MultiKeyCommands
public java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<StreamEntry>>> xreadGroup(java.lang.String groupname, java.lang.String consumer, XReadGroupParams xReadGroupParams, java.util.Map<java.lang.String,StreamEntryID> streams)
xreadGroup
在接口中 MultiKeyCommands
public StreamPendingSummary xpending(java.lang.String key, java.lang.String groupname)
JedisCommands
xpending
在接口中 JedisCommands
public java.util.List<StreamPendingEntry> xpending(java.lang.String key, java.lang.String groupname, StreamEntryID start, StreamEntryID end, int count, java.lang.String consumername)
JedisCommands
xpending
在接口中 JedisCommands
public java.util.List<StreamPendingEntry> xpending(java.lang.String key, java.lang.String groupname, XPendingParams params)
JedisCommands
xpending
在接口中 JedisCommands
public java.util.List<StreamEntry> xclaim(java.lang.String key, java.lang.String group, java.lang.String consumername, long minIdleTime, long newIdleTime, int retries, boolean force, StreamEntryID... ids)
JedisCommands
xclaim
在接口中 JedisCommands
public java.util.List<StreamEntry> xclaim(java.lang.String key, java.lang.String group, java.lang.String consumername, long minIdleTime, XClaimParams params, StreamEntryID... ids)
JedisCommands
xclaim
在接口中 JedisCommands
public java.util.List<StreamEntryID> xclaimJustId(java.lang.String key, java.lang.String group, java.lang.String consumername, long minIdleTime, XClaimParams params, StreamEntryID... ids)
JedisCommands
xclaimJustId
在接口中 JedisCommands
public StreamInfo xinfoStream(java.lang.String key)
JedisCommands
xinfoStream
在接口中 JedisCommands
key
- Stream nameStreamInfo
that contains information about the streampublic java.util.List<StreamGroupInfo> xinfoGroup(java.lang.String key)
JedisCommands
xinfoGroup
在接口中 JedisCommands
key
- Stream nameStreamGroupInfo
containing information about groupspublic java.util.List<StreamConsumersInfo> xinfoConsumers(java.lang.String key, java.lang.String group)
JedisCommands
xinfoConsumers
在接口中 JedisCommands
key
- Stream namegroup
- Group nameStreamConsumersInfo
containing information about consumers that belong
to the the grouppublic java.lang.Object sendCommand(ProtocolCommand cmd, java.lang.String... args)
public java.lang.Object sendBlockingCommand(ProtocolCommand cmd, java.lang.String... args)