public class TopologyComparators extends Object
RedisClusterNode and RedisURI.| Constructor and Description |
|---|
TopologyComparators() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isChanged(Partitions o1,
Partitions o2)
Check if properties changed which are essential for cluster operations.
|
static List<RedisClusterNode> |
predefinedSort(Iterable<RedisClusterNode> clusterNodes,
Iterable<RedisURI> fixedOrder)
Sort partitions by a
fixedOrder and by RedisURI. |
static List<RedisClusterNode> |
sortByClientCount(Iterable<RedisClusterNode> clusterNodes)
Sort partitions by client count.
|
static List<RedisClusterNode> |
sortByLatency(Iterable<RedisClusterNode> clusterNodes)
Sort partitions by latency.
|
static List<RedisClusterNode> |
sortByUri(Iterable<RedisClusterNode> clusterNodes)
Sort partitions by RedisURI.
|
public static List<RedisClusterNode> predefinedSort(Iterable<RedisClusterNode> clusterNodes, Iterable<RedisURI> fixedOrder)
fixedOrder and by RedisURI. Nodes are sorted as provided in fixedOrder.
RedisURIss not contained in fixedOrder are ordered after the fixed sorting and sorted wihin the
block by comparing RedisURI.clusterNodes - the sorting input.fixedOrder - the fixed order part.RedisClusterNodes ordered by fixedOrder and RedisURI.sortByUri(Iterable)public static List<RedisClusterNode> sortByUri(Iterable<RedisClusterNode> clusterNodes)
clusterNodes - RedisClusterNodes ordered by RedisURI.public static List<RedisClusterNode> sortByClientCount(Iterable<RedisClusterNode> clusterNodes)
clusterNodes - RedisClusterNodes ordered by client count.public static List<RedisClusterNode> sortByLatency(Iterable<RedisClusterNode> clusterNodes)
clusterNodes - RedisClusterNodes ordered by latency.public static boolean isChanged(Partitions o1, Partitions o2)
o1 - the first object to be compared.o2 - the second object to be compared.true if MASTER or SLAVE flags changed or the responsible slots changed.Copyright © 2020 lettuce.io. All rights reserved.