Interface ClusterOperations<K,V>
public interface ClusterOperations<K,V>
Redis operations for cluster specific operations. A
RedisClusterNode can be obtained from
a connection or it can be
constructed using either host and RedisNode.getPort() or the
node Id.- Since:
- 1.7
- Author:
- Christoph Strobl, Mark Paluch, Dennis Neufeld
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSlots(RedisClusterNode node, int... slots) Add slots to given node;voidaddSlots(RedisClusterNode node, RedisClusterNode.SlotRange range) Add slots inRedisClusterNode.SlotRangeto given node.voidbgReWriteAof(RedisClusterNode node) Start an Append Only File rewrite process on given node.voidbgSave(RedisClusterNode node) Start background saving of db on given node.voidflushDb(RedisClusterNode node) Flush db on node.voidflushDb(RedisClusterNode node, RedisServerCommands.FlushOption option) Flush db on node using the specifiedRedisServerCommands.FlushOption.voidforget(RedisClusterNode node) Remove the node from the cluster.getReplicas(RedisClusterNode node) keys(RedisClusterNode node, K pattern) Get all keys located at given node.voidmeet(RedisClusterNode node) Add the node to cluster.ping(RedisClusterNode node) Ping the given node;randomKey(RedisClusterNode node) Get a random key from the range served by the given node.voidreshard(RedisClusterNode source, int slot, RedisClusterNode target) Move slot assignment from one source to target node and copy keys associated with the slot.voidsave(RedisClusterNode node) Synchronous save current db snapshot on server.voidshutdown(RedisClusterNode node) Shutdown given node.
-
Method Details
-
keys
Get all keys located at given node.- Parameters:
node- must not be null.pattern-- Returns:
- never null.
- See Also:
-
ping
Ping the given node;- Parameters:
node- must not be null.- Returns:
- See Also:
-
randomKey
Get a random key from the range served by the given node.- Parameters:
node- must not be null.- Returns:
- See Also:
-
addSlots
Add slots to given node;- Parameters:
node- must not be null.slots- must not be null.
-
addSlots
Add slots inRedisClusterNode.SlotRangeto given node.- Parameters:
node- must not be null.range- must not be null.
-
bgReWriteAof
Start an Append Only File rewrite process on given node.- Parameters:
node- must not be null.- See Also:
-
bgSave
Start background saving of db on given node.- Parameters:
node- must not be null.- See Also:
-
meet
Add the node to cluster.- Parameters:
node- must not be null.
-
forget
Remove the node from the cluster.- Parameters:
node- must not be null.
-
flushDb
Flush db on node.- Parameters:
node- must not be null.- See Also:
-
flushDb
Flush db on node using the specifiedRedisServerCommands.FlushOption.- Parameters:
node- must not be null.option- must not be null.- Since:
- 2.7
- See Also:
-
getReplicas
- Parameters:
node- must not be null.- Returns:
-
save
Synchronous save current db snapshot on server.- Parameters:
node- must not be null.- See Also:
-
shutdown
Shutdown given node.- Parameters:
node- must not be null.- See Also:
-
reshard
Move slot assignment from one source to target node and copy keys associated with the slot.- Parameters:
source- must not be null.slot-target- must not be null.
-