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> |
selectLeaders() |
static Function<Replica,Boolean> |
selectOnlineReplicas() |
static Function<Replica,Double> |
sortByMetricResourceValue(Resource resource) |
public static Function<Replica,Double> sortByMetricResourceValue(Resource resource)
resource
- the resource 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> selectLeaders()