Interface RedisClusterConnection
- All Superinterfaces:
AutoCloseable,DefaultedRedisClusterConnection,DefaultedRedisConnection,RedisClusterCommands,RedisClusterCommandsProvider,RedisClusterServerCommands,RedisCommands,RedisCommandsProvider,RedisConnection,RedisConnectionCommands,RedisGeoCommands,RedisHashCommands,RedisHyperLogLogCommands,RedisKeyCommands,RedisListCommands,RedisPubSubCommands,RedisScriptingCommands,RedisServerCommands,RedisSetCommands,RedisStreamCommands,RedisStringCommands,RedisTxCommands,RedisZSetCommands
- All Known Implementing Classes:
JedisClusterConnection,LettuceClusterConnection
public interface RedisClusterConnection
extends RedisConnection, DefaultedRedisClusterConnection, RedisClusterCommandsProvider
RedisClusterConnection allows sending commands to dedicated nodes within the cluster. A
RedisClusterNode can be obtained from RedisClusterCommands.clusterGetNodes() or it can be constructed using either
host and RedisNode.getPort() or the node Id.
Redis connections, unlike perhaps their underlying native connection are not
Thread-safe and should not be shared across multiple threads.
- Since:
- 1.7
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested 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 -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Texecute(String command, byte[] key, Collection<byte[]> args) Execute the given command for thekeyprovided potentially appending args.Set<byte[]>keys(RedisClusterNode node, byte[] pattern) ping(RedisClusterNode node) byte[]randomKey(RedisClusterNode node) Cursor<byte[]>scan(RedisClusterNode node, ScanOptions options) Use aCursorto iterate over keys.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, timeMethods 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, zUnionWithScoresMethods inherited from interface org.springframework.data.redis.connection.RedisClusterCommands
clusterAddSlots, clusterAddSlots, clusterCountKeysInSlot, clusterDeleteSlots, clusterDeleteSlotsInRange, clusterForget, clusterGetClusterInfo, clusterGetKeysInSlot, clusterGetMasterReplicaMap, clusterGetNodeForKey, clusterGetNodeForSlot, clusterGetNodes, clusterGetReplicas, clusterGetSlotForKey, clusterMeet, clusterReplicate, clusterSetSlotMethods inherited from interface org.springframework.data.redis.connection.RedisClusterCommandsProvider
clusterCommands, serverCommandsMethods inherited from interface org.springframework.data.redis.connection.RedisCommands
executeMethods inherited from interface org.springframework.data.redis.connection.RedisCommandsProvider
commands, geoCommands, hashCommands, hyperLogLogCommands, keyCommands, listCommands, scriptingCommands, setCommands, streamCommands, stringCommands, zSetCommandsMethods inherited from interface org.springframework.data.redis.connection.RedisConnection
close, closePipeline, getNativeConnection, getSentinelConnection, isClosed, isPipelined, isQueueing, openPipelineMethods inherited from interface org.springframework.data.redis.connection.RedisConnectionCommands
echo, ping, selectMethods inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
geoAdd, geoRadiusByMemberMethods inherited from interface org.springframework.data.redis.connection.RedisKeyCommands
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, exec, multi, unwatch, watchMethods 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
-
Method Details
-
ping
- Parameters:
node- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
keys
- Parameters:
node- must not be null.pattern- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
scan
Use aCursorto iterate over keys.- Parameters:
node- must not be null.options- must not be null.- Returns:
- never null.
- Since:
- 2.1
- See Also:
-
randomKey
- Parameters:
node- must not be null.- Returns:
- null when no keys stored at node or when used in pipeline / transaction.
- See Also:
-
execute
Execute the given command for thekeyprovided potentially appending args.
This method, other thanRedisCommands.execute(String, byte[]...), dispatches the command to thekeyserving master node.// SET foo bar EX 10 NX execute("SET", "foo".getBytes(), asBinaryList("bar", "EX", 10, "NX"))- Parameters:
command- must not be null.key- must not be null.args- must not be null.- Returns:
- command result as delivered by the underlying Redis driver. Can be null.
- Since:
- 2.1
-