mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
Narrow core ranking public surface
This commit is contained in:
@@ -39,12 +39,9 @@ pub use model::{
|
||||
};
|
||||
pub use provider::{build_provider_concurrent_limit_map, should_skip_provider_quota};
|
||||
pub use ranking::{
|
||||
apply_scheduler_candidate_ranking, candidate_priority_slot, candidates_share_priority_group,
|
||||
compare_candidate_identity_for_ranking, compare_candidate_priority_slot,
|
||||
scheduler_candidate_ranking_order, scheduler_ranking_outcomes, SchedulerRankableCandidate,
|
||||
SchedulerRankingContext, SchedulerRankingMode, SchedulerRankingOutcome,
|
||||
SchedulerTunnelAffinityBucket, RANKING_REASON_CACHED_AFFINITY, RANKING_REASON_CROSS_FORMAT,
|
||||
RANKING_REASON_LOCAL_TUNNEL,
|
||||
apply_scheduler_candidate_ranking, SchedulerRankableCandidate, SchedulerRankingContext,
|
||||
SchedulerRankingMode, SchedulerRankingOutcome, SchedulerTunnelAffinityBucket,
|
||||
RANKING_REASON_CACHED_AFFINITY, RANKING_REASON_CROSS_FORMAT, RANKING_REASON_LOCAL_TUNNEL,
|
||||
};
|
||||
pub use request_candidate::{
|
||||
build_execution_request_candidate_seed, build_local_request_candidate_status_record,
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::cmp::Ordering;
|
||||
|
||||
use super::types::SchedulerRankableCandidate;
|
||||
|
||||
pub fn compare_format_state(
|
||||
pub(super) fn compare_format_state(
|
||||
left: &SchedulerRankableCandidate,
|
||||
right: &SchedulerRankableCandidate,
|
||||
) -> Ordering {
|
||||
|
||||
@@ -4,13 +4,10 @@ mod priority;
|
||||
mod reasons;
|
||||
mod types;
|
||||
|
||||
pub use format::compare_format_state;
|
||||
pub use modes::{apply_load_balance_rotation, compare_rankable_candidates};
|
||||
pub use priority::{
|
||||
candidate_priority_slot, candidates_share_priority_group, compare_candidate_priority_slot,
|
||||
};
|
||||
use modes::{apply_load_balance_rotation, compare_rankable_candidates};
|
||||
use priority::candidate_priority_slot;
|
||||
use reasons::{demoted_by as ranking_demoted_by, promoted_by as ranking_promoted_by};
|
||||
pub use reasons::{
|
||||
demoted_by as ranking_demoted_by, promoted_by as ranking_promoted_by,
|
||||
RANKING_REASON_CACHED_AFFINITY, RANKING_REASON_CROSS_FORMAT, RANKING_REASON_LOCAL_TUNNEL,
|
||||
};
|
||||
pub use types::{
|
||||
@@ -18,7 +15,7 @@ pub use types::{
|
||||
SchedulerRankingOutcome, SchedulerTunnelAffinityBucket,
|
||||
};
|
||||
|
||||
pub fn compare_candidate_identity_for_ranking(
|
||||
fn compare_candidate_identity_for_ranking(
|
||||
left: &SchedulerRankableCandidate,
|
||||
right: &SchedulerRankableCandidate,
|
||||
) -> std::cmp::Ordering {
|
||||
@@ -32,7 +29,7 @@ pub fn compare_candidate_identity_for_ranking(
|
||||
)
|
||||
}
|
||||
|
||||
pub fn scheduler_candidate_ranking_order(
|
||||
fn scheduler_candidate_ranking_order(
|
||||
candidates: &[SchedulerRankableCandidate],
|
||||
context: SchedulerRankingContext,
|
||||
) -> Vec<usize> {
|
||||
@@ -44,7 +41,7 @@ pub fn scheduler_candidate_ranking_order(
|
||||
order
|
||||
}
|
||||
|
||||
pub fn scheduler_ranking_outcomes(
|
||||
fn scheduler_ranking_outcomes(
|
||||
candidates: &[SchedulerRankableCandidate],
|
||||
context: SchedulerRankingContext,
|
||||
) -> Vec<SchedulerRankingOutcome> {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use super::compare_candidate_identity_for_ranking;
|
||||
use super::format::compare_format_state;
|
||||
use super::priority::{candidates_share_priority_group, compare_candidate_priority_slot};
|
||||
use super::types::{SchedulerRankableCandidate, SchedulerRankingContext, SchedulerRankingMode};
|
||||
use super::{
|
||||
candidates_share_priority_group, compare_candidate_identity_for_ranking,
|
||||
compare_candidate_priority_slot, compare_format_state,
|
||||
};
|
||||
|
||||
pub fn compare_rankable_candidates(
|
||||
pub(super) fn compare_rankable_candidates(
|
||||
left: &SchedulerRankableCandidate,
|
||||
right: &SchedulerRankableCandidate,
|
||||
context: SchedulerRankingContext,
|
||||
@@ -79,7 +78,7 @@ fn compare_health(
|
||||
.then_with(|| right.health_score.total_cmp(&left.health_score))
|
||||
}
|
||||
|
||||
pub fn apply_load_balance_rotation(
|
||||
pub(super) fn apply_load_balance_rotation(
|
||||
sorted_indices: &mut [usize],
|
||||
candidates: &[SchedulerRankableCandidate],
|
||||
context: SchedulerRankingContext,
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::SchedulerPriorityMode;
|
||||
|
||||
use super::types::SchedulerRankableCandidate;
|
||||
|
||||
pub fn candidate_priority_slot(
|
||||
pub(super) fn candidate_priority_slot(
|
||||
candidate: &SchedulerRankableCandidate,
|
||||
priority_mode: SchedulerPriorityMode,
|
||||
) -> i32 {
|
||||
@@ -16,7 +16,7 @@ pub fn candidate_priority_slot(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn compare_candidate_priority_slot(
|
||||
pub(super) fn compare_candidate_priority_slot(
|
||||
left: &SchedulerRankableCandidate,
|
||||
right: &SchedulerRankableCandidate,
|
||||
priority_mode: SchedulerPriorityMode,
|
||||
@@ -35,7 +35,7 @@ pub fn compare_candidate_priority_slot(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn candidates_share_priority_group(
|
||||
pub(super) fn candidates_share_priority_group(
|
||||
left: &SchedulerRankableCandidate,
|
||||
right: &SchedulerRankableCandidate,
|
||||
priority_mode: SchedulerPriorityMode,
|
||||
|
||||
Reference in New Issue
Block a user