public class LettuceClusterConnection extends LettuceConnection implements DefaultedRedisClusterConnection
RedisClusterConnection
implementation on top of Lettuce
Redis client.Modifier and Type | Class and Description |
---|---|
protected static interface |
LettuceClusterConnection.LettuceClusterCommandCallback<T>
Lettuce specific implementation of
ClusterCommandExecutor.ClusterCommandCallback . |
protected static interface |
LettuceClusterConnection.LettuceMultiKeyClusterCommandCallback<T>
Lettuce specific implementation of
ClusterCommandExecutor.MultiKeyClusterCommandCallback . |
LettuceConnection.PipeliningFlushPolicy, LettuceConnection.PipeliningFlushState
RedisClusterCommands.AddSlots
RedisStringCommands.BitOperation, RedisStringCommands.SetOption
RedisListCommands.Direction, RedisListCommands.Position
RedisZSetCommands.Aggregate, RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.Tuple, RedisZSetCommands.Weights, RedisZSetCommands.ZAddArgs
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptions
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgs
Modifier | Constructor and Description |
---|---|
|
LettuceClusterConnection(LettuceConnectionProvider connectionProvider)
Creates new
LettuceClusterConnection using LettuceConnectionProvider running commands across the
cluster via given ClusterCommandExecutor . |
|
LettuceClusterConnection(LettuceConnectionProvider connectionProvider,
ClusterCommandExecutor executor)
Creates new
LettuceClusterConnection using LettuceConnectionProvider running commands across the
cluster via given ClusterCommandExecutor . |
|
LettuceClusterConnection(LettuceConnectionProvider connectionProvider,
ClusterCommandExecutor executor,
Duration timeout)
Creates new
LettuceClusterConnection using LettuceConnectionProvider running commands across the
cluster via given ClusterCommandExecutor . |
|
LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient)
Creates new
LettuceClusterConnection using RedisClusterClient with default
timeout and a fresh ClusterCommandExecutor that gets destroyed on
close. |
|
LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient,
ClusterCommandExecutor executor)
Creates new
LettuceClusterConnection with default timeout using
RedisClusterClient running commands across the cluster via given ClusterCommandExecutor . |
|
LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient,
ClusterCommandExecutor executor,
Duration timeout)
Creates new
LettuceClusterConnection with given command timeout using RedisClusterClient
running commands across the cluster via given ClusterCommandExecutor . |
protected |
LettuceClusterConnection(io.lettuce.core.cluster.api.StatefulRedisClusterConnection<byte[],byte[]> sharedConnection,
LettuceConnectionProvider connectionProvider,
ClusterTopologyProvider clusterTopologyProvider,
ClusterCommandExecutor executor,
Duration timeout)
Creates new
LettuceClusterConnection given a shared StatefulRedisClusterConnection and
LettuceConnectionProvider running commands across the cluster via given ClusterCommandExecutor . |
closePipeline, 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
getSentinelConnection, hasRedisSentinelConfigured, setSentinelConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bgReWriteAof, bgSave, dbSize, execute, flushAll, flushDb, getClientList, getConfig, info, info, lastSave, resetConfigStats, rewriteConfig, save, setConfig, shutdown, time, time
append, bgReWriteAof, bgSave, bgWriteAof, 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, 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, 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, slaveOf, slaveOfNoOne, 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, zRangeWithScores, zRank, zRem, zRemRange, zRemRangeByLex, zRemRangeByScore, zRemRangeByScore, zRevRange, zRevRangeByLex, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeWithScores, zRevRank, zScan, zScore, zUnion, zUnionStore, zUnionStore, zUnionStore, zUnionWithScores, zUnionWithScores, zUnionWithScores
closePipeline, getNativeConnection, getSentinelConnection, isClosed, isPipelined, isQueueing, openPipeline, scriptingCommands, streamCommands
execute
restore, scan
bitPos
lPos
zAdd, zAdd, zRangeByLex, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRevRangeByLex, zRevRangeByLex, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores
discard, exec
getSubscription, isSubscribed, pSubscribe, publish, subscribe
echo
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPending
geoAdd, geoRadiusByMember
public LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient)
LettuceClusterConnection
using RedisClusterClient
with default
timeout
and a fresh ClusterCommandExecutor
that gets destroyed on
close.clusterClient
- must not be null.public LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor)
LettuceClusterConnection
with default timeout
using
RedisClusterClient
running commands across the cluster via given ClusterCommandExecutor
.clusterClient
- must not be null.executor
- must not be null.public LettuceClusterConnection(io.lettuce.core.cluster.RedisClusterClient clusterClient, ClusterCommandExecutor executor, Duration timeout)
LettuceClusterConnection
with given command timeout
using RedisClusterClient
running commands across the cluster via given ClusterCommandExecutor
.clusterClient
- must not be null.timeout
- must not be null.executor
- must not be null.public LettuceClusterConnection(LettuceConnectionProvider connectionProvider)
LettuceClusterConnection
using LettuceConnectionProvider
running commands across the
cluster via given ClusterCommandExecutor
.connectionProvider
- must not be null.public LettuceClusterConnection(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor)
LettuceClusterConnection
using LettuceConnectionProvider
running commands across the
cluster via given ClusterCommandExecutor
.connectionProvider
- must not be null.executor
- must not be null.public LettuceClusterConnection(LettuceConnectionProvider connectionProvider, ClusterCommandExecutor executor, Duration timeout)
LettuceClusterConnection
using LettuceConnectionProvider
running commands across the
cluster via given ClusterCommandExecutor
.connectionProvider
- must not be null.executor
- must not be null.timeout
- must not be null.protected LettuceClusterConnection(@Nullable io.lettuce.core.cluster.api.StatefulRedisClusterConnection<byte[],byte[]> sharedConnection, LettuceConnectionProvider connectionProvider, ClusterTopologyProvider clusterTopologyProvider, ClusterCommandExecutor executor, Duration timeout)
LettuceClusterConnection
given a shared StatefulRedisClusterConnection
and
LettuceConnectionProvider
running commands across the cluster via given ClusterCommandExecutor
.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.public RedisGeoCommands geoCommands()
RedisConnection
RedisGeoCommands
.geoCommands
in interface RedisConnection
geoCommands
in class LettuceConnection
public RedisHashCommands hashCommands()
RedisConnection
RedisHashCommands
.hashCommands
in interface RedisConnection
hashCommands
in class LettuceConnection
public RedisHyperLogLogCommands hyperLogLogCommands()
RedisConnection
hyperLogLogCommands
in interface RedisConnection
hyperLogLogCommands
in class LettuceConnection
public RedisKeyCommands keyCommands()
RedisConnection
RedisKeyCommands
.keyCommands
in interface RedisConnection
keyCommands
in class LettuceConnection
public RedisListCommands listCommands()
RedisConnection
RedisListCommands
.listCommands
in interface RedisConnection
listCommands
in class LettuceConnection
public RedisStringCommands stringCommands()
RedisConnection
RedisStringCommands
.stringCommands
in interface RedisConnection
stringCommands
in class LettuceConnection
public RedisSetCommands setCommands()
RedisConnection
RedisSetCommands
.setCommands
in interface RedisConnection
setCommands
in class LettuceConnection
public RedisZSetCommands zSetCommands()
RedisConnection
RedisZSetCommands
.zSetCommands
in interface RedisConnection
zSetCommands
in class LettuceConnection
public RedisClusterServerCommands serverCommands()
RedisConnection
RedisServerCommands
.serverCommands
in interface RedisClusterConnection
serverCommands
in interface RedisConnection
serverCommands
in class LettuceConnection
public String ping()
RedisConnectionCommands
ping
in interface RedisConnectionCommands
ping
in class LettuceConnection
public String ping(RedisClusterNode node)
ping
in interface RedisClusterConnection
node
- must not be null.RedisConnectionCommands.ping()
public List<RedisClusterNode> clusterGetNodes()
RedisClusterCommands
clusterGetNodes
in interface RedisClusterCommands
public Set<RedisClusterNode> clusterGetSlaves(RedisClusterNode master)
RedisClusterCommands
clusterGetSlaves
in interface RedisClusterCommands
master
- must not be null.public Map<RedisClusterNode,Collection<RedisClusterNode>> clusterGetMasterSlaveMap()
RedisClusterCommands
clusterGetMasterSlaveMap
in interface RedisClusterCommands
public Integer clusterGetSlotForKey(byte[] key)
RedisClusterCommands
key
.clusterGetSlotForKey
in interface RedisClusterCommands
key
- must not be null.public RedisClusterNode clusterGetNodeForSlot(int slot)
RedisClusterCommands
RedisClusterNode
serving given slot.clusterGetNodeForSlot
in interface RedisClusterCommands
public RedisClusterNode clusterGetNodeForKey(byte[] key)
RedisClusterCommands
RedisClusterNode
serving given key.clusterGetNodeForKey
in interface RedisClusterCommands
key
- must not be null.public ClusterInfo clusterGetClusterInfo()
RedisClusterCommands
clusterGetClusterInfo
in interface RedisClusterCommands
public void clusterAddSlots(RedisClusterNode node, int... slots)
RedisClusterCommands
RedisClusterNode
.clusterAddSlots
in interface RedisClusterCommands
node
- must not be null.public void clusterAddSlots(RedisClusterNode node, RedisClusterNode.SlotRange range)
RedisClusterCommands
RedisClusterNode.SlotRange.getSlotsArray()
to given RedisClusterNode
.clusterAddSlots
in interface RedisClusterCommands
node
- must not be null.range
- must not be null.public Long clusterCountKeysInSlot(int slot)
RedisClusterCommands
clusterCountKeysInSlot
in interface RedisClusterCommands
public void clusterDeleteSlots(RedisClusterNode node, int... slots)
RedisClusterCommands
RedisClusterNode
.clusterDeleteSlots
in interface RedisClusterCommands
node
- must not be null.public void clusterDeleteSlotsInRange(RedisClusterNode node, RedisClusterNode.SlotRange range)
RedisClusterCommands
RedisClusterNode.SlotRange.getSlotsArray()
from given RedisClusterNode
.clusterDeleteSlotsInRange
in interface RedisClusterCommands
node
- must not be null.range
- must not be null.public void clusterForget(RedisClusterNode node)
RedisClusterCommands
clusterForget
in interface RedisClusterCommands
node
- must not be null.public void clusterMeet(RedisClusterNode node)
RedisClusterCommands
clusterMeet
in interface RedisClusterCommands
node
- must contain host
and RedisNode.getPort()
and must
not be null.public void clusterSetSlot(RedisClusterNode node, int slot, RedisClusterCommands.AddSlots mode)
clusterSetSlot
in interface RedisClusterCommands
node
- must not be null.mode
- must not benull.public List<byte[]> clusterGetKeysInSlot(int slot, Integer count)
RedisClusterCommands
clusterGetKeysInSlot
in interface RedisClusterCommands
count
- must not be null.public void clusterReplicate(RedisClusterNode master, RedisClusterNode replica)
RedisClusterCommands
clusterReplicate
in interface RedisClusterCommands
master
- must not be null.replica
- must not be null.public Set<byte[]> keys(RedisClusterNode node, byte[] pattern)
keys
in interface RedisClusterConnection
node
- must not be null.pattern
- must not be null.RedisKeyCommands.keys(byte[])
public Cursor<byte[]> scan(RedisClusterNode node, ScanOptions options)
RedisClusterConnection
Cursor
to iterate over keys.scan
in interface RedisClusterConnection
node
- must not be null.options
- must not be null.public byte[] randomKey(RedisClusterNode node)
randomKey
in interface RedisClusterConnection
node
- must not be null.RedisKeyCommands.randomKey()
public void select(int dbIndex)
RedisConnectionCommands
dbIndex
.select
in interface RedisConnectionCommands
select
in class LettuceConnection
dbIndex
- the database index.public void watch(byte[]... keys)
RedisTxCommands
keys
for modifications during transaction started with RedisTxCommands.multi()
.watch
in interface RedisTxCommands
watch
in class LettuceConnection
keys
- must not be null.public void unwatch()
RedisTxCommands
#watch(byte[]...)
keys.unwatch
in interface RedisTxCommands
unwatch
in class LettuceConnection
public void multi()
RedisTxCommands
RedisTxCommands.exec()
or rolled back using RedisTxCommands.discard()
multi
in interface RedisTxCommands
multi
in class LettuceConnection
public ClusterCommandExecutor getClusterCommandExecutor()
public void close() throws DataAccessException
RedisConnection
close
in interface AutoCloseable
close
in interface RedisConnection
close
in class LettuceConnection
DataAccessException
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.