Package io.lettuce.core.cluster.topology
Interface ClusterTopologyRefresh
-
public interface ClusterTopologyRefresh
Utility to refresh the cluster topology view based onPartitions
.- Author:
- Mark Paluch
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ClusterTopologyRefresh
create(NodeConnectionFactory nodeConnectionFactory, ClientResources clientResources)
Create a newClusterTopologyRefresh
instance.CompletionStage<Map<RedisURI,Partitions>>
loadViews(Iterable<RedisURI> seed, Duration connectTimeout, boolean discovery)
-
-
-
Method Detail
-
create
static ClusterTopologyRefresh create(NodeConnectionFactory nodeConnectionFactory, ClientResources clientResources)
Create a newClusterTopologyRefresh
instance.- Parameters:
nodeConnectionFactory
- the connection factory to open connections to specific cluster nodesclientResources
- shared client resources- Returns:
- a new
ClusterTopologyRefresh
instance.
-
loadViews
CompletionStage<Map<RedisURI,Partitions>> loadViews(Iterable<RedisURI> seed, Duration connectTimeout, boolean discovery)
Load topology views from a collection ofRedisURI
s and return the view perRedisURI
. Partitions contain an ordered list ofRedisClusterNode
s. The sort key is latency. Nodes with lower latency come first.- Parameters:
seed
- collection ofRedisURI
sconnectTimeout
- connect timeoutdiscovery
-true
to discover additional nodes- Returns:
- mapping between
RedisURI
andPartitions
-
-