public interface ClusterTopologyRefresh
Utility to refresh the cluster topology view based on
Partitions.- Author:
- Mark Paluch
-
Method Summary
Modifier and Type Method Description static ClusterTopologyRefreshcreate(NodeConnectionFactory nodeConnectionFactory, ClientResources clientResources)Create a newClusterTopologyRefreshinstance.CompletionStage<Map<RedisURI,Partitions>>loadViews(Iterable<RedisURI> seed, Duration connectTimeout, boolean discovery)
-
Method Details
-
create
static ClusterTopologyRefresh create(NodeConnectionFactory nodeConnectionFactory, ClientResources clientResources)Create a newClusterTopologyRefreshinstance.- Parameters:
nodeConnectionFactory- the connection factory to open connections to specific cluster nodesclientResources- shared client resources- Returns:
- a new
ClusterTopologyRefreshinstance.
-
loadViews
CompletionStage<Map<RedisURI,Partitions>> loadViews(Iterable<RedisURI> seed, Duration connectTimeout, boolean discovery)Load topology views from a collection ofRedisURIs and return the view perRedisURI. Partitions contain an ordered list ofRedisClusterNodes. The sort key is latency. Nodes with lower latency come first.- Parameters:
seed- collection ofRedisURIsconnectTimeout- connect timeoutdiscovery-trueto discover additional nodes- Returns:
- mapping between
RedisURIandPartitions
-