public class JedisClusterClient extends Object implements JedisClient
Description:
DEFAULT_TIMEOUT, RESULT_OK, RESULT_WHEN_EXCEPTION, SET_EXPIRE_TIME_MILLISECOND, SET_EXPIRE_TIME_SECOND, SET_IF_EXIST, SET_IF_NOT_EXIST| 构造器和说明 |
|---|
JedisClusterClient(redis.clients.jedis.JedisCluster jedisCluster) |
| 限定符和类型 | 方法和说明 |
|---|---|
Long |
append(String key,
String value)
If the key already exists and is a string, this command appends the provided value at the end
of the string.
|
Long |
bigCount(String key) |
Long |
bitCount(String key,
long start,
long end) |
List<Long> |
bitField(String key,
String... arguments) |
Long |
bitOp(redis.clients.jedis.BitOP op,
String destKey,
String... srcKeys) |
Long |
decrease(String key)
Decrement the number stored at key by one.
|
Long |
decreaseBy(String key,
long decrement)
Decrement the number stored at key by decrement count.
|
Long |
delete(String... keys)
Delete from redis with keys... .
|
String |
echo(String string)
print string in redis
|
Object |
eval(String script) |
Object |
eval(String script,
int keyCount,
String... params) |
Object |
eval(String script,
List<String> keys,
List<String> args)
Eval a script in lua .
|
Object |
evalSha(String sha1) |
Object |
evalSha(String sha1,
int keyCount,
String... params) |
Object |
evalSha(String sha1,
List<String> keys,
List<String> args) |
Long |
exists(String... keys)
Test if the specified keys exist.
|
Boolean |
exists(String key)
if key exist or not .
|
Long |
expire(String key,
int seconds)
expire key in time of seconds
CMD: TTL seconds
this key will be removed at time after now in seconds. |
Long |
expire(String key,
long timeMillis)
expire key in time of milliseconds
CMD: expire key time
this key will be removed at time after now in seconds. |
Long |
expireAt(String key,
long unixTimestamp)
expire key at time of unix timestamp. it takes an absolute one in the form of a UNIX timestamp (Number of
seconds elapsed since 1 Gen 1970).
|
Long |
geoAdd(String key,
double longitude,
double latitude,
String value)
Add a geo location of value
|
Long |
geoAdd(String key,
Map<String,redis.clients.jedis.GeoCoordinate> memberCoordinateMap) |
Double |
geoDistant(String key,
String source,
String target) |
Double |
geoDistant(String key,
String source,
String target,
redis.clients.jedis.GeoUnit unit) |
List<String> |
geoHash(String key,
String... values) |
List<redis.clients.jedis.GeoCoordinate> |
geoPos(String key,
String... values) |
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadius(String key,
double longitude,
double latitude,
double radius,
redis.clients.jedis.GeoUnit unit)
Find values that distant is in radius with longitude and latitude.
|
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadius(String key,
double longitude,
double latitude,
double radius,
redis.clients.jedis.GeoUnit unit,
redis.clients.jedis.params.GeoRadiusParam param) |
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadiusByMember(String key,
String member,
double radius,
redis.clients.jedis.GeoUnit unit) |
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadiusByMember(String key,
String member,
double radius,
redis.clients.jedis.GeoUnit unit,
redis.clients.jedis.params.GeoRadiusParam param) |
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadiusByMemberReadonly(String key,
String member,
double radius,
redis.clients.jedis.GeoUnit unit) |
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadiusByMemberReadonly(String key,
String member,
double radius,
redis.clients.jedis.GeoUnit unit,
redis.clients.jedis.params.GeoRadiusParam param) |
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadiusReadonly(String key,
double longitude,
double latitude,
double radius,
redis.clients.jedis.GeoUnit unit) |
List<redis.clients.jedis.GeoRadiusResponse> |
geoRadiusReadonly(String key,
double longitude,
double latitude,
double radius,
redis.clients.jedis.GeoUnit unit,
redis.clients.jedis.params.GeoRadiusParam param) |
List<String> |
get(String... keys)
Get the values of all the specified keys.
|
String |
get(String key)
Get value from redis with key.
|
Boolean |
getBit(String key,
long offset)
check if the offset of key is positive.
|
String |
getRange(String key,
long offset,
long endOffset)
get the substring of key that between offset and endOffset.
|
String |
getSet(String key,
String value)
atomic set this value and return the old value command.
|
Long |
increase(String key)
Increment the number stored at key by one.
|
Long |
increaseBy(String key,
long increment)
Increment the number stored at key by increment count.
|
Double |
increaseByFloat(String key,
float increment)
this is actually a string operation, that is, in Redis there are not "double" types.
|
Set<String> |
keys(String pattern)
Get a set of keys that exist in redis match with pattern.
|
List<String> |
listBlockingLeftPop(int timeout,
String... keys)
BLPOP (and BRPOP) is a blocking list pop primitive.
|
List<String> |
listBlockingRightPop(int timeout,
String... keys)
|
String |
listBlockingRightPopLeftPush(String srcKey,
String targetKey,
int timeout)
Pop a value from a list, push it to another list and return it; or block until one is available
|
String |
listIndex(String key,
long index)
Return the specified element of the list stored at the specified key. 0 is the first element, 1
the second and so on.
|
Long |
listInsert(String key,
redis.clients.jedis.ListPosition where,
String anchor,
String value)
Insert a value into list of where with anchor.
|
String |
listLeftPop(String key)
Pop out the HEAD value just push to the list.
|
Long |
listLeftPush(String key,
String... values)
Add the string value to the HEAD of the list.
|
Long |
listLeftPushExist(String key,
String... values)
Add the string value to the HEAD of the list.
|
Long |
listLength(String key)
Return the length of the list stored at the specified key.
|
String |
listPop(String key)
Pop out the value just push to the list.
|
Long |
listPush(String key,
String... values)
Add the string value to the TAIL of the list.
|
List<String> |
listRange(String key,
long start,
long end)
Return the specified elements of the list stored at the specified key.
|
Long |
listRemove(String key,
long count,
String value)
Remove the first count occurrences of the value element from the list.
|
String |
listRightPop(String key)
Pop out the TAIL value just push to the list.
|
String |
listRightPopLeftPush(String srcKey,
String targetKey)
Atomically return and remove the last (tail) element of the srckey list, and push the element
as the first (head) element of the dstkey list.
|
Long |
listRightPush(String key,
String... values)
Add the string value to the TAIL of the list.
|
Long |
listRightPushExist(String key,
String... values)
Add the string value to the TAIL of the list.
|
String |
listSet(String key,
long index,
String value)
Set a new value as the element at index position of the List at key.
|
String |
listTrim(String key,
long start,
long end)
Trim an existing list so that it will contain only the specified range of elements specified.
|
Map<String,String> |
mapAll(String key)
Return all the fields and associated values in a hash.
|
Long |
mapDelete(String key,
String... fields)
Remove the specified field from an hash stored at key.
|
Boolean |
mapExist(String key,
String field)
Test for existence of a specified field in a hash.
|
String |
mapGet(String key,
String field)
If key holds a hash, retrieve the value associated to the specified field.
|
Long |
mapIncreaseBy(String key,
String field,
long value)
Increment the number stored at field in the hash at key by value.
|
Double |
mapIncreaseByFloat(String key,
String field,
float value)
Increment the number stored at field in the hash at key by a double precision floating point
value.
|
Set<String> |
mapKeys(String key)
Return all the fields in a hash.
|
Long |
mapLength(String key)
Get the length of a hash key.
|
List<String> |
mapMultiGet(String key,
String... fields)
Retrieve the values associated to the specified fields.
|
Long |
mapSet(String key,
Map<String,String> map)
Set the specified hash map field to the specified value.
|
Long |
mapSet(String key,
String field,
String value)
Set the specified hash map field to the specified value.
|
Long |
mapSetNx(String key,
String field,
String value)
Set the specified hash field to the specified value if the field not exists.
|
List<String> |
mapValues(String key)
Return all the values in a hash.
|
String |
multiSet(String... keyValues)
set key values into a map structure.
|
Long |
multiSetNx(String... keyValues)
set key values info a map structure only if all keys not exist in map.
|
void |
patternSubscribe(redis.clients.jedis.JedisPubSub jedisPubSub,
String... patterns)
subscribe channels in patterns...
|
Long |
persist(String key)
Undo a
expire at turning the expire key into a normal key. |
Long |
publish(String channel,
String message)
publish message to channel.
|
List<Boolean> |
scriptExists(String... sha1) |
Boolean |
scriptExists(String sha1) |
String |
scriptLoad(String script) |
String |
set(String key,
String value)
Set a value with key with no expire times.
|
String |
set(String key,
String value,
long expireInMillis)
Set value with expire time .
|
String |
set(String key,
String value,
redis.clients.jedis.params.SetParams setParams)
Set value with some options like:
NX: set key only if key not exist
XX: set key only if key exist
PX: set key expire time in milliseconds.
|
Boolean |
setBit(String key,
long offset,
boolean value)
Sets or clears the bit at offset in the string value stored at key
set value:1 00000000000
setbit value:1 2 1
after set value:1 00100000000 |
Boolean |
setBit(String key,
long offset,
String value)
|
Long |
setRange(String key,
long offset,
String value)
cover the string value of key of new value that offset to key.
|
Long |
setsAdd(String key,
String... values)
Add the specified member to the set value stored at key.
|
Long |
setsDelete(String key,
String... values)
Remove the specified member from the set value stored at key.
|
Set<String> |
setsDifferent(String... keys)
Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN
Example:
key1 = [x, a, b, c]
key2 = [c]
key3 = [a, d]
SDIFF key1,key2,key3 => [x, b]
Non existing keys are considered like empty sets.
|
Long |
setsDifferentStore(String destKey,
String... keys)
This command works exactly like
JedisClient.setsDifferent(String...) but instead of being returned
the resulting set is stored in destkey. |
Boolean |
setsExist(String key,
String value)
Return true if member is a member of the set stored at key, otherwise false is returned.
|
Set<String> |
setsInter(String... keys)
Return the members of a set resulting from the intersection of all the sets hold at the
specified keys.
|
Long |
setsInterStore(String destKey,
String... keys)
This command works exactly like
JedisClient.setsInter(String...) |
Long |
setsLength(String key)
Return the set cardinality (number of elements).
|
Long |
setsMove(String srcKey,
String targetKey,
String value)
Move the specified member from the set at srckey to the set at dstkey.
|
String |
setsPop(String key)
Remove a random element from a Set returning it as return value.
|
Set<String> |
setsPop(String key,
long count)
Remove a random element from a Set returning it as return value.
|
String |
setsRandomValue(String key)
Return a random element from a Set, without removing the element.
|
List<String> |
setsRandomValue(String key,
int count)
Return a count of random elements from a Set, without removing the element.
|
Set<String> |
setsUnion(String... keys)
Return the members of a set resulting from the union of all the sets hold at the specified
keys.
|
Long |
setsUnionStore(String destKey,
String... keys)
This command works exactly like
JedisClient.setsUnion(String...) |
Set<String> |
setsValues(String key)
Return all the members (elements) of the set value stored at key.
|
List<String> |
sort(String key)
Sort a Set or a List.
|
List<String> |
sort(String key,
redis.clients.jedis.SortingParams sortingParameters)
Sort a Set or a List accordingly to the specified parameters.
|
Long |
sortStore(String key,
redis.clients.jedis.SortingParams sortingParameters,
String destKey)
Sort a Set or a List and Store the Result at dstkey.
|
Long |
sortStore(String key,
String destKey)
Sort a Set or a List and Store the Result at dstkey.
|
void |
subscribe(redis.clients.jedis.JedisPubSub jedisPubSub,
String... channels)
subscribe channels ..
|
String |
subString(String key,
int start,
int end)
Return a subset of the string from offset start to offset end (both offsets are inclusive).
|
Long |
touch(String... keys)
Alters the last access time of a key(s).
|
Long |
ttl(String key)
Get the remaining time to live in seconds of a key.
|
String |
type(String key)
get the type of this key.
|
Long |
zsetAdd(String key,
double score,
String value)
Add the specified member having the specified score to the sorted set stored at key.
|
Long |
zsetAdd(String key,
double score,
String value,
redis.clients.jedis.params.ZAddParams params)
Add the specified member having the specified score to the sorted set stored at key.
|
Long |
zsetAdd(String key,
Map<String,Double> valueScores)
Add the specified member having the specified score to the sorted set stored at key.
|
Long |
zsetAdd(String key,
Map<String,Double> valueScores,
redis.clients.jedis.params.ZAddParams params)
Add the specified member having the specified score to the sorted set stored at key.
|
Long |
zsetDelete(String key,
String... values)
Remove the specified member from the sorted set value stored at key.
|
Long |
zsetDeleteRangeByIndex(String key,
long start,
long end)
Remove all elements in the sorted set at key with rank between start and end.
|
Long |
zsetDeleteRangeByLex(String key,
String min,
String max) |
Long |
zsetDeleteRangeByScore(String key,
double min,
double max)
Remove all the elements in the sorted set at key with a score between min and max (including
elements with score equal to min or max).
|
Long |
zsetDeleteRangeByScore(String key,
String min,
String max)
|
Double |
zsetIncreaseBy(String key,
double increment,
String value)
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.
|
Double |
zsetIncreaseBy(String key,
double increment,
String value,
redis.clients.jedis.params.ZIncrByParams params)
If member already exists in the sorted set adds the increment to its score and updates the
position of the element in the sorted set accordingly.
|
Long |
zsetIndexOf(String key,
String value)
Return the rank (or index) of member in the sorted set at key, with scores being ordered from
low to high.
|
Long |
zsetInterStore(String destKey,
String... keys)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
Long |
zsetInterStore(String destKey,
redis.clients.jedis.ZParams params,
String... keys)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
Long |
zsetLength(String key)
Return the sorted set cardinality (number of elements).
|
Long |
zsetLexLength(String key,
String min,
String max)
Return count of set values that lex value between min and max
such as:
a -> z
|
Set<String> |
zsetRange(String key,
long start,
long end)
Return a range of zset . this function such as
JedisClient.listRange(String, long, long) |
Set<String> |
zsetRangeByLex(String key,
String min,
String max)
|
Set<String> |
zsetRangeByLex(String key,
String min,
String max,
int offset,
int count) |
Set<String> |
zsetRangeByScore(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).
|
Set<String> |
zsetRangeByScore(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).
|
Set<String> |
zsetRangeByScore(String key,
String min,
String max)
|
Set<String> |
zsetRangeByScore(String key,
String min,
String max,
int offset,
int count)
|
Set<redis.clients.jedis.Tuple> |
zsetRangeByScoreWithScores(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).
|
Set<redis.clients.jedis.Tuple> |
zsetRangeByScoreWithScores(String key,
double min,
double max,
int offset,
int count)
|
Set<redis.clients.jedis.Tuple> |
zsetRangeByScoreWithScores(String key,
String min,
String max)
|
Set<redis.clients.jedis.Tuple> |
zsetRangeByScoreWithScores(String key,
String min,
String max,
int offset,
int count)
|
Set<redis.clients.jedis.Tuple> |
zsetRangeWithScores(String key,
long start,
long end)
return range of zset.
|
Long |
zsetReverseIndexOf(String key,
String value)
Return the rank (or index) of member in the sorted set at key, with scores being ordered from
high to low.
|
Set<String> |
zsetReverseRange(String key,
long start,
long end)
return reverse range of zset.
|
Set<String> |
zsetReverseRangeByLex(String key,
String min,
String max) |
Set<String> |
zsetReverseRangeByLex(String key,
String min,
String max,
int offset,
int count) |
Set<String> |
zsetReverseRangeByScore(String key,
double min,
double max)
|
Set<String> |
zsetReverseRangeByScore(String key,
double min,
double max,
int offset,
int count) |
Set<String> |
zsetReverseRangeByScore(String key,
String min,
String max) |
Set<String> |
zsetReverseRangeByScore(String key,
String min,
String max,
int offset,
int count) |
Set<redis.clients.jedis.Tuple> |
zsetReverseRangeByScoreWithScores(String key,
double min,
double max) |
Set<redis.clients.jedis.Tuple> |
zsetReverseRangeByScoreWithScores(String key,
double min,
double max,
int offset,
int count) |
Set<redis.clients.jedis.Tuple> |
zsetReverseRangeByScoreWithScores(String key,
String min,
String max) |
Set<redis.clients.jedis.Tuple> |
zsetReverseRangeByScoreWithScores(String key,
String min,
String max,
int offset,
int count) |
Set<redis.clients.jedis.Tuple> |
zsetReverseRangeWithScores(String key,
long start,
long end)
return reverse range of zset.
|
Double |
zsetScore(String key,
String value)
Return the score of the specified element of the sorted set at key.
|
Long |
zsetUnionStore(String destKey,
String... keys)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
Long |
zsetUnionStore(String destKey,
redis.clients.jedis.ZParams params,
String... keys)
Creates a union or intersection of N sorted sets given by keys k1 through kN, and stores it at
dstkey.
|
public String set(String key, String value)
JedisClientset("key","value")
The string can't be longer than 1073741824 bytes (1GB).
And this will return JedisClient.RESULT_OK if succeed.set 在接口中 JedisClientkey - keyvalue - valuepublic String set(String key, String value, long expireInMillis)
JedisClientJedisClient.set(String, String, SetParams)
set(key, value, SetParams.setParams().px(expireInMillis))
And this will return JedisClient.RESULT_OK if succeed.set 在接口中 JedisClientkey - keyvalue - valueexpireInMillis - expire time in millisecondspublic String set(String key, String value, redis.clients.jedis.params.SetParams setParams)
JedisClientSetParams param = SetParams.setParams().nx().px(123L);
And this will return JedisClient.RESULT_OK if succeed.set 在接口中 JedisClientkey - keyvalue - valuesetParams - paramspublic String multiSet(String... keyValues)
JedisClientmultiSet 在接口中 JedisClientkeyValues - key value pairspublic Long multiSetNx(String... keyValues)
JedisClientmultiSetNx 在接口中 JedisClientpublic String get(String key)
JedisClientget 在接口中 JedisClientkey - keypublic List<String> get(String... keys)
JedisClientget 在接口中 JedisClientkeys - keys to getpublic Long exists(String... keys)
JedisClientexists 在接口中 JedisClientkeys - keys to be testpublic Boolean exists(String key)
JedisClientexists 在接口中 JedisClientkey - key to be testpublic Long expire(String key, int seconds)
JedisClientCMD: TTL seconds
this key will be removed at time after now in seconds.
return :
1: the timeout was set.
0: the timeout was not set since the key already has an associated timeout
(this may happen only in Redis versions < 2.1.3, Redis >= 2.1.3 will
happily update the timeout), or the key does not exist.expire 在接口中 JedisClientkey - keyseconds - time in secondspublic Long expire(String key, long timeMillis)
JedisClientCMD: expire key time
this key will be removed at time after now in seconds.
return :
1: the timeout was set.
0: the timeout was not set since the key already has an associated timeout
(this may happen only in Redis versions < 2.1.3, Redis >= 2.1.3 will
happily update the timeout), or the key does not exist.expire 在接口中 JedisClientkey - keytimeMillis - time in millisecondspublic Long expireAt(String key, long unixTimestamp)
JedisClientexpireAt 在接口中 JedisClientkey - keyunixTimestamp - timestamppublic Long persist(String key)
JedisClientexpire at turning the expire key into a normal key.persist 在接口中 JedisClientkey - keypublic Long ttl(String key)
JedisClientttl 在接口中 JedisClientpublic String echo(String string)
JedisClientecho 在接口中 JedisClientstring - string to echopublic Long delete(String... keys)
JedisClientjedis.unlink(keys) CMD: unlink ...
more. see Jedis
or JedisClusterdelete 在接口中 JedisClientkeys - keys to be removedpublic String type(String key)
JedisClienttype 在接口中 JedisClientkey - keypublic Set<String> keys(String pattern)
JedisClientkeys 在接口中 JedisClientpattern - pattern of keyspublic Long touch(String... keys)
JedisClienttouch 在接口中 JedisClientkeys - keys to be touchpublic String getSet(String key, String value)
JedisClientgetSet 在接口中 JedisClientkey - keyvalue - new value of keypublic Long increase(String key)
JedisClientINCR 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.
increase 在接口中 JedisClientkey - keypublic Long increaseBy(String key, long increment)
JedisClientINCR 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.
increaseBy 在接口中 JedisClientkey - keyincrement - increment countpublic Long decrease(String key)
JedisClientINCR 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, decremented, and then converted back as a string.
decrease 在接口中 JedisClientkey - keypublic Long decreaseBy(String key, long decrement)
JedisClientINCR 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, decremented, and then converted back as a string.
decreaseBy 在接口中 JedisClientkey - keydecrement - increment countpublic Double increaseByFloat(String key, float increment)
JedisClientincreaseByFloat 在接口中 JedisClientkey - keyincrement - incrementpublic Long append(String key, String value)
JedisClientappend 在接口中 JedisClientkey - keyvalue - valuepublic String subString(String key, int start, int end)
JedisClientThe function handles out of range requests without raising an error, but just limiting the resulting range to the actual length of the string.
subString 在接口中 JedisClientkey - keystart - start indexend - end indexpublic Boolean setBit(String key, long offset, boolean value)
JedisClient
set value:1 00000000000
setbit value:1 2 1
after set value:1 00100000000setBit 在接口中 JedisClientkey - keyoffset - offsetvalue - bit valuepublic Boolean setBit(String key, long offset, String value)
JedisClientsetBit 在接口中 JedisClientkey - keyoffset - offsetvalue - bit valuepublic Boolean getBit(String key, long offset)
JedisClientJedisClient.setBit(String, long, String)getBit 在接口中 JedisClientkey - keyoffset - offsetpublic Long bigCount(String key)
bigCount 在接口中 JedisClientpublic Long bitCount(String key, long start, long end)
bitCount 在接口中 JedisClientpublic Long bitOp(redis.clients.jedis.BitOP op, String destKey, String... srcKeys)
bitOp 在接口中 JedisClientpublic Long setRange(String key, long offset, String value)
JedisClientset 4 "FOO"
become"Hello FOO"
Do nothing if key not exist.setRange 在接口中 JedisClientkey - keyoffset - offset to covervalue - new valuepublic String getRange(String key, long offset, long endOffset)
JedisClientgetRange 在接口中 JedisClientkey - keyoffset - start offset of stringendOffset - end offset of stringpublic Long mapSet(String key, String field, String value)
JedisClientmapSet 在接口中 JedisClientkey - key to hold this hash mapfield - field namevalue - valuepublic Long mapSet(String key, Map<String,String> map)
JedisClientCMD: HMSET key values...
returns:
mapSet 在接口中 JedisClientkey - keymap - value mappublic Long mapSetNx(String key, String field, String value)
JedisClientmapSetNx 在接口中 JedisClientkey - keyfield - fieldvalue - valuepublic Long mapIncreaseBy(String key, String field, long value)
JedisClientmapIncreaseBy 在接口中 JedisClientkey - keyfield - fieldvalue - increment.public Double mapIncreaseByFloat(String key, String field, float value)
JedisClientmapIncreaseByFloat 在接口中 JedisClientkey - hash keyfield - fieldvalue - float incrementpublic String mapGet(String key, String field)
JedisClientmapGet 在接口中 JedisClientkey - keyfield - fieldpublic List<String> mapMultiGet(String key, String... fields)
JedisClientmapMultiGet 在接口中 JedisClientkey - keyfields - fields to requestpublic Long mapLength(String key)
JedisClientmapLength 在接口中 JedisClientkey - hash keypublic Boolean mapExist(String key, String field)
JedisClientmapExist 在接口中 JedisClientkey - keyfield - fieldpublic Set<String> mapKeys(String key)
JedisClientmapKeys 在接口中 JedisClientkey - hash keypublic List<String> mapValues(String key)
JedisClientmapValues 在接口中 JedisClientkey - hash keypublic Map<String,String> mapAll(String key)
JedisClientmapAll 在接口中 JedisClientkey - hash keypublic Long mapDelete(String key, String... fields)
JedisClientmapDelete 在接口中 JedisClientkey - keyfields - fields to be removedpublic Long listPush(String key, String... values)
JedisClientJedisClient.listRightPush(String, String...)
If the key does not exist an empty list is created just before the append operation.
If the key exists but is not a List an error is returned.listPush 在接口中 JedisClientkey - keyvalues - values to be pushpublic Long listInsert(String key, redis.clients.jedis.ListPosition where, String anchor, String value)
JedisClientListPosition.BEFORE "FOO" will display as "VALUE" "FOO"
ListPosition.AFTER "FOO" will display as "FOO" "VALUE"
if key of list or anchor does not exist . do nothing.
return total size of list after operation.listInsert 在接口中 JedisClientkey - key of listwhere - position ListPositionanchor - anchor valuevalue - valuepublic Long listRightPush(String key, String... values)
JedisClientlistRightPush 在接口中 JedisClientkey - keyvalues - values to be pushpublic Long listRightPushExist(String key, String... values)
JedisClientlistRightPushExist 在接口中 JedisClientkey - keyvalues - values to be pushpublic Long listLeftPush(String key, String... values)
JedisClientlistLeftPush 在接口中 JedisClientkey - keyvalues - values to be pushpublic Long listLeftPushExist(String key, String... values)
JedisClientlistLeftPushExist 在接口中 JedisClientkey - keyvalues - values to be pushpublic Long listLength(String key)
JedisClientlistLength 在接口中 JedisClientkey - list keypublic List<String> listRange(String key, long start, long end)
JedisClientFor 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.
listRange 在接口中 JedisClientkey - list keystart - start indexend - end index.public String listTrim(String key, long start, long end)
JedisClientFor 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.
listTrim 在接口中 JedisClientkey - list keystart - start indexend - end index.public String listIndex(String key, long index)
JedisClientIf 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).
listIndex 在接口中 JedisClientkey - list keyindex - indexpublic String listSet(String key, long index, String value)
JedisClientOut 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.
listSet 在接口中 JedisClientkey - list keyindex - indexvalue - valuepublic Long listRemove(String key, long count, String value)
JedisClientlistRemove 在接口中 JedisClientkey - list keycount - count to be removedvalue - value to be removedpublic String listPop(String key)
JedisClientJedisClient.listPush(String, String...)
If the key does not exist or the list is already empty the special value 'nil' is returned.listPop 在接口中 JedisClientkey - list keypublic String listRightPop(String key)
JedisClientJedisClient.listPush(String, String...)
If the key does not exist or the list is already empty the special value 'nil' is returned.listRightPop 在接口中 JedisClientkey - list keypublic String listLeftPop(String key)
JedisClientJedisClient.listPush(String, String...)
If the key does not exist or the list is already empty the special value 'nil' is returned.listLeftPop 在接口中 JedisClientkey - list keypublic String listRightPopLeftPush(String srcKey, String targetKey)
JedisClientIf 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.
listRightPopLeftPush 在接口中 JedisClientsrcKey - source keytargetKey - target keypublic List<String> listBlockingLeftPop(int timeout, String... keys)
JedisClientThe 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 :)
listBlockingLeftPop 在接口中 JedisClienttimeout - time outkeys - keyspublic List<String> listBlockingRightPop(int timeout, String... keys)
JedisClientlistBlockingRightPop 在接口中 JedisClienttimeout - timeoutkeys - keyspublic String listBlockingRightPopLeftPush(String srcKey, String targetKey, int timeout)
JedisClientlistBlockingRightPopLeftPush 在接口中 JedisClientsrcKey - source keytargetKey - target keytimeout - timeout count.public Long setsAdd(String key, String... values)
JedisClientsetsAdd 在接口中 JedisClientkey - set keypublic Set<String> setsValues(String key)
JedisClientsetsValues 在接口中 JedisClientkey - set keypublic Long setsDelete(String key, String... values)
JedisClientsetsDelete 在接口中 JedisClientkey - set keyvalues - values to be removedpublic String setsPop(String key)
JedisClientJedisClient.setsPop(String, long)setsPop 在接口中 JedisClientkey - keypublic Set<String> setsPop(String key, long count)
JedisClientsetsPop 在接口中 JedisClientkey - set keycount - value count to be poppublic Long setsLength(String key)
JedisClientsetsLength 在接口中 JedisClientkey - keypublic Long setsMove(String srcKey, String targetKey, String value)
JedisClientIf 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.
returns:
setsMove 在接口中 JedisClientsrcKey - source keytargetKey - target keyvalue - value to be movedpublic Boolean setsExist(String key, String value)
JedisClientsetsExist 在接口中 JedisClientkey - keyvalue - valuepublic Set<String> setsInter(String... keys)
JedisClientJedisClient.listRange(String, long, long) (String, long, long) 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
JedisClient.setsValues(String) (String) 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).
setsInter 在接口中 JedisClientkeys - set keyspublic Long setsInterStore(String destKey, String... keys)
JedisClientJedisClient.setsInter(String...) SINTER} but instead of being returned
the resulting set is stored as dstkey.
setsInterStore 在接口中 JedisClientdestKey - target keykeys - source keyspublic Set<String> setsUnion(String... keys)
JedisClientJedisClient.listRange(String, long, long) 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 JedisClient.setsValues(String) SMEMBERS}.
Non existing keys are considered like empty sets.
setsUnion 在接口中 JedisClientkeys - set keyspublic Long setsUnionStore(String destKey, String... keys)
JedisClientJedisClient.setsUnion(String...) SUNION} but instead of being returned
the resulting set is stored as dstkey. Any existing value in dstkey will be over-written.
setsUnionStore 在接口中 JedisClientdestKey - dest keykeys - keyspublic Set<String> setsDifferent(String... keys)
JedisClientExample:
key1 = [x, a, b, c] key2 = [c] key3 = [a, d] SDIFF key1,key2,key3 => [x, b]Non existing keys are considered like empty sets.
setsDifferent 在接口中 JedisClientkeys - key1 to keys all.public Long setsDifferentStore(String destKey, String... keys)
JedisClientJedisClient.setsDifferent(String...) but instead of being returned
the resulting set is stored in destkey.setsDifferentStore 在接口中 JedisClientdestKey - dest keykeys - keyspublic String setsRandomValue(String key)
JedisClientsetsRandomValue 在接口中 JedisClientkey - set keypublic List<String> setsRandomValue(String key, int count)
JedisClientsetsRandomValue 在接口中 JedisClientkey - set keycount - value countpublic Long zsetAdd(String key, double score, String value)
JedisClientThe score value can be the string representation of a double precision floating point number. returns:
zsetAdd 在接口中 JedisClientkey - keyscore - sort score of this valuevalue - valuepublic Long zsetAdd(String key, double score, String value, redis.clients.jedis.params.ZAddParams params)
JedisClientzsetAdd 在接口中 JedisClientkey - keyscore - the score of valuevalue - value of scoreparams - set paramspublic Long zsetAdd(String key, Map<String,Double> valueScores)
JedisClientzsetAdd 在接口中 JedisClientkey - keyvalueScores - value score pairpublic Long zsetAdd(String key, Map<String,Double> valueScores, redis.clients.jedis.params.ZAddParams params)
JedisClientzsetAdd 在接口中 JedisClientkey - keyvalueScores - value score pairparams - add parampublic Set<String> zsetRange(String key, long start, long end)
JedisClientJedisClient.listRange(String, long, long)zsetRange 在接口中 JedisClientkey - set keystart - start indexend - end index.public Long zsetDelete(String key, String... values)
JedisClientzsetDelete 在接口中 JedisClientkey - zset keyvalues - valuespublic Double zsetIncreaseBy(String key, double increment, String value)
JedisClientThe 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.
zsetIncreaseBy 在接口中 JedisClientkey - set keyincrement - incrementvalue - valuepublic Double zsetIncreaseBy(String key, double increment, String value, redis.clients.jedis.params.ZIncrByParams params)
JedisClientThe 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.
zsetIncreaseBy 在接口中 JedisClientkey - set keyincrement - incrementvalue - valueparams - incrBy paramspublic Long zsetIndexOf(String key, String value)
JedisClientWhen 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.
zsetIndexOf 在接口中 JedisClientkey - zset keyvalue - zset valuepublic Long zsetReverseIndexOf(String key, String value)
JedisClientWhen 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.
zsetReverseIndexOf 在接口中 JedisClientkey - zset keyvalue - zset valuepublic Set<String> zsetReverseRange(String key, long start, long end)
JedisClientJedisClient.zsetRange(String, long, long)zsetReverseRange 在接口中 JedisClientkey - zset keystart - start indexend - end indexpublic Set<redis.clients.jedis.Tuple> zsetRangeWithScores(String key, long start, long end)
JedisClientJedisClient.zsetRange(String, long, long)
witch is contain in Tuple with element and score.zsetRangeWithScores 在接口中 JedisClientkey - zset keystart - start indexend - end indexpublic Set<redis.clients.jedis.Tuple> zsetReverseRangeWithScores(String key, long start, long end)
JedisClientJedisClient.zsetRange(String, long, long)
witch is contain in Tuple with element and score.zsetReverseRangeWithScores 在接口中 JedisClientkey - zset keystart - start indexend - end indexpublic Long zsetLength(String key)
JedisClientzsetLength 在接口中 JedisClientkey - keypublic Double zsetScore(String key, String value)
JedisClientzsetScore 在接口中 JedisClientkey - zset keyvalue - zset valuepublic List<String> sort(String key)
JedisClientSort 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 在接口中 JedisClientkey - keyJedisClient.sortStore(String, String),
JedisClient.sort(String, SortingParams),
JedisClient.sortStore(String, SortingParams, String)public List<String> sort(String key, redis.clients.jedis.SortingParams sortingParameters)
JedisClientexamples:
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 在接口中 JedisClientkey - keysortingParameters - sorting parameterspublic Long sortStore(String key, String destKey)
JedisClientSort 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.
sortStore 在接口中 JedisClientkey - keydestKey - target keypublic Long sortStore(String key, redis.clients.jedis.SortingParams sortingParameters, String destKey)
JedisClientSort 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.
sortStore 在接口中 JedisClientkey - keysortingParameters - paramdestKey - target keypublic Set<String> zsetRangeByScore(String key, double min, double max)
JedisClientThe 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 JedisClient.zsetRangeByScore(String, double, double) 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 command is similar to
JedisClient.zsetRangeByScore(String, double, double)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).
zsetRangeByScore 在接口中 JedisClientkey - set keymin - min scoremax - max scoreJedisClient.zsetRangeByScore(String, double, double),
JedisClient.zsetRangeByScore(String, double, double, int, int),
JedisClient.zsetRangeByScoreWithScores(String, double, double),
JedisClient.zsetRangeByScoreWithScores(String, double, double, int, int)public Set<String> zsetRangeByScore(String key, String min, String max)
JedisClientzsetRangeByScore 在接口中 JedisClientkey - set keymin - min scoremax - max scorepublic Set<String> zsetRangeByScore(String key, double min, double max, int offset, int count)
JedisClientThe 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 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).
zsetRangeByScore 在接口中 JedisClientkey - set keymin - min scoremax - max scoreoffset - offset indexcount - count of setpublic Set<String> zsetRangeByScore(String key, String min, String max, int offset, int count)
JedisClientzsetRangeByScore 在接口中 JedisClientkey - set keymin - min scoremax - max scoreoffset - offset indexcount - count of setpublic Set<redis.clients.jedis.Tuple> zsetRangeByScoreWithScores(String key, double min, double max)
JedisClientThe 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 JedisClient.zsetRangeByScore(String, String, String, int, int) 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 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).
zsetRangeByScoreWithScores 在接口中 JedisClientkey - keymin - min scoremax - max scorepublic Set<redis.clients.jedis.Tuple> zsetRangeByScoreWithScores(String key, String min, String max)
JedisClientzsetRangeByScoreWithScores 在接口中 JedisClientkey - keymin - min scoremax - max scorepublic Set<redis.clients.jedis.Tuple> zsetRangeByScoreWithScores(String key, double min, double max, int offset, int count)
JedisClientJedisClient.zsetRangeByScoreWithScores(String, String, String)
JedisClient.zsetRangeByScore(String, double, double, int ,int)zsetRangeByScoreWithScores 在接口中 JedisClientkey - keymin - min scoremax - max scorepublic Set<redis.clients.jedis.Tuple> zsetRangeByScoreWithScores(String key, String min, String max, int offset, int count)
JedisClientJedisClient.zsetRangeByScoreWithScores(String, String, String)
JedisClient.zsetRangeByScore(String, double, double, int ,int)zsetRangeByScoreWithScores 在接口中 JedisClientkey - keymin - min scoremax - max scorepublic Set<String> zsetReverseRangeByScore(String key, double min, double max)
JedisClientzsetReverseRangeByScore 在接口中 JedisClientkey - keymin - minmax - maxpublic Set<String> zsetReverseRangeByScore(String key, String min, String max)
zsetReverseRangeByScore 在接口中 JedisClientpublic Set<String> zsetReverseRangeByScore(String key, double min, double max, int offset, int count)
zsetReverseRangeByScore 在接口中 JedisClientpublic Set<String> zsetReverseRangeByScore(String key, String min, String max, int offset, int count)
zsetReverseRangeByScore 在接口中 JedisClientpublic Set<redis.clients.jedis.Tuple> zsetReverseRangeByScoreWithScores(String key, double min, double max)
zsetReverseRangeByScoreWithScores 在接口中 JedisClientpublic Set<redis.clients.jedis.Tuple> zsetReverseRangeByScoreWithScores(String key, String min, String max)
zsetReverseRangeByScoreWithScores 在接口中 JedisClientpublic Set<redis.clients.jedis.Tuple> zsetReverseRangeByScoreWithScores(String key, double min, double max, int offset, int count)
zsetReverseRangeByScoreWithScores 在接口中 JedisClientpublic Set<redis.clients.jedis.Tuple> zsetReverseRangeByScoreWithScores(String key, String min, String max, int offset, int count)
zsetReverseRangeByScoreWithScores 在接口中 JedisClientpublic Long zsetDeleteRangeByIndex(String key, long start, long end)
JedisClientzsetDeleteRangeByIndex 在接口中 JedisClientkey - set keystart - start indexend - end indexpublic Long zsetDeleteRangeByScore(String key, double min, double max)
JedisClientzsetDeleteRangeByScore 在接口中 JedisClientkey - keymin - minmax - maxpublic Long zsetDeleteRangeByScore(String key, String min, String max)
JedisClientzsetDeleteRangeByScore 在接口中 JedisClientkey - keymin - minmax - maxpublic Long zsetUnionStore(String destKey, String... keys)
JedisClient
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.
zsetUnionStore 在接口中 JedisClientdestKey - target keykeys - source set's keyspublic Long zsetUnionStore(String destKey, redis.clients.jedis.ZParams params, String... keys)
JedisClient
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.
zsetUnionStore 在接口中 JedisClientdestKey - target keyparams - set paramskeys - source set's keyspublic Long zsetInterStore(String destKey, String... keys)
JedisClient
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.
zsetInterStore 在接口中 JedisClientdestKey - target keykeys - source set's keyspublic Long zsetInterStore(String destKey, redis.clients.jedis.ZParams params, String... keys)
JedisClient
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.
zsetInterStore 在接口中 JedisClientdestKey - target keyparams - set paramskeys - source set's keyspublic Long zsetLexLength(String key, String min, String max)
JedisClientzsetLexLength 在接口中 JedisClientkey - keymin - min lexmax - max lexpublic Set<String> zsetRangeByLex(String key, String min, String max)
JedisClientJedisClient.zsetRangeByScore(String, double, double)
JedisClient.zsetLexLength(String, String, String)zsetRangeByLex 在接口中 JedisClientkey - keymin - min lexmax - max lexpublic Set<String> zsetRangeByLex(String key, String min, String max, int offset, int count)
zsetRangeByLex 在接口中 JedisClientpublic Set<String> zsetReverseRangeByLex(String key, String min, String max)
zsetReverseRangeByLex 在接口中 JedisClientpublic Set<String> zsetReverseRangeByLex(String key, String min, String max, int offset, int count)
zsetReverseRangeByLex 在接口中 JedisClientpublic Long zsetDeleteRangeByLex(String key, String min, String max)
zsetDeleteRangeByLex 在接口中 JedisClientpublic Long geoAdd(String key, double longitude, double latitude, String value)
JedisClientgeoAdd 在接口中 JedisClientkey - key to geolongitude - longitudelatitude - latitudevalue - valuepublic Long geoAdd(String key, Map<String,redis.clients.jedis.GeoCoordinate> memberCoordinateMap)
geoAdd 在接口中 JedisClientpublic Double geoDistant(String key, String source, String target)
geoDistant 在接口中 JedisClientpublic Double geoDistant(String key, String source, String target, redis.clients.jedis.GeoUnit unit)
geoDistant 在接口中 JedisClientpublic List<redis.clients.jedis.GeoCoordinate> geoPos(String key, String... values)
geoPos 在接口中 JedisClientpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadius(String key, double longitude, double latitude, double radius, redis.clients.jedis.GeoUnit unit)
JedisClientgeoRadius 在接口中 JedisClientkey - keylongitude - lonlatitude - latradius - radiusunit - unitpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadiusReadonly(String key, double longitude, double latitude, double radius, redis.clients.jedis.GeoUnit unit)
geoRadiusReadonly 在接口中 JedisClientpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadius(String key, double longitude, double latitude, double radius, redis.clients.jedis.GeoUnit unit, redis.clients.jedis.params.GeoRadiusParam param)
geoRadius 在接口中 JedisClientpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadiusReadonly(String key, double longitude, double latitude, double radius, redis.clients.jedis.GeoUnit unit, redis.clients.jedis.params.GeoRadiusParam param)
geoRadiusReadonly 在接口中 JedisClientpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadiusByMember(String key, String member, double radius, redis.clients.jedis.GeoUnit unit)
geoRadiusByMember 在接口中 JedisClientpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadiusByMemberReadonly(String key, String member, double radius, redis.clients.jedis.GeoUnit unit)
geoRadiusByMemberReadonly 在接口中 JedisClientpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadiusByMember(String key, String member, double radius, redis.clients.jedis.GeoUnit unit, redis.clients.jedis.params.GeoRadiusParam param)
geoRadiusByMember 在接口中 JedisClientpublic List<redis.clients.jedis.GeoRadiusResponse> geoRadiusByMemberReadonly(String key, String member, double radius, redis.clients.jedis.GeoUnit unit, redis.clients.jedis.params.GeoRadiusParam param)
geoRadiusByMemberReadonly 在接口中 JedisClientpublic void subscribe(redis.clients.jedis.JedisPubSub jedisPubSub,
String... channels)
JedisClientsubscribe 在接口中 JedisClientjedisPubSub - callback when channels has publish messagechannels - changespublic Long publish(String channel, String message)
JedisClientpublish 在接口中 JedisClientchannel - target channel.message - messagepublic void patternSubscribe(redis.clients.jedis.JedisPubSub jedisPubSub,
String... patterns)
JedisClientpatternSubscribe 在接口中 JedisClientjedisPubSub - callbackpatterns - channel patternpublic Object eval(String script, List<String> keys, List<String> args)
JedisClient
redis 127.0.0.1:6379> eval "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" 2 key1 key2 first second
1) "key1"
2) "key2"
3) "first"
4) "second"
eval 在接口中 JedisClientscript - script contentkeys - keysargs - argpublic Object eval(String script, int keyCount, String... params)
eval 在接口中 JedisClientpublic Object eval(String script)
eval 在接口中 JedisClientpublic Object evalSha(String sha1)
evalSha 在接口中 JedisClientpublic Object evalSha(String sha1, List<String> keys, List<String> args)
evalSha 在接口中 JedisClientpublic Object evalSha(String sha1, int keyCount, String... params)
evalSha 在接口中 JedisClientpublic Boolean scriptExists(String sha1)
scriptExists 在接口中 JedisClientpublic List<Boolean> scriptExists(String... sha1)
scriptExists 在接口中 JedisClientpublic String scriptLoad(String script)
scriptLoad 在接口中 JedisClientCopyright © 2020. All rights reserved.