pub struct ShardRouter { /* private fields */ }Expand description
Routes queries to the correct shard
Implementations§
Source§impl ShardRouter
impl ShardRouter
Sourcepub fn get_shard(&self, key: &str) -> u32
pub fn get_shard(&self, key: &str) -> u32
Get the shard ID for a key using jump consistent hashing
Sourcepub fn get_shard_for_vector(&self, vector_id: &str) -> u32
pub fn get_shard_for_vector(&self, vector_id: &str) -> u32
Get shard ID for a vector ID
Sourcepub fn get_shards_for_range(&self, _start: &str, _end: &str) -> Vec<u32>
pub fn get_shards_for_range(&self, _start: &str, _end: &str) -> Vec<u32>
Get shard IDs for a range query (may span multiple shards)
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear the routing cache
Sourcepub fn cache_stats(&self) -> CacheStats
pub fn cache_stats(&self) -> CacheStats
Get cache statistics
Auto Trait Implementations§
impl Freeze for ShardRouter
impl !RefUnwindSafe for ShardRouter
impl Send for ShardRouter
impl Sync for ShardRouter
impl Unpin for ShardRouter
impl !UnwindSafe for ShardRouter
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