pub struct MigrationManager { /* private fields */ }Expand description
Tracks all active migrations for a node.
Implementations§
Source§impl MigrationManager
impl MigrationManager
Sourcepub fn is_migrating(&self, slot: u16) -> bool
pub fn is_migrating(&self, slot: u16) -> bool
Check if a slot is currently migrating out.
Sourcepub fn is_importing(&self, slot: u16) -> bool
pub fn is_importing(&self, slot: u16) -> bool
Check if a slot is currently being imported.
Sourcepub fn get_outgoing(&self, slot: u16) -> Option<&Migration>
pub fn get_outgoing(&self, slot: u16) -> Option<&Migration>
Get migration info for a slot that’s migrating out.
Sourcepub fn get_incoming(&self, slot: u16) -> Option<&Migration>
pub fn get_incoming(&self, slot: u16) -> Option<&Migration>
Get migration info for a slot that’s being imported.
Sourcepub fn start_import(
&mut self,
slot: u16,
source: NodeId,
local_id: NodeId,
) -> Result<&Migration, MigrationError>
pub fn start_import( &mut self, slot: u16, source: NodeId, local_id: NodeId, ) -> Result<&Migration, MigrationError>
Start importing a slot from another node.
Returns error if slot is already involved in a migration.
Sourcepub fn start_migrate(
&mut self,
slot: u16,
local_id: NodeId,
target: NodeId,
) -> Result<&Migration, MigrationError>
pub fn start_migrate( &mut self, slot: u16, local_id: NodeId, target: NodeId, ) -> Result<&Migration, MigrationError>
Start migrating a slot to another node.
Returns error if slot is already involved in a migration.
Sourcepub fn key_migrated(&mut self, slot: u16, key: Vec<u8>)
pub fn key_migrated(&mut self, slot: u16, key: Vec<u8>)
Record that a key has been migrated.
Sourcepub fn is_key_migrated(&self, slot: u16, key: &[u8]) -> bool
pub fn is_key_migrated(&self, slot: u16, key: &[u8]) -> bool
Check if a specific key has been migrated.
Sourcepub fn complete_migration(&mut self, slot: u16) -> Option<Migration>
pub fn complete_migration(&mut self, slot: u16) -> Option<Migration>
Complete a migration and clean up state.
Sourcepub fn abort_migration(&mut self, slot: u16) -> Option<Migration>
pub fn abort_migration(&mut self, slot: u16) -> Option<Migration>
Abort a migration and clean up state.
Sourcepub fn outgoing_migrations(&self) -> impl Iterator<Item = &Migration>
pub fn outgoing_migrations(&self) -> impl Iterator<Item = &Migration>
Get all active outgoing migrations.
Sourcepub fn incoming_migrations(&self) -> impl Iterator<Item = &Migration>
pub fn incoming_migrations(&self) -> impl Iterator<Item = &Migration>
Get all active incoming migrations.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get total number of active migrations.
Trait Implementations§
Source§impl Debug for MigrationManager
impl Debug for MigrationManager
Source§impl Default for MigrationManager
impl Default for MigrationManager
Source§fn default() -> MigrationManager
fn default() -> MigrationManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MigrationManager
impl RefUnwindSafe for MigrationManager
impl Send for MigrationManager
impl Sync for MigrationManager
impl Unpin for MigrationManager
impl UnsafeUnpin for MigrationManager
impl UnwindSafe for MigrationManager
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