Use core affinity helpers directly

This commit is contained in:
fawney19
2026-04-27 16:13:24 +08:00
parent 51c3beb614
commit 218e73e324
4 changed files with 10 additions and 13 deletions

View File

@@ -1,6 +1,5 @@
pub(super) use aether_scheduler_core::{ use aether_scheduler_core::{
build_scheduler_affinity_cache_key_for_api_key_id, candidate_affinity_hash, candidate_key, build_scheduler_affinity_cache_key_for_api_key_id, SchedulerAffinityTarget,
matches_affinity_target, SchedulerAffinityTarget,
}; };
use crate::data::auth::GatewayAuthApiKeySnapshot; use crate::data::auth::GatewayAuthApiKeySnapshot;

View File

@@ -1,13 +1,12 @@
use aether_scheduler_core::{ use aether_scheduler_core::{
apply_scheduler_candidate_ranking, effective_provider_key_health_score, apply_scheduler_candidate_ranking, candidate_affinity_hash,
matches_affinity_target, provider_key_health_bucket, effective_provider_key_health_score, matches_affinity_target, provider_key_health_bucket,
requested_capability_priority_for_candidate, SchedulerAffinityTarget, requested_capability_priority_for_candidate, SchedulerAffinityTarget,
SchedulerRankableCandidate, SchedulerRankingContext, SchedulerRankingMode, SchedulerRankableCandidate, SchedulerRankingContext, SchedulerRankingMode,
}; };
use crate::scheduler::config::{SchedulerOrderingConfig, SchedulerSchedulingMode}; use crate::scheduler::config::{SchedulerOrderingConfig, SchedulerSchedulingMode};
use super::affinity::candidate_affinity_hash;
use super::runtime::CandidateRuntimeSelectionSnapshot; use super::runtime::CandidateRuntimeSelectionSnapshot;
use super::SchedulerMinimalCandidateSelectionCandidate; use super::SchedulerMinimalCandidateSelectionCandidate;

View File

@@ -1,8 +1,7 @@
use std::collections::BTreeSet; use std::collections::BTreeSet;
use aether_scheduler_core::SchedulerAffinityTarget; use aether_scheduler_core::{candidate_key, SchedulerAffinityTarget};
use super::affinity::candidate_key;
use super::runtime::{current_candidate_runtime_skip_reason, CandidateRuntimeSelectionSnapshot}; use super::runtime::{current_candidate_runtime_skip_reason, CandidateRuntimeSelectionSnapshot};
use super::{SchedulerMinimalCandidateSelectionCandidate, SchedulerSkippedCandidate}; use super::{SchedulerMinimalCandidateSelectionCandidate, SchedulerSkippedCandidate};

View File

@@ -10,10 +10,10 @@ use aether_data_contracts::repository::candidates::{
RequestCandidateStatus, StoredRequestCandidate, RequestCandidateStatus, StoredRequestCandidate,
}; };
use aether_scheduler_core::{ use aether_scheduler_core::{
apply_scheduler_candidate_ranking, enumerate_minimal_candidate_selection, apply_scheduler_candidate_ranking, candidate_affinity_hash,
EnumerateMinimalCandidateSelectionInput, SchedulerMinimalCandidateSelectionCandidate, enumerate_minimal_candidate_selection, EnumerateMinimalCandidateSelectionInput,
SchedulerPriorityMode, SchedulerRankableCandidate, SchedulerRankingContext, SchedulerMinimalCandidateSelectionCandidate, SchedulerPriorityMode, SchedulerRankableCandidate,
SchedulerRankingMode, SchedulerRankingContext, SchedulerRankingMode,
}; };
use crate::cache::SchedulerAffinityTarget; use crate::cache::SchedulerAffinityTarget;
@@ -24,7 +24,7 @@ use crate::data::candidate_selection::{
use crate::data::GatewayDataState; use crate::data::GatewayDataState;
use crate::{AppState, GatewayError}; use crate::{AppState, GatewayError};
use super::super::affinity::{build_scheduler_affinity_cache_key, candidate_affinity_hash}; use super::super::affinity::build_scheduler_affinity_cache_key;
use super::super::selection::select_minimal_candidate as select_candidate_impl; use super::super::selection::select_minimal_candidate as select_candidate_impl;
use super::support::{sample_auth_snapshot, sample_key, sample_provider, sample_row}; use super::support::{sample_auth_snapshot, sample_key, sample_provider, sample_row};