public class ReplicaSortFunctionFactory extends Object
Modifier and Type | Method and Description |
---|---|
static Function<Replica,Integer> |
deprioritizeDiskImmigrants()
This priority function can be used together with
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the immigrant replicas for the disk. |
static Function<Replica,Integer> |
deprioritizeImmigrants()
This priority function can be used together with
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the immigrant replicas. |
static Function<Replica,Integer> |
deprioritizeOfflineReplicas()
This priority function can be used together with
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the offline replicas. |
static Function<Replica,Integer> |
deprioritizeOfflineReplicasThenImmigrants()
This priority function can be used together with
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the offline replicas then immigrants. |
static Function<Replica,Integer> |
prioritizeDiskImmigrants() |
static Function<Replica,Integer> |
prioritizeImmigrants() |
static Function<Replica,Integer> |
prioritizeOfflineReplicas() |
static Function<Replica,Integer> |
prioritizeOfflineReplicasThenImmigrants() |
static Function<Replica,Boolean> |
selectImmigrantLeaders() |
static Function<Replica,Boolean> |
selectImmigrants() |
static Function<Replica,Boolean> |
selectLeaders() |
static Function<Replica,Boolean> |
selectOnlineReplicas() |
static Function<Replica,Double> |
sortByMetricGroupValue(String metricGroup) |
static Function<Replica,Double> |
sortByMetricValue(String metricName) |
public static Function<Replica,Double> sortByMetricValue(String metricName)
metricName
- the metric name to scorepublic static Function<Replica,Double> sortByMetricGroupValue(String metricGroup)
metricGroup
- the metric group to scorepublic static Function<Replica,Integer> prioritizeImmigrants()
public static Function<Replica,Integer> prioritizeOfflineReplicas()
public static Function<Replica,Integer> prioritizeOfflineReplicasThenImmigrants()
public static Function<Replica,Integer> deprioritizeImmigrants()
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the immigrant replicas.public static Function<Replica,Integer> deprioritizeOfflineReplicas()
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the offline replicas.public static Function<Replica,Integer> deprioritizeOfflineReplicasThenImmigrants()
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the offline replicas then immigrants.public static Function<Replica,Integer> prioritizeDiskImmigrants()
public static Function<Replica,Integer> deprioritizeDiskImmigrants()
SortedReplicas.reverselySortedReplicas()
to provide sorted replicas in descending order of score and prioritize the immigrant replicas for the disk.public static Function<Replica,Boolean> selectImmigrants()
public static Function<Replica,Boolean> selectLeaders()
public static Function<Replica,Boolean> selectOnlineReplicas()