pub struct SessionMigrate { /* private fields */ }Expand description
Session Migrate Manager
Implementations§
Source§impl SessionMigrate
impl SessionMigrate
Sourcepub fn with_max_sessions(self, max: usize) -> Self
pub fn with_max_sessions(self, max: usize) -> Self
Configure max sessions
Sourcepub fn with_backend_template(self, template: BackendConfig) -> Self
pub fn with_backend_template(self, template: BackendConfig) -> Self
Attach a backend-connection template so session migration can
run SET, PREPARE, and CREATE TEMP TABLE against the target.
Sourcepub async fn register_endpoint(&self, node_id: NodeId, endpoint: NodeEndpoint)
pub async fn register_endpoint(&self, node_id: NodeId, endpoint: NodeEndpoint)
Register an endpoint for a node.
Sourcepub fn with_temp_table_migration(self, enabled: bool) -> Self
pub fn with_temp_table_migration(self, enabled: bool) -> Self
Enable/disable temp table migration
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable session migration
Sourcepub async fn register_session(&self, state: SessionState) -> Result<()>
pub async fn register_session(&self, state: SessionState) -> Result<()>
Register a new session
Sourcepub async fn set_parameter(
&self,
session_id: Uuid,
name: String,
value: String,
) -> Result<()>
pub async fn set_parameter( &self, session_id: Uuid, name: String, value: String, ) -> Result<()>
Update session parameter
Sourcepub async fn add_prepared_statement(
&self,
session_id: Uuid,
info: PreparedStatementInfo,
) -> Result<()>
pub async fn add_prepared_statement( &self, session_id: Uuid, info: PreparedStatementInfo, ) -> Result<()>
Add prepared statement to session
Sourcepub async fn remove_prepared_statement(
&self,
session_id: Uuid,
name: &str,
) -> Result<()>
pub async fn remove_prepared_statement( &self, session_id: Uuid, name: &str, ) -> Result<()>
Remove prepared statement from session
Sourcepub async fn add_temp_table(
&self,
session_id: Uuid,
info: TempTableInfo,
) -> Result<()>
pub async fn add_temp_table( &self, session_id: Uuid, info: TempTableInfo, ) -> Result<()>
Add temp table to session
Sourcepub async fn get_session(&self, session_id: &Uuid) -> Option<SessionState>
pub async fn get_session(&self, session_id: &Uuid) -> Option<SessionState>
Get session state
Sourcepub async fn close_session(&self, session_id: &Uuid)
pub async fn close_session(&self, session_id: &Uuid)
Close session
Sourcepub async fn migrate_session(
&self,
session_id: Uuid,
target_node: NodeId,
) -> Result<SessionMigrateResult>
pub async fn migrate_session( &self, session_id: Uuid, target_node: NodeId, ) -> Result<SessionMigrateResult>
Migrate session to a new node
Sourcepub async fn stats(&self) -> SessionMigrateStats
pub async fn stats(&self) -> SessionMigrateStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionMigrate
impl !RefUnwindSafe for SessionMigrate
impl Send for SessionMigrate
impl Sync for SessionMigrate
impl Unpin for SessionMigrate
impl UnsafeUnpin for SessionMigrate
impl !UnwindSafe for SessionMigrate
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