pub struct QueryRouter { /* private fields */ }Expand description
Query router for distributed operations
Implementations§
Source§impl QueryRouter
impl QueryRouter
Sourcepub fn new(
config: RouterConfig,
shard_manager: ShardManager,
cluster: ClusterCoordinator,
local_node_id: String,
) -> Self
pub fn new( config: RouterConfig, shard_manager: ShardManager, cluster: ClusterCoordinator, local_node_id: String, ) -> Self
Create a new query router
Sourcepub fn plan_point_query(&self, vector_id: &str) -> QueryPlan
pub fn plan_point_query(&self, vector_id: &str) -> QueryPlan
Plan a point query (single vector lookup)
Sourcepub fn plan_scatter_query(&self) -> QueryPlan
pub fn plan_scatter_query(&self) -> QueryPlan
Plan a scatter query (similarity search across all shards)
Sourcepub fn plan_batch_query(&self, vector_ids: &[String]) -> QueryPlan
pub fn plan_batch_query(&self, vector_ids: &[String]) -> QueryPlan
Plan a batch query (multiple vectors)
Sourcepub fn merge_similarity_results<T: Clone>(
&self,
shard_results: Vec<ShardResult<T>>,
top_k: usize,
score_fn: impl Fn(&T) -> f32,
) -> MergedResults<T>
pub fn merge_similarity_results<T: Clone>( &self, shard_results: Vec<ShardResult<T>>, top_k: usize, score_fn: impl Fn(&T) -> f32, ) -> MergedResults<T>
Merge results from multiple shards for similarity search
Sourcepub fn get_stats(&self) -> RouterStats
pub fn get_stats(&self) -> RouterStats
Get routing statistics
Sourcepub fn plan_scatter_query_with_consistency(
&self,
consistency: ReadConsistency,
staleness_config: Option<StalenessConfig>,
) -> QueryPlan
pub fn plan_scatter_query_with_consistency( &self, consistency: ReadConsistency, staleness_config: Option<StalenessConfig>, ) -> QueryPlan
Plan a scatter query with consistency requirements
Sourcepub fn consistency_to_strategy(
&self,
consistency: ReadConsistency,
) -> RoutingStrategy
pub fn consistency_to_strategy( &self, consistency: ReadConsistency, ) -> RoutingStrategy
Convert ReadConsistency to effective RoutingStrategy
Auto Trait Implementations§
impl !Freeze for QueryRouter
impl !RefUnwindSafe for QueryRouter
impl Send for QueryRouter
impl Sync for QueryRouter
impl Unpin for QueryRouter
impl UnsafeUnpin for QueryRouter
impl !UnwindSafe for QueryRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more