pub trait RegionStatAwareSelector: Send + Sync {
type Context;
type Output;
// Required method
fn select<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Self::Context,
from_peer_id: u64,
region_ids: &'life2 [RegionId],
exclude_peer_ids: HashSet<u64>,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
A selector that aware of region statistics
It selects the best destination peer for a list of regions. The selection is based on the region statistics, such as the region leader’s write throughput.