rank_replicas_via_locality#

LocalityMixin.rank_replicas_via_locality(replicas: List[RunningReplica]) → List[List[RunningReplica]][source]#

Rank the replicas based on the locality preference. Rank 0 is the list of replicas that are on the same node. Rank 1 is the list of replicas that are on the same availability zone. Rank 2 is the list of all other replicas.

Parameters:

replicas (List[RunningReplica]) – The replicas to rank.

Returns:

Three lists of replicas, ordered by rank.

Return type:

List[List[RunningReplica]]