pub struct ClusterService { /* private fields */ }Expand description
Native coordinator cluster service.
Wraps ruvector’s ClusterManager and syncs discovered nodes
into the kernel’s universal ClusterMembership tracker.
Implementations§
Source§impl ClusterService
impl ClusterService
Sourcepub fn new(
config: ClusterNetworkConfig,
node_id: String,
discovery: Box<dyn DiscoveryService>,
membership: Arc<ClusterMembership>,
) -> Result<Self, ClusterError>
pub fn new( config: ClusterNetworkConfig, node_id: String, discovery: Box<dyn DiscoveryService>, membership: Arc<ClusterMembership>, ) -> Result<Self, ClusterError>
Create a new cluster service.
membership is the kernel’s universal peer tracker that
all platforms share. The ClusterService syncs ruvector
native node state into it.
Sourcepub fn with_defaults(
node_id: String,
membership: Arc<ClusterMembership>,
) -> Result<Self, ClusterError>
pub fn with_defaults( node_id: String, membership: Arc<ClusterMembership>, ) -> Result<Self, ClusterError>
Create with default config and static (empty) discovery.
Sourcepub fn sync_to_membership(&self)
pub fn sync_to_membership(&self)
Sync ruvector’s native node list into the kernel’s
ClusterMembership tracker.
Converts ruvector ClusterNode entries into kernel
PeerNode entries, mapping SocketAddr → String
and NodeStatus → NodeState.
Sourcepub fn config(&self) -> &ClusterNetworkConfig
pub fn config(&self) -> &ClusterNetworkConfig
Get the cluster network configuration.
Sourcepub fn manager(&self) -> &ClusterManager
pub fn manager(&self) -> &ClusterManager
Get the underlying cluster manager (for advanced operations).
Sourcepub fn stats(&self) -> ClusterStats
pub fn stats(&self) -> ClusterStats
Get cluster statistics.
Sourcepub fn list_shards(&self) -> Vec<ShardInfo>
pub fn list_shards(&self) -> Vec<ShardInfo>
List all shards.
Sourcepub fn list_nodes(&self) -> Vec<ClusterNode>
pub fn list_nodes(&self) -> Vec<ClusterNode>
List all ruvector nodes.
Trait Implementations§
Source§impl SystemService for ClusterService
impl SystemService for ClusterService
Source§fn service_type(&self) -> ServiceType
fn service_type(&self) -> ServiceType
Service type category.
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the service.
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the service.
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a health check.
Auto Trait Implementations§
impl Freeze for ClusterService
impl !RefUnwindSafe for ClusterService
impl Send for ClusterService
impl Sync for ClusterService
impl Unpin for ClusterService
impl UnsafeUnpin for ClusterService
impl !UnwindSafe for ClusterService
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