Class LettuceClusterConnection
java.lang.Object
org.springframework.data.redis.connection.AbstractRedisConnection
org.springframework.data.redis.connection.lettuce.LettuceConnection
org.springframework.data.redis.connection.lettuce.LettuceClusterConnection
- All Implemented Interfaces:
AutoCloseable
,DefaultedRedisClusterConnection
,DefaultedRedisConnection
,RedisClusterCommands
,RedisClusterCommandsProvider
,RedisClusterConnection
,RedisClusterServerCommands
,RedisCommands
,RedisCommandsProvider
,RedisConnection
,RedisConnectionCommands
,RedisGeoCommands
,RedisHashCommands
,RedisHyperLogLogCommands
,RedisKeyCommands
,RedisListCommands
,RedisPubSubCommands
,RedisScriptingCommands
,RedisServerCommands
,RedisSetCommands
,RedisStreamCommands
,RedisStringCommands
,RedisTxCommands
,RedisZSetCommands
public class LettuceClusterConnection
extends LettuceConnection
implements RedisClusterConnection, DefaultedRedisClusterConnection
RedisClusterConnection
implementation on top of Lettuce
Redis client.
While the underlying Lettuce RedisClient and StatefulRedisConnection instances used by
LettuceClusterConnection
are Thread-safe, this class itself is not Thread-safe. Therefore, instances of
LettuceClusterConnection
should not be shared across multiple Threads when executing Redis commands and other
operations. If optimal performance is required by your application(s), then we recommend direct access to the
low-level, API provided by the underlying Lettuce client library (driver), where such Thread-safety guarantees can be
made. Simply call LettuceConnection.getNativeConnection()
and use the native resource as required.
- Since:
- 1.7
- Author:
- Christoph Strobl, Mark Paluch, John Blum
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
Lettuce specific implementation ofClusterCommandExecutor.ClusterCommandCallback
.protected static interface
Lettuce specific implementation ofClusterCommandExecutor.MultiKeyClusterCommandCallback
.Nested classes/interfaces inherited from class org.springframework.data.redis.connection.lettuce.LettuceConnection
LettuceConnection.PipeliningFlushPolicy, LettuceConnection.PipeliningFlushState
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisClusterCommands
RedisClusterCommands.AddSlots
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgs
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisListCommands
RedisListCommands.Direction, RedisListCommands.Position
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisServerCommands
RedisServerCommands.FlushOption, RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOption
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptions
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStringCommands
RedisStringCommands.BitOperation, RedisStringCommands.SetOption
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.ZAddArgs
-
Constructor Summary
ModifierConstructorDescriptionprotected
LettuceClusterConnection
(io.lettuce.core.cluster.api.StatefulRedisClusterConnection<byte[], byte[]> sharedConnection, LettuceConnectionProvider connectionProvider, ClusterTopologyProvider clusterTopologyProvider, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnection
given a sharedStatefulRedisClusterConnection
andLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
.LettuceClusterConnection
(io.lettuce.core.cluster.RedisClusterClient clusterClient) Creates newLettuceClusterConnection
usingRedisClusterClient
with defaulttimeout
and a freshClusterCommandExecutor
that gets destroyed on close.LettuceClusterConnection
(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor) Creates newLettuceClusterConnection
with defaulttimeout
usingRedisClusterClient
running commands across the cluster via givenClusterCommandExecutor
.LettuceClusterConnection
(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnection
with given commandtimeout
usingRedisClusterClient
running commands across the cluster via givenClusterCommandExecutor
.LettuceClusterConnection
(LettuceConnectionProvider connectionProvider) Creates newLettuceClusterConnection
usingLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
.LettuceClusterConnection
(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor) Creates newLettuceClusterConnection
usingLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
.LettuceClusterConnection
(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnection
usingLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes (or quits) the connection.void
clusterAddSlots
(RedisClusterNode node, int... slots) Assign slots to givenRedisClusterNode
.void
clusterAddSlots
(RedisClusterNode node, RedisClusterNode.SlotRange range) AssignRedisClusterNode.SlotRange.getSlotsArray()
to givenRedisClusterNode
.GetRedisGeoCommands
.clusterCountKeysInSlot
(int slot) Count the number of keys assigned to one slot.void
clusterDeleteSlots
(RedisClusterNode node, int... slots) Remove slots fromRedisClusterNode
.void
RemovesRedisClusterNode.SlotRange.getSlotsArray()
from givenRedisClusterNode
.void
Remove given node from cluster.Get cluster information.List<byte[]>
clusterGetKeysInSlot
(int slot, Integer count) Get keys served by slot.Retrieve information about masters and their connected replicas.clusterGetNodeForKey
(byte[] key) Find theRedisClusterNode
serving given key.clusterGetNodeForSlot
(int slot) Find theRedisClusterNode
serving given slot.Retrieve cluster node information such as id, host, port and slots.clusterGetReplicas
(RedisClusterNode master) Retrieve information about connected replicas for given master node.clusterGetSlotForKey
(byte[] key) Find the slot for a givenkey
.void
clusterMeet
(RedisClusterNode node) Add given node to cluster.void
clusterReplicate
(RedisClusterNode master, RedisClusterNode replica) Assign a replica to given master.void
clusterSetSlot
(RedisClusterNode node, int slot, RedisClusterCommands.AddSlots mode) GetRedisGeoCommands
.GetRedisHashCommands
.GetRedisKeyCommands
.Set<byte[]>
keys
(RedisClusterNode node, byte[] pattern) GetRedisListCommands
.void
multi()
Mark the start of a transaction block.ping()
Test connection.ping
(RedisClusterNode node) byte[]
randomKey
(RedisClusterNode node) Cursor<byte[]>
scan
(RedisClusterNode node, ScanOptions options) Use aCursor
to iterate over keys.void
select
(int dbIndex) Select the DB with given positivedbIndex
.GetRedisServerCommands
.GetRedisSetCommands
.GetRedisStringCommands
.void
unwatch()
Flushes all the previouslyRedisTxCommands.watch(byte[]...)
keys.void
watch
(byte[]... keys) Watch givenkeys
for modifications during transaction started withRedisTxCommands.multi()
.GetRedisZSetCommands
.Methods inherited from class org.springframework.data.redis.connection.lettuce.LettuceConnection
closePipeline, commands, convertLettuceAccessException, discard, doCreateSubscription, doGetAsyncDedicatedConnection, echo, exec, execute, execute, getAsyncDedicatedConnection, getConnection, getNativeConnection, getSentinelConnection, getSubscription, isActive, isClosed, isPipelined, isQueueing, isSubscribed, openPipeline, pSubscribe, publish, scriptingCommands, setConvertPipelineAndTxResults, setPipeliningFlushPolicy, streamCommands, subscribe, switchToPubSub
Methods inherited from class org.springframework.data.redis.connection.AbstractRedisConnection
getSentinelConnection, hasRedisSentinelConfigured, setSentinelConfiguration
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
bgReWriteAof, bgSave, dbSize, flushAll, flushAll, flushDb, flushDb, getClientList, getConfig, info, info, lastSave, resetConfigStats, rewriteConfig, save, setConfig, shutdown, time, time
Methods inherited from interface org.springframework.data.redis.connection.DefaultedRedisConnection
append, bgReWriteAof, bgSave, bitCount, bitCount, bitField, bitOp, bitPos, bLMove, bLPop, bRPop, bRPopLPush, bZPopMax, bZPopMin, copy, dbSize, decr, decrBy, del, dump, encodingOf, eval, evalSha, evalSha, exists, exists, expire, expireAt, flushAll, flushAll, flushDb, flushDb, geoAdd, geoAdd, geoAdd, geoDist, geoDist, geoHash, geoPos, geoRadius, geoRadius, geoRadiusByMember, geoRadiusByMember, geoRemove, geoSearch, geoSearchStore, get, getBit, getClientList, getClientName, getConfig, getDel, getEx, getRange, getSet, hDel, hExists, hGet, hGetAll, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hRandField, hRandField, hRandFieldWithValues, hRandFieldWithValues, hScan, hSet, hSetNX, hStrLen, hVals, idletime, incr, incrBy, incrBy, info, info, keys, killClient, lastSave, lIndex, lInsert, lLen, lMove, lPop, lPop, lPos, lPush, lPushX, lRange, lRem, lSet, lTrim, mGet, migrate, migrate, move, mSet, mSetNX, persist, pExpire, pExpireAt, pfAdd, pfCount, pfMerge, pSetEx, pTtl, pTtl, randomKey, refcount, rename, renameNX, replicaOf, replicaOfNoOne, resetConfigStats, restore, rewriteConfig, rPop, rPop, rPopLPush, rPush, rPushX, sAdd, save, scan, sCard, scriptExists, scriptFlush, scriptKill, scriptLoad, sDiff, sDiffStore, set, set, setBit, setClientName, setConfig, setEx, setNX, setRange, shutdown, shutdown, sInter, sInterStore, sIsMember, sMembers, sMIsMember, sMove, sort, sort, sPop, sPop, sRandMember, sRandMember, sRem, sScan, strLen, sUnion, sUnionStore, time, time, touch, ttl, ttl, type, unlink, xAck, xAdd, xClaim, xClaimJustId, xDel, xGroupCreate, xGroupCreate, xGroupDelConsumer, xGroupDestroy, xInfo, xInfoConsumers, xInfoGroups, xLen, xPending, xPending, xRange, xRange, xRead, xRead, xReadGroup, xReadGroup, xRevRange, xRevRange, xTrim, xTrim, zAdd, zAdd, zCard, zCount, zCount, zDiff, zDiffStore, zDiffWithScores, zIncrBy, zInter, zInterStore, zInterStore, zInterStore, zInterWithScores, zInterWithScores, zInterWithScores, zLexCount, zMScore, zPopMax, zPopMax, zPopMin, zPopMin, zRandMember, zRandMember, zRandMemberWithScore, zRandMemberWithScore, zRange, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRangeWithScores, zRank, zRem, zRemRange, zRemRangeByLex, zRemRangeByScore, zRemRangeByScore, zRevRange, zRevRangeByLex, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeWithScores, zRevRank, zScan, zScore, zUnion, zUnionStore, zUnionStore, zUnionStore, zUnionWithScores, zUnionWithScores, zUnionWithScores
Methods inherited from interface org.springframework.data.redis.connection.RedisClusterConnection
execute
Methods inherited from interface org.springframework.data.redis.connection.RedisCommands
execute
Methods inherited from interface org.springframework.data.redis.connection.RedisCommandsProvider
commands, scriptingCommands, streamCommands
Methods inherited from interface org.springframework.data.redis.connection.RedisConnection
closePipeline, getNativeConnection, getSentinelConnection, isClosed, isPipelined, isQueueing, openPipeline
Methods inherited from interface org.springframework.data.redis.connection.RedisConnectionCommands
echo
Methods inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
geoAdd, geoRadiusByMember
Methods inherited from interface org.springframework.data.redis.connection.RedisKeyCommands
restore, scan
Methods inherited from interface org.springframework.data.redis.connection.RedisListCommands
lPos
Methods inherited from interface org.springframework.data.redis.connection.RedisPubSubCommands
getSubscription, isSubscribed, pSubscribe, publish, subscribe
Methods inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPending
Methods inherited from interface org.springframework.data.redis.connection.RedisStringCommands
bitPos
Methods inherited from interface org.springframework.data.redis.connection.RedisTxCommands
discard, exec
Methods inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
zAdd, zAdd, zRangeByLex, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRevRangeByLex, zRevRangeByLex, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores
-
Constructor Details
-
LettuceClusterConnection
public LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient) Creates newLettuceClusterConnection
usingRedisClusterClient
with defaulttimeout
and a freshClusterCommandExecutor
that gets destroyed on close.- Parameters:
clusterClient
- must not be null.
-
LettuceClusterConnection
public LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor) Creates newLettuceClusterConnection
with defaulttimeout
usingRedisClusterClient
running commands across the cluster via givenClusterCommandExecutor
.- Parameters:
clusterClient
- must not be null.executor
- must not be null.
-
LettuceClusterConnection
public LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnection
with given commandtimeout
usingRedisClusterClient
running commands across the cluster via givenClusterCommandExecutor
.- Parameters:
clusterClient
- must not be null.timeout
- must not be null.executor
- must not be null.- Since:
- 2.0
-
LettuceClusterConnection
Creates newLettuceClusterConnection
usingLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
.- Parameters:
connectionProvider
- must not be null.- Since:
- 2.0
-
LettuceClusterConnection
public LettuceClusterConnection(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor) Creates newLettuceClusterConnection
usingLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
.- Parameters:
connectionProvider
- must not be null.executor
- must not be null.- Since:
- 2.0
-
LettuceClusterConnection
public LettuceClusterConnection(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnection
usingLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
.- Parameters:
connectionProvider
- must not be null.executor
- must not be null.timeout
- must not be null.- Since:
- 2.0
-
LettuceClusterConnection
protected LettuceClusterConnection(@Nullable io.lettuce.core.cluster.api.StatefulRedisClusterConnection<byte[], byte[]> sharedConnection, LettuceConnectionProvider connectionProvider, ClusterTopologyProvider clusterTopologyProvider, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnection
given a sharedStatefulRedisClusterConnection
andLettuceConnectionProvider
running commands across the cluster via givenClusterCommandExecutor
.- Parameters:
sharedConnection
- may be null if no shared connection used.connectionProvider
- must not be null.clusterTopologyProvider
- must not be null.executor
- must not be null.timeout
- must not be null.- Since:
- 2.1
-
-
Method Details
-
clusterCommands
Description copied from interface:RedisClusterCommandsProvider
GetRedisGeoCommands
.- Specified by:
clusterCommands
in interfaceRedisClusterCommandsProvider
- Returns:
- never null.
-
geoCommands
Description copied from interface:RedisCommandsProvider
GetRedisGeoCommands
.- Specified by:
geoCommands
in interfaceRedisCommandsProvider
- Overrides:
geoCommands
in classLettuceConnection
- Returns:
- never null.
-
hashCommands
Description copied from interface:RedisCommandsProvider
GetRedisHashCommands
.- Specified by:
hashCommands
in interfaceRedisCommandsProvider
- Overrides:
hashCommands
in classLettuceConnection
- Returns:
- never null.
-
hyperLogLogCommands
Description copied from interface:RedisCommandsProvider
- Specified by:
hyperLogLogCommands
in interfaceRedisCommandsProvider
- Overrides:
hyperLogLogCommands
in classLettuceConnection
- Returns:
- never null.
-
keyCommands
Description copied from interface:RedisCommandsProvider
GetRedisKeyCommands
.- Specified by:
keyCommands
in interfaceRedisCommandsProvider
- Overrides:
keyCommands
in classLettuceConnection
- Returns:
- never null.
-
listCommands
Description copied from interface:RedisCommandsProvider
GetRedisListCommands
.- Specified by:
listCommands
in interfaceRedisCommandsProvider
- Overrides:
listCommands
in classLettuceConnection
- Returns:
- never null.
-
setCommands
Description copied from interface:RedisCommandsProvider
GetRedisSetCommands
.- Specified by:
setCommands
in interfaceRedisCommandsProvider
- Overrides:
setCommands
in classLettuceConnection
- Returns:
- never null.
-
serverCommands
Description copied from interface:RedisCommandsProvider
GetRedisServerCommands
.- Specified by:
serverCommands
in interfaceRedisClusterCommandsProvider
- Specified by:
serverCommands
in interfaceRedisCommandsProvider
- Overrides:
serverCommands
in classLettuceConnection
- Returns:
- never null.
-
stringCommands
Description copied from interface:RedisCommandsProvider
GetRedisStringCommands
.- Specified by:
stringCommands
in interfaceRedisCommandsProvider
- Overrides:
stringCommands
in classLettuceConnection
- Returns:
- never null.
-
zSetCommands
Description copied from interface:RedisCommandsProvider
GetRedisZSetCommands
.- Specified by:
zSetCommands
in interfaceRedisCommandsProvider
- Overrides:
zSetCommands
in classLettuceConnection
- Returns:
- never null.
-
ping
Description copied from interface:RedisConnectionCommands
Test connection.- Specified by:
ping
in interfaceRedisConnectionCommands
- Overrides:
ping
in classLettuceConnection
- Returns:
- Server response message - usually PONG. null when used in pipeline / transaction.
- See Also:
-
ping
- Specified by:
ping
in interfaceRedisClusterConnection
- Parameters:
node
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
clusterGetNodes
Description copied from interface:RedisClusterCommands
Retrieve cluster node information such as id, host, port and slots.- Specified by:
clusterGetNodes
in interfaceRedisClusterCommands
- Returns:
- never null.
- See Also:
-
clusterGetReplicas
Description copied from interface:RedisClusterCommands
Retrieve information about connected replicas for given master node.- Specified by:
clusterGetReplicas
in interfaceRedisClusterCommands
- Parameters:
master
- must not be null.- Returns:
- never null.
- See Also:
-
clusterGetMasterReplicaMap
Description copied from interface:RedisClusterCommands
Retrieve information about masters and their connected replicas.- Specified by:
clusterGetMasterReplicaMap
in interfaceRedisClusterCommands
- Returns:
- never null.
- See Also:
-
clusterGetSlotForKey
Description copied from interface:RedisClusterCommands
Find the slot for a givenkey
.- Specified by:
clusterGetSlotForKey
in interfaceRedisClusterCommands
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
clusterGetNodeForSlot
Description copied from interface:RedisClusterCommands
Find theRedisClusterNode
serving given slot.- Specified by:
clusterGetNodeForSlot
in interfaceRedisClusterCommands
- Returns:
-
clusterGetNodeForKey
Description copied from interface:RedisClusterCommands
Find theRedisClusterNode
serving given key.- Specified by:
clusterGetNodeForKey
in interfaceRedisClusterCommands
- Parameters:
key
- must not be null.- Returns:
-
clusterGetClusterInfo
Description copied from interface:RedisClusterCommands
Get cluster information.- Specified by:
clusterGetClusterInfo
in interfaceRedisClusterCommands
- Returns:
- See Also:
-
clusterAddSlots
Description copied from interface:RedisClusterCommands
Assign slots to givenRedisClusterNode
.- Specified by:
clusterAddSlots
in interfaceRedisClusterCommands
- Parameters:
node
- must not be null.- See Also:
-
clusterAddSlots
Description copied from interface:RedisClusterCommands
AssignRedisClusterNode.SlotRange.getSlotsArray()
to givenRedisClusterNode
.- Specified by:
clusterAddSlots
in interfaceRedisClusterCommands
- Parameters:
node
- must not be null.range
- must not be null.- See Also:
-
clusterCountKeysInSlot
Description copied from interface:RedisClusterCommands
Count the number of keys assigned to one slot.- Specified by:
clusterCountKeysInSlot
in interfaceRedisClusterCommands
- Returns:
- See Also:
-
clusterDeleteSlots
Description copied from interface:RedisClusterCommands
Remove slots fromRedisClusterNode
.- Specified by:
clusterDeleteSlots
in interfaceRedisClusterCommands
- Parameters:
node
- must not be null.- See Also:
-
clusterDeleteSlotsInRange
Description copied from interface:RedisClusterCommands
RemovesRedisClusterNode.SlotRange.getSlotsArray()
from givenRedisClusterNode
.- Specified by:
clusterDeleteSlotsInRange
in interfaceRedisClusterCommands
- Parameters:
node
- must not be null.range
- must not be null.- See Also:
-
clusterForget
Description copied from interface:RedisClusterCommands
Remove given node from cluster.- Specified by:
clusterForget
in interfaceRedisClusterCommands
- Parameters:
node
- must not be null.- See Also:
-
clusterMeet
Description copied from interface:RedisClusterCommands
Add given node to cluster.- Specified by:
clusterMeet
in interfaceRedisClusterCommands
- Parameters:
node
- must containhost
andRedisNode.getPort()
and must not be null.- See Also:
-
clusterSetSlot
- Specified by:
clusterSetSlot
in interfaceRedisClusterCommands
- Parameters:
node
- must not be null.mode
- must not benull.- See Also:
-
clusterGetKeysInSlot
Description copied from interface:RedisClusterCommands
Get keys served by slot.- Specified by:
clusterGetKeysInSlot
in interfaceRedisClusterCommands
count
- must not be null.- Returns:
- See Also:
-
clusterReplicate
Description copied from interface:RedisClusterCommands
Assign a replica to given master.- Specified by:
clusterReplicate
in interfaceRedisClusterCommands
- Parameters:
master
- must not be null.replica
- must not be null.- See Also:
-
keys
- Specified by:
keys
in interfaceRedisClusterConnection
- Parameters:
node
- must not be null.pattern
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
scan
Description copied from interface:RedisClusterConnection
Use aCursor
to iterate over keys.- Specified by:
scan
in interfaceRedisClusterConnection
- Parameters:
node
- must not be null.options
- must not be null.- Returns:
- never null.
- See Also:
-
randomKey
- Specified by:
randomKey
in interfaceRedisClusterConnection
- Parameters:
node
- must not be null.- Returns:
- null when no keys stored at node or when used in pipeline / transaction.
- See Also:
-
select
public void select(int dbIndex) Description copied from interface:RedisConnectionCommands
Select the DB with given positivedbIndex
.- Specified by:
select
in interfaceRedisConnectionCommands
- Overrides:
select
in classLettuceConnection
- Parameters:
dbIndex
- the database index.- See Also:
-
watch
public void watch(byte[]... keys) Description copied from interface:RedisTxCommands
Watch givenkeys
for modifications during transaction started withRedisTxCommands.multi()
.- Specified by:
watch
in interfaceRedisTxCommands
- Overrides:
watch
in classLettuceConnection
- Parameters:
keys
- must not be null.- See Also:
-
unwatch
public void unwatch()Description copied from interface:RedisTxCommands
Flushes all the previouslyRedisTxCommands.watch(byte[]...)
keys.- Specified by:
unwatch
in interfaceRedisTxCommands
- Overrides:
unwatch
in classLettuceConnection
- See Also:
-
multi
public void multi()Description copied from interface:RedisTxCommands
Mark the start of a transaction block.
Commands will be queued and can then be executed by callingRedisTxCommands.exec()
or rolled back usingRedisTxCommands.discard()
- Specified by:
multi
in interfaceRedisTxCommands
- Overrides:
multi
in classLettuceConnection
- See Also:
-
getClusterCommandExecutor
-
close
Description copied from interface:RedisConnection
Closes (or quits) the connection.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRedisConnection
- Overrides:
close
in classLettuceConnection
- Throws:
DataAccessException
-