Module lettuce.core
Interface RedisAdvancedClusterReactiveCommands<K,V>
- All Superinterfaces:
BaseRedisReactiveCommands<K,V>,RedisAclReactiveCommands<K,V>,RedisClusterReactiveCommands<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>
- All Known Implementing Classes:
RedisAdvancedClusterReactiveCommandsImpl
public interface RedisAdvancedClusterReactiveCommands<K,V> extends RedisClusterReactiveCommands<K,V>
Advanced reactive and thread-safe Redis Cluster API.
- Since:
- 5.0
- Author:
- Mark Paluch, Jon Chambers
-
Method Summary
Modifier and Type Method Description Mono<String>clientSetname(K name)Set the current connection name on all cluster nodes with pipelining.Mono<Long>dbsize()Return the number of keys in the selected database on all cluster masters.Mono<Long>del(K... keys)Delete one or more keys with pipelining.Mono<Long>exists(K... keys)Determine how many keys exist with pipelining.Mono<String>flushall()Remove all keys from all databases on all cluster masters with pipelining.Mono<String>flushallAsync()Remove all keys asynchronously from all databases on all cluster upstream nodes with pipelining.Mono<String>flushdb()Remove all keys from the current database on all cluster masters with pipelining.RedisClusterReactiveCommands<K,V>getConnection(String nodeId)Retrieve a connection to the specified cluster node using the nodeId.RedisClusterReactiveCommands<K,V>getConnection(String host, int port)Retrieve a connection to the specified cluster node using host and port.StatefulRedisClusterConnection<K,V>getStatefulConnection()Mono<Long>keys(KeyStreamingChannel<K> channel, K pattern)Find all keys matching the given pattern on all cluster masters.Flux<K>keys(K pattern)Find all keys matching the given pattern on all cluster masters.Flux<KeyValue<K,V>>mget(K... keys)Get the values of all the given keys with pipelining.Mono<String>mset(Map<K,V> map)Set multiple keys to multiple values with pipelining.Mono<Boolean>msetnx(Map<K,V> map)Set multiple keys to multiple values, only if none of the keys exist with pipelining.Mono<K>randomkey()Return a random key from the keyspace on a random master.Mono<KeyScanCursor<K>>scan()Incrementally iterate the keys space over the whole Cluster.Mono<StreamScanCursor>scan(KeyStreamingChannel<K> channel)Incrementally iterate the keys space over the whole Cluster.Mono<StreamScanCursor>scan(KeyStreamingChannel<K> channel, ScanArgs scanArgs)Incrementally iterate the keys space over the whole Cluster.Mono<StreamScanCursor>scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor)Incrementally iterate the keys space over the whole Cluster.Mono<StreamScanCursor>scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor, ScanArgs scanArgs)Incrementally iterate the keys space over the whole Cluster.Mono<KeyScanCursor<K>>scan(ScanArgs scanArgs)Incrementally iterate the keys space over the whole Cluster.Mono<KeyScanCursor<K>>scan(ScanCursor scanCursor)Incrementally iterate the keys space over the whole Cluster.Mono<KeyScanCursor<K>>scan(ScanCursor scanCursor, ScanArgs scanArgs)Incrementally iterate the keys space over the whole Cluster.Mono<String>scriptFlush()Remove all the scripts from the script cache on all cluster nodes.Mono<String>scriptKill()Kill the script currently in execution on all cluster nodes.Mono<String>scriptLoad(byte[] script)Load the specified Lua script into the script cache on all cluster nodes.Mono<String>scriptLoad(String script)Load the specified Lua script into the script cache on all cluster nodes.Mono<Void>shutdown(boolean save)Synchronously save the dataset to disk and then shut down all nodes of the cluster.Mono<Long>touch(K... keys)Touch one or more keys with pipelining.Mono<Long>unlink(K... keys)Unlink one or more keys with pipelining.Methods inherited from interface io.lettuce.core.api.reactive.BaseRedisReactiveCommands
dispatch, dispatch, echo, flushCommands, isOpen, ping, publish, pubsubChannels, pubsubChannels, pubsubNumpat, pubsubNumsub, quit, reset, role, setAutoFlushCommands, waitForReplicationMethods inherited from interface io.lettuce.core.api.reactive.RedisAclReactiveCommands
aclCat, aclCat, aclDeluser, aclGenpass, aclGenpass, aclGetuser, aclList, aclLoad, aclLog, aclLog, aclLogReset, aclSave, aclSetuser, aclUsers, aclWhoamiMethods inherited from interface io.lettuce.core.cluster.api.reactive.RedisClusterReactiveCommands
asking, auth, auth, clusterAddSlots, clusterBumpepoch, clusterCountFailureReports, clusterCountKeysInSlot, clusterDelSlots, clusterFailover, clusterFlushslots, clusterForget, clusterGetKeysInSlot, clusterInfo, clusterKeyslot, clusterMeet, clusterMyId, clusterNodes, clusterReplicate, clusterReset, clusterSaveconfig, clusterSetConfigEpoch, clusterSetSlotImporting, clusterSetSlotMigrating, clusterSetSlotNode, clusterSetSlotStable, clusterSlaves, clusterSlots, readOnly, readWrite, setTimeoutMethods inherited from interface io.lettuce.core.api.reactive.RedisGeoReactiveCommands
geoadd, geoadd, geoadd, geoadd, geoadd, geoadd, geodist, geohash, geopos, georadius, georadius, georadius, georadiusbymember, georadiusbymember, georadiusbymember, geosearch, geosearch, geosearchstoreMethods inherited from interface io.lettuce.core.api.reactive.RedisHashReactiveCommands
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, hvalsMethods inherited from interface io.lettuce.core.api.reactive.RedisHLLReactiveCommands
pfadd, pfcount, pfmergeMethods inherited from interface io.lettuce.core.api.reactive.RedisKeyReactiveCommands
copy, copy, dump, expire, expire, expireat, expireat, expireat, migrate, migrate, move, objectEncoding, objectFreq, objectIdletime, objectRefcount, persist, pexpire, pexpire, pexpireat, pexpireat, pexpireat, pttl, rename, renamenx, restore, restore, sort, sort, sort, sort, sortStore, ttl, typeMethods inherited from interface io.lettuce.core.api.reactive.RedisListReactiveCommands
blmove, blmove, blpop, blpop, brpop, brpop, brpoplpush, brpoplpush, lindex, linsert, llen, lmove, lpop, lpop, lpos, lpos, lpos, lpos, lpush, lpushx, lrange, lrange, lrem, lset, ltrim, rpop, rpop, rpoplpush, rpush, rpushxMethods inherited from interface io.lettuce.core.api.reactive.RedisScriptingReactiveCommands
digest, digest, eval, eval, eval, eval, evalsha, evalsha, scriptExists, scriptFlushMethods inherited from interface io.lettuce.core.api.reactive.RedisServerReactiveCommands
bgrewriteaof, bgsave, clientCaching, clientGetname, clientGetredir, clientId, clientKill, clientKill, clientList, clientPause, clientTracking, clientUnblock, command, commandCount, commandInfo, commandInfo, configGet, configResetstat, configRewrite, configSet, debugCrashAndRecover, debugHtstats, debugObject, debugOom, debugReload, debugRestart, debugSdslen, debugSegfault, flushall, flushdb, flushdbAsync, info, info, lastsave, memoryUsage, save, slaveof, slaveofNoOne, slowlogGet, slowlogGet, slowlogLen, slowlogReset, timeMethods inherited from interface io.lettuce.core.api.reactive.RedisSetReactiveCommands
sadd, scard, sdiff, sdiff, sdiffstore, sinter, sinter, sinterstore, sismember, smembers, smembers, smismember, smove, spop, spop, srandmember, srandmember, srandmember, srem, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sunion, sunion, sunionstoreMethods inherited from interface io.lettuce.core.api.reactive.RedisSortedSetReactiveCommands
bzpopmax, bzpopmax, bzpopmin, bzpopmin, 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, zunionWithScoresMethods inherited from interface io.lettuce.core.api.reactive.RedisStreamReactiveCommands
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, xtrimMethods inherited from interface io.lettuce.core.api.reactive.RedisStringReactiveCommands
append, bitcount, bitcount, bitfield, bitopAnd, bitopNot, bitopOr, bitopXor, bitpos, bitpos, bitpos, decr, decrby, get, getbit, getdel, getex, getrange, getset, incr, incrby, incrbyfloat, mget, psetex, set, set, setbit, setex, setGet, setGet, setnx, setrange, stralgoLcs, strlen
-
Method Details
-
getConnection
Retrieve a connection to the specified cluster node using the nodeId. Host and port are looked up in the node list. In contrast to theRedisAdvancedClusterReactiveCommands, node-connections do not route commands to other cluster nodes- Parameters:
nodeId- the node Id- Returns:
- a connection to the requested cluster node
-
getConnection
Retrieve a connection to the specified cluster node using host and port. In contrast to theRedisAdvancedClusterReactiveCommands, node-connections do not route commands to other cluster nodes. Host and port connections are verified by default for cluster membership, seeClusterClientOptions.isValidateClusterNodeMembership().- Parameters:
host- the hostport- the port- Returns:
- a connection to the requested cluster node
-
getStatefulConnection
StatefulRedisClusterConnection<K,V> getStatefulConnection()- Returns:
- the underlying connection.
-
del
Delete one or more keys with pipelining. Cross-slot keys will result in multiple calls to the particular cluster nodes.- Specified by:
delin interfaceRedisClusterReactiveCommands<K,V>- Specified by:
delin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
keys- the keys- Returns:
- Long integer-reply The number of keys that were removed.
- See Also:
RedisKeyReactiveCommands.del(Object[])
-
unlink
Unlink one or more keys with pipelining. Cross-slot keys will result in multiple calls to the particular cluster nodes.- Specified by:
unlinkin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
keys- the keys- Returns:
- Long integer-reply The number of keys that were removed.
- See Also:
RedisKeyReactiveCommands.unlink(Object[])
-
exists
Determine how many keys exist with pipelining. Cross-slot keys will result in multiple calls to the particular cluster nodes.- Specified by:
existsin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
keys- the keys- Returns:
- Long integer-reply specifically: Number of existing keys
-
mget
Get the values of all the given keys with pipelining. Cross-slot keys will result in multiple calls to the particular cluster nodes.- Specified by:
mgetin interfaceRedisClusterReactiveCommands<K,V>- Specified by:
mgetin interfaceRedisStringReactiveCommands<K,V>- Parameters:
keys- the key- Returns:
- V array-reply list of values at the specified keys.
- See Also:
RedisStringReactiveCommands.mget(Object[])
-
mset
Set multiple keys to multiple values with pipelining. Cross-slot keys will result in multiple calls to the particular cluster nodes.- Specified by:
msetin interfaceRedisClusterReactiveCommands<K,V>- Specified by:
msetin interfaceRedisStringReactiveCommands<K,V>- Parameters:
map- the map- Returns:
- String simple-string-reply always
OKsinceMSETcan't fail. - See Also:
RedisStringReactiveCommands.mset(Map)
-
msetnx
Set multiple keys to multiple values, only if none of the keys exist with pipelining. Cross-slot keys will result in multiple calls to the particular cluster nodes.- Specified by:
msetnxin interfaceRedisClusterReactiveCommands<K,V>- Specified by:
msetnxin interfaceRedisStringReactiveCommands<K,V>- Parameters:
map- the null- Returns:
- Boolean integer-reply specifically:
1if the all the keys were set.0if no key was set (at least one key already existed). - See Also:
RedisStringReactiveCommands.msetnx(Map)
-
clientSetname
Set the current connection name on all cluster nodes with pipelining.- Specified by:
clientSetnamein interfaceRedisServerReactiveCommands<K,V>- Parameters:
name- the client name- Returns:
- simple-string-reply
OKif the connection name was successfully set. - See Also:
RedisServerReactiveCommands.clientSetname(Object)
-
flushall
Remove all keys from all databases on all cluster masters with pipelining.- Specified by:
flushallin interfaceRedisServerReactiveCommands<K,V>- Returns:
- String simple-string-reply
- See Also:
RedisServerReactiveCommands.flushall()
-
flushallAsync
Remove all keys asynchronously from all databases on all cluster upstream nodes with pipelining.- Specified by:
flushallAsyncin interfaceRedisServerReactiveCommands<K,V>- Returns:
- String simple-string-reply
- Since:
- 6.0
- See Also:
RedisServerReactiveCommands.flushallAsync()
-
flushdb
Remove all keys from the current database on all cluster masters with pipelining.- Specified by:
flushdbin interfaceRedisServerReactiveCommands<K,V>- Returns:
- String simple-string-reply
- See Also:
RedisServerReactiveCommands.flushdb()
-
dbsize
Return the number of keys in the selected database on all cluster masters.- Specified by:
dbsizein interfaceRedisServerReactiveCommands<K,V>- Returns:
- Long integer-reply
- See Also:
RedisServerReactiveCommands.dbsize()
-
keys
Find all keys matching the given pattern on all cluster masters.- Specified by:
keysin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
pattern- the pattern type: patternkey (pattern)- Returns:
- List<K> array-reply list of keys matching
pattern. - See Also:
RedisKeyReactiveCommands.keys(Object)
-
keys
Find all keys matching the given pattern on all cluster masters.- Specified by:
keysin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
channel- the channelpattern- the pattern- Returns:
- Long array-reply list of keys matching
pattern. - See Also:
RedisKeyReactiveCommands.keys(KeyStreamingChannel, Object)
-
randomkey
Return a random key from the keyspace on a random master.- Specified by:
randomkeyin interfaceRedisKeyReactiveCommands<K,V>- Returns:
- K bulk-string-reply the random key, or a
Monothat completes empty when the database is empty. - See Also:
RedisKeyReactiveCommands.randomkey()
-
scriptFlush
Remove all the scripts from the script cache on all cluster nodes.- Specified by:
scriptFlushin interfaceRedisScriptingReactiveCommands<K,V>- Returns:
- String simple-string-reply
- See Also:
RedisScriptingReactiveCommands.scriptFlush()
-
scriptKill
Kill the script currently in execution on all cluster nodes. This call does not fail even if no scripts are running.- Specified by:
scriptKillin interfaceRedisScriptingReactiveCommands<K,V>- Returns:
- String simple-string-reply, always OK.
- See Also:
RedisScriptingReactiveCommands.scriptKill()
-
scriptLoad
Load the specified Lua script into the script cache on all cluster nodes.- Specified by:
scriptLoadin interfaceRedisScriptingReactiveCommands<K,V>- Parameters:
script- script content- Returns:
- String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
- Since:
- 6.0
-
scriptLoad
Load the specified Lua script into the script cache on all cluster nodes.- Specified by:
scriptLoadin interfaceRedisScriptingReactiveCommands<K,V>- Parameters:
script- script content- Returns:
- String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
- Since:
- 6.0
-
shutdown
Synchronously save the dataset to disk and then shut down all nodes of the cluster.- Specified by:
shutdownin interfaceRedisServerReactiveCommands<K,V>- Parameters:
save-trueforce save operation- See Also:
RedisServerReactiveCommands.shutdown(boolean)
-
scan
Mono<KeyScanCursor<K>> scan()Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Returns:
- KeyScanCursor<K> scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(ScanArgs)
-
scan
Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
scanArgs- scan arguments- Returns:
- KeyScanCursor<K> scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(ScanArgs)
-
scan
Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
scanCursor- cursor to resume the scan. It's required to reuse thescanCursorinstance from the previousscan()call.scanArgs- scan arguments- Returns:
- KeyScanCursor<K> scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(ScanCursor, ScanArgs)
-
scan
Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
scanCursor- cursor to resume the scan. It's required to reuse thescanCursorinstance from the previousscan()call.- Returns:
- KeyScanCursor<K> scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(ScanCursor)
-
scan
Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
channel- streaming channel that receives a call for every key- Returns:
- StreamScanCursor scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(KeyStreamingChannel)
-
scan
Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
channel- streaming channel that receives a call for every keyscanArgs- scan arguments- Returns:
- StreamScanCursor scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(KeyStreamingChannel, ScanArgs)
-
scan
Mono<StreamScanCursor> scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor, ScanArgs scanArgs)Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
channel- streaming channel that receives a call for every keyscanCursor- cursor to resume the scan. It's required to reuse thescanCursorinstance from the previousscan()call.scanArgs- scan arguments- Returns:
- StreamScanCursor scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(KeyStreamingChannel, ScanCursor, ScanArgs)
-
scan
Incrementally iterate the keys space over the whole Cluster.- Specified by:
scanin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
channel- streaming channel that receives a call for every keyscanCursor- cursor to resume the scan. It's required to reuse thescanCursorinstance from the previousscan()call.- Returns:
- StreamScanCursor scan cursor.
- See Also:
RedisKeyReactiveCommands.scan(ScanCursor, ScanArgs)
-
touch
Touch one or more keys with pipelining. Touch sets the last accessed time for a key. Non-exsitent keys wont get created. Cross-slot keys will result in multiple calls to the particular cluster nodes.- Specified by:
touchin interfaceRedisKeyReactiveCommands<K,V>- Parameters:
keys- the keys- Returns:
- Long integer-reply the number of found keys.
-