java.lang.Object
io.lettuce.core.AbstractRedisReactiveCommands<K,V>
io.lettuce.core.sentinel.RedisSentinelReactiveCommandsImpl<K,V>
- Type Parameters:
K- Key type.V- Value type.
- All Implemented Interfaces:
BaseRedisReactiveCommands<K,V>,RedisAclReactiveCommands<K,V>,RedisGeoReactiveCommands<K,V>,RedisHashReactiveCommands<K,V>,RedisHLLReactiveCommands<K,V>,RedisKeyReactiveCommands<K,V>,RedisListReactiveCommands<K,V>,RedisScriptingReactiveCommands<K,V>,RedisServerReactiveCommands<K,V>,RedisSetReactiveCommands<K,V>,RedisSortedSetReactiveCommands<K,V>,RedisStreamReactiveCommands<K,V>,RedisStringReactiveCommands<K,V>,RedisTransactionalReactiveCommands<K,V>,RedisClusterReactiveCommands<K,V>,RedisSentinelReactiveCommands<K,V>
public class RedisSentinelReactiveCommandsImpl<K,V> extends AbstractRedisReactiveCommands<K,V> implements RedisSentinelReactiveCommands<K,V>
A reactive and thread-safe API for a Redis Sentinel connection.
- Since:
- 3.0
- Author:
- Mark Paluch
-
Constructor Summary
Constructors Constructor Description RedisSentinelReactiveCommandsImpl(StatefulConnection<K,V> connection, RedisCodec<K,V> codec) -
Method Summary
Modifier and Type Method Description Mono<K>clientGetname()Get the current connection name.Mono<Long>clientKill(KillArgs killArgs)Kill connections of clients which are filtered bykillArgs.Mono<String>clientKill(String addr)Kill the connection of a client identified by ip:port.Mono<String>clientList()Get the list of client connections.Mono<String>clientPause(long timeout)Stop processing commands from clients for some time.Mono<String>clientSetname(K name)Set the current connection name.voidclose()<T> Flux<T>dispatch(ProtocolKeyword type, CommandOutput<K,V,?> output)Dispatch a command to the Redis Server.<T> Flux<T>dispatch(ProtocolKeyword type, CommandOutput<K,V,?> output, CommandArgs<K,V> args)Dispatch a command to the Redis Server.Mono<String>failover(K key)Perform a failover.Mono<SocketAddress>getMasterAddrByName(K key)Return the ip and port number of the master with that name.StatefulRedisSentinelConnection<K,V>getStatefulConnection()Mono<String>info()Get information and statistics about the server.Mono<String>info(String section)Get information and statistics about the server.booleanisOpen()Mono<Map<K,V>>master(K key)Show the state and info of the specified master.Flux<Map<K,V>>masters()Enumerates all the monitored masters and their states.Mono<String>monitor(K key, String ip, int port, int quorum)This command tells the Sentinel to start monitoring a new master with the specified name, ip, port, and quorum.Mono<String>ping()Ping the server.Mono<String>remove(K key)remove the specified master.Mono<Long>reset(K key)This command will reset all the masters with matching name.Mono<String>set(K key, String option, V value)Multiple option / value pairs can be specified (or none at all).Flux<Map<K,V>>slaves(K key)Provides a list of replicas for the master with the specified name.Methods inherited from class io.lettuce.core.AbstractRedisReactiveCommands
aclCat, aclCat, aclDeluser, aclGenpass, aclGenpass, aclGetuser, aclList, aclLoad, aclLog, aclLog, aclLogReset, aclSave, aclSetuser, aclUsers, aclWhoami, append, asking, auth, auth, bgrewriteaof, bgsave, bitcount, bitcount, bitfield, bitopAnd, bitopNot, bitopOr, bitopXor, bitpos, bitpos, bitpos, blmove, blpop, brpop, brpoplpush, bzpopmax, bzpopmin, clientCaching, clientGetredir, clientId, clientTracking, clientUnblock, clusterAddSlots, clusterBumpepoch, clusterCountFailureReports, clusterCountKeysInSlot, clusterDelSlots, clusterFailover, clusterFlushslots, clusterForget, clusterGetKeysInSlot, clusterInfo, clusterKeyslot, clusterMeet, clusterMyId, clusterNodes, clusterReplicate, clusterReset, clusterSaveconfig, clusterSetConfigEpoch, clusterSetSlotImporting, clusterSetSlotMigrating, clusterSetSlotNode, clusterSetSlotStable, clusterSlaves, clusterSlots, command, commandCount, commandInfo, commandInfo, configGet, configResetstat, configRewrite, configSet, copy, copy, createDissolvingFlux, createFlux, createMono, createMono, dbsize, debugCrashAndRecover, debugHtstats, debugObject, debugOom, debugReload, debugRestart, debugSdslen, debugSegfault, decr, decrby, del, del, digest, digest, discard, dump, echo, eval, eval, eval, eval, evalsha, evalsha, exec, exists, exists, exists, expire, expire, expireat, expireat, expireat, flushall, flushall, flushallAsync, flushCommands, flushdb, flushdb, flushdbAsync, geoadd, geoadd, geoadd, geoadd, geoadd, geoadd, geodist, geohash, geopos, georadius, georadius, georadius, georadius_ro, georadius_ro, georadiusbymember, georadiusbymember, georadiusbymember, georadiusbymember_ro, georadiusbymember_ro, geosearch, geosearch, geosearchstore, get, getbit, getConnection, getdel, getex, getrange, getset, hdel, hexists, hget, hgetall, hgetall, hincrby, hincrbyfloat, hkeys, hkeys, hlen, hmget, hmget, hmset, hrandfield, hrandfield, hrandfieldWithvalues, hrandfieldWithvalues, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hset, hset, hsetnx, hstrlen, hvals, hvals, incr, incrby, incrbyfloat, keys, keys, lastsave, lindex, linsert, llen, lmove, lpop, lpop, lpos, lpos, lpos, lpos, lpush, lpushx, lrange, lrange, lrem, lset, ltrim, memoryUsage, mget, mget, mget, mget, mget, migrate, migrate, move, mset, msetnx, multi, objectEncoding, objectFreq, objectIdletime, objectRefcount, persist, pexpire, pexpire, pexpireat, pexpireat, pexpireat, pfadd, pfadd, pfcount, pfcount, pfmerge, pfmerge, psetex, pttl, publish, pubsubChannels, pubsubChannels, pubsubNumpat, pubsubNumsub, quit, randomkey, readOnly, readWrite, rename, renamenx, reset, restore, restore, role, rpop, rpop, rpoplpush, rpush, rpushx, sadd, save, scan, scan, scan, scan, scan, scan, scan, scan, scard, scriptExists, scriptFlush, scriptFlush, scriptKill, scriptLoad, scriptLoad, sdiff, sdiff, sdiffstore, select, set, set, setAutoFlushCommands, setbit, setex, setGet, setGet, setnx, setrange, setTimeout, shutdown, sinter, sinter, sinterstore, sismember, slaveof, slaveofNoOne, slowlogGet, slowlogGet, slowlogLen, slowlogReset, smembers, smembers, smismember, smove, sort, sort, sort, sort, sortStore, spop, spop, srandmember, srandmember, srandmember, srem, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sscan, stralgoLcs, strlen, sunion, sunion, sunionstore, swapdb, time, touch, touch, ttl, type, unlink, unlink, unwatch, waitForReplication, watch, xack, xadd, xadd, xadd, xadd, xautoclaim, xclaim, xclaim, xdel, xgroupCreate, xgroupCreate, xgroupCreateconsumer, xgroupDelconsumer, xgroupDestroy, xgroupSetid, xinfoConsumers, xinfoGroups, xinfoStream, xlen, xpending, xpending, xpending, xpending, xrange, xrange, xread, xread, xreadgroup, xreadgroup, xrevrange, xrevrange, xtrim, xtrim, xtrim, zadd, zadd, zadd, zadd, zadd, zadd, zaddincr, zaddincr, zcard, zcount, zcount, zcount, zdiff, zdiffstore, zdiffWithScores, zincrby, zinter, zinter, zinterstore, zinterstore, zinterWithScores, zinterWithScores, zlexcount, zlexcount, zmscore, zpopmax, zpopmax, zpopmin, zpopmin, zrandmember, zrandmember, zrandmemberWithScores, zrandmemberWithScores, zrange, zrange, zrangebylex, zrangebylex, zrangebylex, zrangebylex, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangestorebylex, zrangestorebyscore, zrangeWithScores, zrangeWithScores, zrank, zrem, zremrangebylex, zremrangebylex, zremrangebyrank, zremrangebyscore, zremrangebyscore, zremrangebyscore, zrevrange, zrevrange, zrevrangebylex, zrevrangebylex, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangestorebylex, zrevrangestorebyscore, zrevrangeWithScores, zrevrangeWithScores, zrevrank, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscore, zunion, zunion, zunionstore, zunionstore, zunionWithScores, zunionWithScores
-
Constructor Details
-
RedisSentinelReactiveCommandsImpl
public RedisSentinelReactiveCommandsImpl(StatefulConnection<K,V> connection, RedisCodec<K,V> codec)
-
-
Method Details
-
getMasterAddrByName
Description copied from interface:RedisSentinelReactiveCommandsReturn the ip and port number of the master with that name.- Specified by:
getMasterAddrByNamein interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the key.- Returns:
- SocketAddress.
-
masters
Description copied from interface:RedisSentinelReactiveCommandsEnumerates all the monitored masters and their states.- Specified by:
mastersin interfaceRedisSentinelReactiveCommands<K,V>- Returns:
- Map<K, V>>.
-
master
Description copied from interface:RedisSentinelReactiveCommandsShow the state and info of the specified master.- Specified by:
masterin interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the key.- Returns:
- Map<K, V>.
-
slaves
Description copied from interface:RedisSentinelReactiveCommandsProvides a list of replicas for the master with the specified name.- Specified by:
slavesin interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the key.- Returns:
- Map<K, V>.
-
reset
Description copied from interface:RedisSentinelReactiveCommandsThis command will reset all the masters with matching name.- Specified by:
resetin interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the key.- Returns:
- Long.
-
failover
Description copied from interface:RedisSentinelReactiveCommandsPerform a failover.- Specified by:
failoverin interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the master id.- Returns:
- String.
-
monitor
Description copied from interface:RedisSentinelReactiveCommandsThis command tells the Sentinel to start monitoring a new master with the specified name, ip, port, and quorum.- Specified by:
monitorin interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the key.ip- the IP address.port- the port.quorum- the quorum count.- Returns:
- String.
-
set
Description copied from interface:RedisSentinelReactiveCommandsMultiple option / value pairs can be specified (or none at all).- Specified by:
setin interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the key.option- the option.value- the value.- Returns:
- String simple-string-reply
OKifSETwas executed correctly.
-
remove
Description copied from interface:RedisSentinelReactiveCommandsremove the specified master.- Specified by:
removein interfaceRedisSentinelReactiveCommands<K,V>- Parameters:
key- the key.- Returns:
- String.
-
ping
Description copied from interface:BaseRedisReactiveCommandsPing the server.- Specified by:
pingin interfaceBaseRedisReactiveCommands<K,V>- Specified by:
pingin interfaceRedisSentinelReactiveCommands<K,V>- Overrides:
pingin classAbstractRedisReactiveCommands<K,V>- Returns:
- String simple-string-reply.
-
clientGetname
Description copied from interface:RedisServerReactiveCommandsGet the current connection name.- Specified by:
clientGetnamein interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
clientGetnamein interfaceRedisServerReactiveCommands<K,V>- Overrides:
clientGetnamein classAbstractRedisReactiveCommands<K,V>- Returns:
- K bulk-string-reply The connection name, or a null bulk reply if no name is set.
-
clientSetname
Description copied from interface:RedisServerReactiveCommandsSet the current connection name.- Specified by:
clientSetnamein interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
clientSetnamein interfaceRedisServerReactiveCommands<K,V>- Overrides:
clientSetnamein classAbstractRedisReactiveCommands<K,V>- Parameters:
name- the client name.- Returns:
- simple-string-reply
OKif the connection name was successfully set.
-
clientKill
Description copied from interface:RedisServerReactiveCommandsKill the connection of a client identified by ip:port.- Specified by:
clientKillin interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
clientKillin interfaceRedisServerReactiveCommands<K,V>- Overrides:
clientKillin classAbstractRedisReactiveCommands<K,V>- Parameters:
addr- ip:port.- Returns:
- String simple-string-reply
OKif the connection exists and has been closed.
-
clientKill
Description copied from interface:RedisServerReactiveCommandsKill connections of clients which are filtered bykillArgs.- Specified by:
clientKillin interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
clientKillin interfaceRedisServerReactiveCommands<K,V>- Overrides:
clientKillin classAbstractRedisReactiveCommands<K,V>- Parameters:
killArgs- args for the kill operation.- Returns:
- Long integer-reply number of killed connections.
-
clientPause
Description copied from interface:RedisServerReactiveCommandsStop processing commands from clients for some time.- Specified by:
clientPausein interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
clientPausein interfaceRedisServerReactiveCommands<K,V>- Overrides:
clientPausein classAbstractRedisReactiveCommands<K,V>- Parameters:
timeout- the timeout value in milliseconds.- Returns:
- String simple-string-reply The command returns OK or an error if the timeout is invalid.
-
clientList
Description copied from interface:RedisServerReactiveCommandsGet the list of client connections.- Specified by:
clientListin interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
clientListin interfaceRedisServerReactiveCommands<K,V>- Overrides:
clientListin classAbstractRedisReactiveCommands<K,V>- Returns:
- String bulk-string-reply a unique string, formatted as follows: One client connection per line (separated by LF), each line is composed of a succession of property=value fields separated by a space character.
-
info
Description copied from interface:RedisServerReactiveCommandsGet information and statistics about the server.- Specified by:
infoin interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
infoin interfaceRedisServerReactiveCommands<K,V>- Overrides:
infoin classAbstractRedisReactiveCommands<K,V>- Returns:
- String bulk-string-reply as a collection of text lines.
-
info
Description copied from interface:RedisServerReactiveCommandsGet information and statistics about the server.- Specified by:
infoin interfaceRedisSentinelReactiveCommands<K,V>- Specified by:
infoin interfaceRedisServerReactiveCommands<K,V>- Overrides:
infoin classAbstractRedisReactiveCommands<K,V>- Parameters:
section- the section type: string.- Returns:
- String bulk-string-reply as a collection of text lines.
-
dispatch
Description copied from interface:BaseRedisReactiveCommandsDispatch a command to the Redis Server. Please note the command output type must fit to the command response.- Specified by:
dispatchin interfaceBaseRedisReactiveCommands<K,V>- Specified by:
dispatchin interfaceRedisSentinelReactiveCommands<K,V>- Overrides:
dispatchin classAbstractRedisReactiveCommands<K,V>- Type Parameters:
T- response type.- Parameters:
type- the command, must not benull.output- the command output, must not benull.- Returns:
- the command response.
-
dispatch
public <T> Flux<T> dispatch(ProtocolKeyword type, CommandOutput<K,V,?> output, CommandArgs<K,V> args)Description copied from interface:BaseRedisReactiveCommandsDispatch a command to the Redis Server. Please note the command output type must fit to the command response.- Specified by:
dispatchin interfaceBaseRedisReactiveCommands<K,V>- Specified by:
dispatchin interfaceRedisSentinelReactiveCommands<K,V>- Overrides:
dispatchin classAbstractRedisReactiveCommands<K,V>- Type Parameters:
T- response type.- Parameters:
type- the command, must not benull.output- the command output, must not benull.args- the command arguments, must not benull.- Returns:
- the command response.
-
close
public void close()- Overrides:
closein classAbstractRedisReactiveCommands<K,V>
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceBaseRedisReactiveCommands<K,V>- Specified by:
isOpenin interfaceRedisSentinelReactiveCommands<K,V>- Overrides:
isOpenin classAbstractRedisReactiveCommands<K,V>- Returns:
trueif the connection is open (connected and not closed).
-
getStatefulConnection
- Specified by:
getStatefulConnectionin interfaceRedisSentinelReactiveCommands<K,V>- Returns:
- the underlying connection.
-