pub struct ShardManager { /* private fields */ }
Expand description
Shard manager for distributed RDF storage
Implementations§
Source§impl ShardManager
impl ShardManager
Sourcepub fn new(config: ShardingConfig, strategy: ShardingStrategy) -> Self
pub fn new(config: ShardingConfig, strategy: ShardingStrategy) -> Self
Create a new shard manager
Sourcepub fn get_shard_for_triple(&self, triple: &Triple) -> ShardId
pub fn get_shard_for_triple(&self, triple: &Triple) -> ShardId
Determine which shard a triple belongs to
Sourcepub fn insert_triple(&self, triple: Triple) -> Result<()>
pub fn insert_triple(&self, triple: Triple) -> Result<()>
Insert a triple into the appropriate shard
Sourcepub fn query_triples(
&self,
subject: Option<&Subject>,
predicate: Option<&Predicate>,
object: Option<&Object>,
) -> Result<Vec<Triple>>
pub fn query_triples( &self, subject: Option<&Subject>, predicate: Option<&Predicate>, object: Option<&Object>, ) -> Result<Vec<Triple>>
Query triples from shards
Sourcepub fn needs_rebalancing(&self) -> bool
pub fn needs_rebalancing(&self) -> bool
Check if rebalancing is needed
Sourcepub fn plan_rebalancing(&self) -> Vec<Migration>
pub fn plan_rebalancing(&self) -> Vec<Migration>
Plan rebalancing operations
Sourcepub async fn execute_migration(&self, migration: &Migration) -> Result<()>
pub async fn execute_migration(&self, migration: &Migration) -> Result<()>
Execute a migration
Sourcepub fn get_shard_statistics(&self) -> HashMap<ShardId, ShardStatistics>
pub fn get_shard_statistics(&self) -> HashMap<ShardId, ShardStatistics>
Get shard statistics
Sourcepub fn get_load_distribution(&self) -> HashMap<ShardId, f64>
pub fn get_load_distribution(&self) -> HashMap<ShardId, f64>
Get load distribution across shards
Auto Trait Implementations§
impl Freeze for ShardManager
impl !RefUnwindSafe for ShardManager
impl Send for ShardManager
impl Sync for ShardManager
impl Unpin for ShardManager
impl !UnwindSafe for ShardManager
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