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
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceLettuce specific implementation ofClusterCommandExecutor.ClusterCommandCallback.protected static interfaceLettuce specific implementation ofClusterCommandExecutor.MultiKeyClusterCommandCallback.Nested classes/interfaces inherited from class org.springframework.data.redis.connection.lettuce.LettuceConnection
LettuceConnection.PipeliningFlushPolicy, LettuceConnection.PipeliningFlushStateNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisClusterCommands
RedisClusterCommands.AddSlotsNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgsNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisListCommands
RedisListCommands.Direction, RedisListCommands.PositionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisServerCommands
RedisServerCommands.FlushOption, RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOptionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptionsNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStringCommands
RedisStringCommands.BitOperation, RedisStringCommands.SetOptionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.ZAddArgs -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLettuceClusterConnection(io.lettuce.core.cluster.api.StatefulRedisClusterConnection<byte[], byte[]> sharedConnection, LettuceConnectionProvider connectionProvider, ClusterTopologyProvider clusterTopologyProvider, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnectiongiven a sharedStatefulRedisClusterConnectionandLettuceConnectionProviderrunning commands across the cluster via givenClusterCommandExecutor.LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient) Creates newLettuceClusterConnectionusingRedisClusterClientwith defaulttimeoutand a freshClusterCommandExecutorthat gets destroyed on close.LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor) Creates newLettuceClusterConnectionwith defaulttimeoutusingRedisClusterClientrunning commands across the cluster via givenClusterCommandExecutor.LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnectionwith given commandtimeoutusingRedisClusterClientrunning commands across the cluster via givenClusterCommandExecutor.LettuceClusterConnection(LettuceConnectionProvider connectionProvider) Creates newLettuceClusterConnectionusingLettuceConnectionProviderrunning commands across the cluster via givenClusterCommandExecutor.LettuceClusterConnection(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor) Creates newLettuceClusterConnectionusingLettuceConnectionProviderrunning commands across the cluster via givenClusterCommandExecutor.LettuceClusterConnection(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor, Duration timeout) Creates newLettuceClusterConnectionusingLettuceConnectionProviderrunning commands across the cluster via givenClusterCommandExecutor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes or quits the connection.voidclusterAddSlots(RedisClusterNode node, int... slots) Assign slots to givenRedisClusterNode.voidclusterAddSlots(RedisClusterNode node, RedisClusterNode.SlotRange range) AssignRedisClusterNode.SlotRange.getSlotsArray()to givenRedisClusterNode.GetRedisGeoCommands.clusterCountKeysInSlot(int slot) Count the number of keys assigned to one slot.voidclusterDeleteSlots(RedisClusterNode node, int... slots) Remove slots fromRedisClusterNode.voidRemovesRedisClusterNode.SlotRange.getSlotsArray()from givenRedisClusterNode.voidRemove 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 theRedisClusterNodeserving given key.clusterGetNodeForSlot(int slot) Find theRedisClusterNodeserving 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.voidclusterMeet(RedisClusterNode node) Add given node to cluster.voidclusterReplicate(RedisClusterNode master, RedisClusterNode replica) Assign a replica to given master.voidclusterSetSlot(RedisClusterNode node, int slot, RedisClusterCommands.AddSlots mode) GetRedisGeoCommands.GetRedisHashCommands.GetRedisKeyCommands.Set<byte[]>keys(RedisClusterNode node, byte[] pattern) GetRedisListCommands.voidmulti()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 aCursorto iterate over keys.voidselect(int dbIndex) Select the DB with given positivedbIndex.GetRedisServerCommands.GetRedisSetCommands.GetRedisStringCommands.voidunwatch()Flushes all the previouslyRedisTxCommands.watch(byte[]...)keys.voidwatch(byte[]... keys) Watch givenkeysfor 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, switchToPubSubMethods inherited from class org.springframework.data.redis.connection.AbstractRedisConnection
getSentinelConnection, hasRedisSentinelConfigured, setSentinelConfigurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, timeMethods inherited from interface org.springframework.data.redis.connection.DefaultedRedisConnection
append, applyHashFieldExpiration, 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, expire, expireAt, 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, hExpire, hExpire, hExpireAt, hExpireAt, hGet, hGetAll, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hPersist, hpExpire, hpExpire, hpExpireAt, hpExpireAt, hpTtl, hRandField, hRandField, hRandFieldWithValues, hRandFieldWithValues, hScan, hSet, hSetNX, hStrLen, hTtl, hTtl, 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, pExpire, pExpireAt, 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, setGet, 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, zUnionWithScoresMethods inherited from interface org.springframework.data.redis.connection.RedisClusterConnection
executeMethods inherited from interface org.springframework.data.redis.connection.RedisCommands
executeMethods inherited from interface org.springframework.data.redis.connection.RedisCommandsProvider
commands, scriptingCommands, streamCommandsMethods inherited from interface org.springframework.data.redis.connection.RedisConnection
closePipeline, getNativeConnection, getSentinelConnection, isClosed, isPipelined, isQueueing, openPipelineMethods inherited from interface org.springframework.data.redis.connection.RedisConnectionCommands
echoMethods inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
geoAdd, geoRadiusByMemberMethods inherited from interface org.springframework.data.redis.connection.RedisHashCommands
applyHashFieldExpiration, hExpire, hpExpireMethods inherited from interface org.springframework.data.redis.connection.RedisKeyCommands
applyExpiration, expire, expireAt, pExpire, pExpireAt, restore, scanMethods inherited from interface org.springframework.data.redis.connection.RedisListCommands
lPosMethods inherited from interface org.springframework.data.redis.connection.RedisPubSubCommands
getSubscription, isSubscribed, pSubscribe, publish, subscribeMethods inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPendingMethods inherited from interface org.springframework.data.redis.connection.RedisStringCommands
bitPosMethods inherited from interface org.springframework.data.redis.connection.RedisTxCommands
discard, execMethods 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 newLettuceClusterConnectionusingRedisClusterClientwith defaulttimeoutand a freshClusterCommandExecutorthat gets destroyed on close.- Parameters:
clusterClient- must not be null.
-
LettuceClusterConnection
public LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor) Creates newLettuceClusterConnectionwith defaulttimeoutusingRedisClusterClientrunning 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 newLettuceClusterConnectionwith given commandtimeoutusingRedisClusterClientrunning 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 newLettuceClusterConnectionusingLettuceConnectionProviderrunning commands across the cluster via givenClusterCommandExecutor.- Parameters:
connectionProvider- must not be null.- Since:
- 2.0
-
LettuceClusterConnection
public LettuceClusterConnection(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor) Creates newLettuceClusterConnectionusingLettuceConnectionProviderrunning 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 newLettuceClusterConnectionusingLettuceConnectionProviderrunning 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 newLettuceClusterConnectiongiven a sharedStatefulRedisClusterConnectionandLettuceConnectionProviderrunning 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:RedisClusterCommandsProviderGetRedisGeoCommands.- Specified by:
clusterCommandsin interfaceRedisClusterCommandsProvider- Returns:
- never null.
-
geoCommands
Description copied from interface:RedisCommandsProviderGetRedisGeoCommands.- Specified by:
geoCommandsin interfaceRedisCommandsProvider- Overrides:
geoCommandsin classLettuceConnection- Returns:
- never null.
-
hashCommands
Description copied from interface:RedisCommandsProviderGetRedisHashCommands.- Specified by:
hashCommandsin interfaceRedisCommandsProvider- Overrides:
hashCommandsin classLettuceConnection- Returns:
- never null.
-
hyperLogLogCommands
Description copied from interface:RedisCommandsProvider- Specified by:
hyperLogLogCommandsin interfaceRedisCommandsProvider- Overrides:
hyperLogLogCommandsin classLettuceConnection- Returns:
- never null.
-
keyCommands
Description copied from interface:RedisCommandsProviderGetRedisKeyCommands.- Specified by:
keyCommandsin interfaceRedisCommandsProvider- Overrides:
keyCommandsin classLettuceConnection- Returns:
- never null.
-
listCommands
Description copied from interface:RedisCommandsProviderGetRedisListCommands.- Specified by:
listCommandsin interfaceRedisCommandsProvider- Overrides:
listCommandsin classLettuceConnection- Returns:
- never null.
-
setCommands
Description copied from interface:RedisCommandsProviderGetRedisSetCommands.- Specified by:
setCommandsin interfaceRedisCommandsProvider- Overrides:
setCommandsin classLettuceConnection- Returns:
- never null.
-
serverCommands
Description copied from interface:RedisCommandsProviderGetRedisServerCommands.- Specified by:
serverCommandsin interfaceRedisClusterCommandsProvider- Specified by:
serverCommandsin interfaceRedisCommandsProvider- Overrides:
serverCommandsin classLettuceConnection- Returns:
- never null.
-
stringCommands
Description copied from interface:RedisCommandsProviderGetRedisStringCommands.- Specified by:
stringCommandsin interfaceRedisCommandsProvider- Overrides:
stringCommandsin classLettuceConnection- Returns:
- never null.
-
zSetCommands
Description copied from interface:RedisCommandsProviderGetRedisZSetCommands.- Specified by:
zSetCommandsin interfaceRedisCommandsProvider- Overrides:
zSetCommandsin classLettuceConnection- Returns:
- never null.
-
ping
Description copied from interface:RedisConnectionCommandsTest connection.- Specified by:
pingin interfaceRedisConnectionCommands- Overrides:
pingin classLettuceConnection- Returns:
- Server response message - usually PONG. null when used in pipeline / transaction.
- See Also:
-
ping
- Specified by:
pingin interfaceRedisClusterConnection- Parameters:
node- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
clusterGetNodes
Description copied from interface:RedisClusterCommandsRetrieve cluster node information such as id, host, port and slots.- Specified by:
clusterGetNodesin interfaceRedisClusterCommands- Returns:
- never null.
- See Also:
-
clusterGetReplicas
Description copied from interface:RedisClusterCommandsRetrieve information about connected replicas for given master node.- Specified by:
clusterGetReplicasin interfaceRedisClusterCommands- Parameters:
master- must not be null.- Returns:
- never null.
- See Also:
-
clusterGetMasterReplicaMap
Description copied from interface:RedisClusterCommandsRetrieve information about masters and their connected replicas.- Specified by:
clusterGetMasterReplicaMapin interfaceRedisClusterCommands- Returns:
- never null.
- See Also:
-
clusterGetSlotForKey
Description copied from interface:RedisClusterCommandsFind the slot for a givenkey.- Specified by:
clusterGetSlotForKeyin interfaceRedisClusterCommands- Parameters:
key- must not be null.- Returns:
- See Also:
-
clusterGetNodeForSlot
Description copied from interface:RedisClusterCommandsFind theRedisClusterNodeserving given slot.- Specified by:
clusterGetNodeForSlotin interfaceRedisClusterCommands- Returns:
-
clusterGetNodeForKey
Description copied from interface:RedisClusterCommandsFind theRedisClusterNodeserving given key.- Specified by:
clusterGetNodeForKeyin interfaceRedisClusterCommands- Parameters:
key- must not be null.- Returns:
-
clusterGetClusterInfo
Description copied from interface:RedisClusterCommandsGet cluster information.- Specified by:
clusterGetClusterInfoin interfaceRedisClusterCommands- Returns:
- See Also:
-
clusterAddSlots
Description copied from interface:RedisClusterCommandsAssign slots to givenRedisClusterNode.- Specified by:
clusterAddSlotsin interfaceRedisClusterCommands- Parameters:
node- must not be null.- See Also:
-
clusterAddSlots
Description copied from interface:RedisClusterCommandsAssignRedisClusterNode.SlotRange.getSlotsArray()to givenRedisClusterNode.- Specified by:
clusterAddSlotsin interfaceRedisClusterCommands- Parameters:
node- must not be null.range- must not be null.- See Also:
-
clusterCountKeysInSlot
Description copied from interface:RedisClusterCommandsCount the number of keys assigned to one slot.- Specified by:
clusterCountKeysInSlotin interfaceRedisClusterCommands- Returns:
- See Also:
-
clusterDeleteSlots
Description copied from interface:RedisClusterCommandsRemove slots fromRedisClusterNode.- Specified by:
clusterDeleteSlotsin interfaceRedisClusterCommands- Parameters:
node- must not be null.- See Also:
-
clusterDeleteSlotsInRange
Description copied from interface:RedisClusterCommandsRemovesRedisClusterNode.SlotRange.getSlotsArray()from givenRedisClusterNode.- Specified by:
clusterDeleteSlotsInRangein interfaceRedisClusterCommands- Parameters:
node- must not be null.range- must not be null.- See Also:
-
clusterForget
Description copied from interface:RedisClusterCommandsRemove given node from cluster.- Specified by:
clusterForgetin interfaceRedisClusterCommands- Parameters:
node- must not be null.- See Also:
-
clusterMeet
Description copied from interface:RedisClusterCommandsAdd given node to cluster.- Specified by:
clusterMeetin interfaceRedisClusterCommands- Parameters:
node- must containhostandRedisNode.getPort()and must not be null.- See Also:
-
clusterSetSlot
- Specified by:
clusterSetSlotin interfaceRedisClusterCommands- Parameters:
node- must not be null.mode- must not benull.- See Also:
-
clusterGetKeysInSlot
Description copied from interface:RedisClusterCommandsGet keys served by slot.- Specified by:
clusterGetKeysInSlotin interfaceRedisClusterCommandscount- must not be null.- Returns:
- See Also:
-
clusterReplicate
Description copied from interface:RedisClusterCommandsAssign a replica to given master.- Specified by:
clusterReplicatein interfaceRedisClusterCommands- Parameters:
master- must not be null.replica- must not be null.- See Also:
-
keys
- Specified by:
keysin 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:RedisClusterConnectionUse aCursorto iterate over keys.- Specified by:
scanin interfaceRedisClusterConnection- Parameters:
node- must not be null.options- must not be null.- Returns:
- never null.
- See Also:
-
randomKey
- Specified by:
randomKeyin 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:RedisConnectionCommandsSelect the DB with given positivedbIndex.- Specified by:
selectin interfaceRedisConnectionCommands- Overrides:
selectin classLettuceConnection- Parameters:
dbIndex- the database index.- See Also:
-
watch
public void watch(byte[]... keys) Description copied from interface:RedisTxCommandsWatch givenkeysfor modifications during transaction started withRedisTxCommands.multi().- Specified by:
watchin interfaceRedisTxCommands- Overrides:
watchin classLettuceConnection- Parameters:
keys- must not be null.- See Also:
-
unwatch
public void unwatch()Description copied from interface:RedisTxCommandsFlushes all the previouslyRedisTxCommands.watch(byte[]...)keys.- Specified by:
unwatchin interfaceRedisTxCommands- Overrides:
unwatchin classLettuceConnection- See Also:
-
multi
public void multi()Description copied from interface:RedisTxCommandsMark 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:
multiin interfaceRedisTxCommands- Overrides:
multiin classLettuceConnection- See Also:
-
getClusterCommandExecutor
-
close
Description copied from interface:RedisConnectionCloses or quits the connection.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRedisConnection- Overrides:
closein classLettuceConnection- Throws:
DataAccessException- if theRedisConnectioncould not be closed.
-