接口 RedisCommandsContainer
-
- 所有超级接口:
Serializable
- 所有已知实现类:
RedisClusterContainer,RedisContainer
public interface RedisCommandsContainer extends Serializable
The container for all available Redis commands.
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidclose()Close the container.io.lettuce.core.RedisFuture<Long>decrBy(String key, Long value)decrease value from specified key.io.lettuce.core.RedisFuture<Long>del(String key)delete key.io.lettuce.core.RedisFuture<Long>exists(String key)io.lettuce.core.RedisFuture<Boolean>expire(String key, int seconds)expire key with seconds.io.lettuce.core.RedisFuture<String>get(String key)get value by key.io.lettuce.core.cluster.api.async.RedisClusterAsyncCommandsgetAsyncCommands()get redis async commands.io.lettuce.core.RedisFuture<Long>getTTL(String key)get ttl of key.io.lettuce.core.RedisFuture<Long>hdel(String key, String field)delete key in map.io.lettuce.core.RedisFuture<Boolean>hexists(String key, String field)io.lettuce.core.RedisFuture<String>hget(String key, String field)get value by key and field .io.lettuce.core.RedisFuture<Map<String,String>>hgetAll(String key)get all value by key.io.lettuce.core.RedisFuture<Long>hincrBy(String key, String hashField, long value)io.lettuce.core.RedisFuture<Double>hincrByFloat(String key, String hashField, double value)io.lettuce.core.RedisFuture<Boolean>hmset(String key, Map hashField)Sets fields in the hash stored at key to value, with TTL, if needed.io.lettuce.core.RedisFuture<Boolean>hset(String key, String hashField, String value)Sets field in the hash stored at key to value, with TTL, if needed.io.lettuce.core.RedisFuture<Long>incrBy(String key, long value)increase value to specified key.io.lettuce.core.RedisFuture<Double>incrByFloat(String key, double value)increase value to specified key.io.lettuce.core.RedisFuture<Long>lpush(String listName, String value)Insert the specified value at the head of the list stored at key.io.lettuce.core.RedisFuture<List>lRange(String key, long start, long end)voidopen()Open the container.io.lettuce.core.RedisFuture<Long>pfadd(String key, String element)Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.io.lettuce.core.RedisFuture<Long>pfcount(String key)io.lettuce.core.RedisFuture<Long>publish(String channelName, String message)Posts a message to the given channel.io.lettuce.core.RedisFuture<Long>rpush(String listName, String value)Insert the specified value at the tail of the list stored at key.io.lettuce.core.RedisFuture<Long>sadd(String setName, String value)Add the specified member to the set stored at key.io.lettuce.core.RedisFuture<String>set(String key, String value)Set key to hold the string value.io.lettuce.core.RedisFuture<List>srandmember(String key, long count)io.lettuce.core.RedisFuture<Long>srem(String setName, String value)delete key value from set.io.lettuce.core.RedisFuture<Long>zadd(String key, double score, String element)Adds the specified member with the specified scores to the sorted set stored at key.io.lettuce.core.RedisFuturezincrBy(String key, double score, String element)increase the specified member with the specified scores to the sorted set stored at key.io.lettuce.core.RedisFuture<List>zrange(String key, long start, long stop)io.lettuce.core.RedisFuture<Long>zrem(String key, String element)Removes the specified member from the sorted set stored at key.io.lettuce.core.RedisFuture<Long>zremRangeByLex(String key, io.lettuce.core.Range<String> range)Remove members from a specified lex rangeio.lettuce.core.RedisFuture<Long>zremRangeByRank(String key, long start, long stop)Remove members from a specified rankio.lettuce.core.RedisFuture<Long>zremRangeByScore(String key, io.lettuce.core.Range<Double> range)Remove members from a specified score rangeio.lettuce.core.RedisFuture<Double>zscore(String key, String member)
-
-
-
方法详细资料
-
open
void open() throws Exception
Open the container.- 抛出:
Exception- if the instance can not be opened properly
-
hset
io.lettuce.core.RedisFuture<Boolean> hset(String key, String hashField, String value)
Sets field in the hash stored at key to value, with TTL, if needed. Setting expire time to key is optional. If key does not exist, a new key holding a hash is created. If field already exists in the hash, it is overwritten.- 参数:
key- Hash namehashField- Hash fieldvalue- Hash value
-
hmset
io.lettuce.core.RedisFuture<Boolean> hmset(String key, Map hashField)
Sets fields in the hash stored at key to value, with TTL, if needed. Setting expire time to key is optional. If key does not exist, a new key holding a hash is created. If key already exists, it is overwritten.- 参数:
key-hashField-- 返回:
-
hincrBy
io.lettuce.core.RedisFuture<Long> hincrBy(String key, String hashField, long value)
- 参数:
key-hashField-value-- 返回:
-
hincrByFloat
io.lettuce.core.RedisFuture<Double> hincrByFloat(String key, String hashField, double value)
- 参数:
key-hashField-value-- 返回:
-
rpush
io.lettuce.core.RedisFuture<Long> rpush(String listName, String value)
Insert the specified value at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation.- 参数:
listName- Name of the Listvalue- Value to be added
-
lpush
io.lettuce.core.RedisFuture<Long> lpush(String listName, String value)
Insert the specified value at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operation.- 参数:
listName- Name of the Listvalue- Value to be added
-
sadd
io.lettuce.core.RedisFuture<Long> sadd(String setName, String value)
Add the specified member to the set stored at key. Specified members that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified members.- 参数:
setName- Name of the Setvalue- Value to be added
-
publish
io.lettuce.core.RedisFuture<Long> publish(String channelName, String message)
Posts a message to the given channel.- 参数:
channelName- Name of the channel to which data will be publishedmessage- the message
-
set
io.lettuce.core.RedisFuture<String> set(String key, String value)
Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.- 参数:
key- the key name in which value to be setvalue- the value
-
pfadd
io.lettuce.core.RedisFuture<Long> pfadd(String key, String element)
Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.- 参数:
key- The name of the keyelement- the element
-
zadd
io.lettuce.core.RedisFuture<Long> zadd(String key, double score, String element)
Adds the specified member with the specified scores to the sorted set stored at key.- 参数:
key- The name of the Sorted Setscore- Score of the elementelement- element to be added
-
zincrBy
io.lettuce.core.RedisFuture zincrBy(String key, double score, String element)
increase the specified member with the specified scores to the sorted set stored at key.- 参数:
key-score-element-
-
zrem
io.lettuce.core.RedisFuture<Long> zrem(String key, String element)
Removes the specified member from the sorted set stored at key.- 参数:
key- The name of the Sorted Setelement- element to be removed
-
zremRangeByScore
io.lettuce.core.RedisFuture<Long> zremRangeByScore(String key, io.lettuce.core.Range<Double> range)
Remove members from a specified score range- 参数:
key-range-- 返回:
-
zremRangeByLex
io.lettuce.core.RedisFuture<Long> zremRangeByLex(String key, io.lettuce.core.Range<String> range)
Remove members from a specified lex range- 参数:
key-range-- 返回:
-
zremRangeByRank
io.lettuce.core.RedisFuture<Long> zremRangeByRank(String key, long start, long stop)
Remove members from a specified rank- 参数:
key-start-stop-- 返回:
-
incrBy
io.lettuce.core.RedisFuture<Long> incrBy(String key, long value)
increase value to specified key.- 参数:
key-value-
-
incrByFloat
io.lettuce.core.RedisFuture<Double> incrByFloat(String key, double value)
increase value to specified key.- 参数:
key-value-- 返回:
-
decrBy
io.lettuce.core.RedisFuture<Long> decrBy(String key, Long value)
decrease value from specified key.- 参数:
key- the key name in which value to be setvalue- value the value
-
hget
io.lettuce.core.RedisFuture<String> hget(String key, String field)
get value by key and field .- 参数:
key-field-- 返回:
-
hgetAll
io.lettuce.core.RedisFuture<Map<String,String>> hgetAll(String key)
get all value by key.- 参数:
key-- 返回:
-
close
void close() throws IOExceptionClose the container.- 抛出:
IOException
-
expire
io.lettuce.core.RedisFuture<Boolean> expire(String key, int seconds)
expire key with seconds.- 参数:
key-seconds-- 返回:
-
hdel
io.lettuce.core.RedisFuture<Long> hdel(String key, String field)
delete key in map.- 参数:
key-field-
-
srem
io.lettuce.core.RedisFuture<Long> srem(String setName, String value)
delete key value from set.- 参数:
setName-value-
-
lRange
io.lettuce.core.RedisFuture<List> lRange(String key, long start, long end)
- 参数:
key-start-end-- 返回:
-
hexists
io.lettuce.core.RedisFuture<Boolean> hexists(String key, String field)
- 参数:
key-field-- 返回:
-
zscore
io.lettuce.core.RedisFuture<Double> zscore(String key, String member)
- 参数:
key-member-- 返回:
-
zrange
io.lettuce.core.RedisFuture<List> zrange(String key, long start, long stop)
- 参数:
key-start-stop-- 返回:
-
srandmember
io.lettuce.core.RedisFuture<List> srandmember(String key, long count)
- 参数:
key-count-- 返回:
-
getAsyncCommands
io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands getAsyncCommands()
get redis async commands.- 返回:
-
-