pub struct GraphReplication { /* private fields */ }Expand description
Graph replication manager
Implementations§
Source§impl GraphReplication
impl GraphReplication
Sourcepub fn new(config: GraphReplicationConfig) -> Self
pub fn new(config: GraphReplicationConfig) -> Self
Create a new graph replication manager
Sourcepub fn initialize_shard_replication(
&self,
shard_id: ShardId,
primary_node: String,
replica_nodes: Vec<String>,
) -> Result<()>
pub fn initialize_shard_replication( &self, shard_id: ShardId, primary_node: String, replica_nodes: Vec<String>, ) -> Result<()>
Initialize replication for a shard
Sourcepub async fn replicate_node_add(
&self,
shard_id: ShardId,
node: NodeData,
) -> Result<()>
pub async fn replicate_node_add( &self, shard_id: ShardId, node: NodeData, ) -> Result<()>
Replicate a node addition
Sourcepub async fn replicate_edge_add(
&self,
shard_id: ShardId,
edge: EdgeData,
) -> Result<()>
pub async fn replicate_edge_add( &self, shard_id: ShardId, edge: EdgeData, ) -> Result<()>
Replicate an edge addition
Sourcepub async fn replicate_node_delete(
&self,
shard_id: ShardId,
node_id: NodeId,
) -> Result<()>
pub async fn replicate_node_delete( &self, shard_id: ShardId, node_id: NodeId, ) -> Result<()>
Replicate a node deletion
Sourcepub async fn replicate_edge_delete(
&self,
shard_id: ShardId,
edge_id: String,
) -> Result<()>
pub async fn replicate_edge_delete( &self, shard_id: ShardId, edge_id: String, ) -> Result<()>
Replicate an edge deletion
Sourcepub fn get_replica_set(&self, shard_id: ShardId) -> Option<Arc<ReplicaSet>>
pub fn get_replica_set(&self, shard_id: ShardId) -> Option<Arc<ReplicaSet>>
Get replica set for a shard
Sourcepub fn get_sync_manager(&self, shard_id: ShardId) -> Option<Arc<SyncManager>>
pub fn get_sync_manager(&self, shard_id: ShardId) -> Option<Arc<SyncManager>>
Get sync manager for a shard
Sourcepub fn get_stats(&self) -> ReplicationStats
pub fn get_stats(&self) -> ReplicationStats
Get replication statistics
Sourcepub async fn health_check(&self) -> HashMap<ShardId, ReplicaHealth>
pub async fn health_check(&self) -> HashMap<ShardId, ReplicaHealth>
Perform health check on all replicas
Sourcepub fn config(&self) -> &GraphReplicationConfig
pub fn config(&self) -> &GraphReplicationConfig
Get configuration
Auto Trait Implementations§
impl Freeze for GraphReplication
impl !RefUnwindSafe for GraphReplication
impl Send for GraphReplication
impl Sync for GraphReplication
impl Unpin for GraphReplication
impl !UnwindSafe for GraphReplication
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request