pub struct MeshServerHandler {
pub state: ClusterState,
pub stores: Arc<StateStores>,
pub sync_manager: Arc<MeshSyncManager>,
pub self_name: String,
/* private fields */
}Expand description
MeshServerHandler It is the handler for the mesh server, which is responsible for the node management. Includes some basic node management logic, like shutdown, node discovery(TODO), node status update(TODO), etc.
Fields§
§state: ClusterState§stores: Arc<StateStores>§sync_manager: Arc<MeshSyncManager>§self_name: StringImplementations§
Source§impl MeshServerHandler
impl MeshServerHandler
Sourcepub fn partition_detector(&self) -> Option<&Arc<PartitionDetector>>
pub fn partition_detector(&self) -> Option<&Arc<PartitionDetector>>
Get partition detector
Sourcepub fn state_machine(&self) -> Option<&Arc<NodeStateMachine>>
pub fn state_machine(&self) -> Option<&Arc<NodeStateMachine>>
Get state machine
Sourcepub fn should_serve(&self) -> bool
pub fn should_serve(&self) -> bool
Check if we should serve (have quorum)
Sourcepub fn start_rate_limit_task(&self, window_seconds: u64)
pub fn start_rate_limit_task(&self, window_seconds: u64)
Start rate limit window reset task This task will periodically reset the global rate limit counter
Sourcepub fn stop_rate_limit_task(&self)
pub fn stop_rate_limit_task(&self)
Stop rate limit window reset task
Sourcepub async fn graceful_shutdown(&self) -> Result<()>
pub async fn graceful_shutdown(&self) -> Result<()>
Graceful shutdown: broadcast LEAVING status to all alive nodes, wait for propagation, then shutdown
pub fn write_data(&self, key: String, value: Vec<u8>) -> Result<()>
pub fn read_data(&self, key: String) -> Option<Vec<u8>>
Sourcepub fn get_operation_log(&self) -> OperationLog
pub fn get_operation_log(&self) -> OperationLog
Get operation log of the app store for synchronization Returns an operation log that can be merged into other nodes
Sourcepub fn sync_app_from_log(&self, log: &OperationLog)
pub fn sync_app_from_log(&self, log: &OperationLog)
Sync app store data from an operation log (for testing and manual sync) This will be replaced by automatic sync stream in the future
Auto Trait Implementations§
impl !Freeze for MeshServerHandler
impl !RefUnwindSafe for MeshServerHandler
impl Send for MeshServerHandler
impl Sync for MeshServerHandler
impl Unpin for MeshServerHandler
impl UnsafeUnpin for MeshServerHandler
impl !UnwindSafe for MeshServerHandler
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request