pub struct ServerRuntime { /* private fields */ }Expand description
Standalone server runtime.
Implementations§
Source§impl ServerRuntime
impl ServerRuntime
Sourcepub fn new(config: ServerConfig) -> Result<Self, ServerConfigError>
pub fn new(config: ServerConfig) -> Result<Self, ServerConfigError>
Validate config and construct a runtime.
Sourcepub fn with_cluster_status_provider(
self,
cluster_status: Arc<dyn ClusterStatusProvider>,
) -> Self
pub fn with_cluster_status_provider( self, cluster_status: Arc<dyn ClusterStatusProvider>, ) -> Self
Override the cluster-status provider.
This is the W0 seam used by tests and later by the member-role grid host.
Sourcepub fn with_observability_model(
self,
observability: ServerObservabilityModel,
) -> Self
pub fn with_observability_model( self, observability: ServerObservabilityModel, ) -> Self
Override additional read-only observability signals.
Sourcepub fn start(self) -> Self
pub fn start(self) -> Self
Start storage, cluster membership, listeners, and background services.
Sourcepub fn health(&self) -> ServerHealth
pub fn health(&self) -> ServerHealth
Return liveness.
Sourcepub fn ready(&self) -> ServerReadiness
pub fn ready(&self) -> ServerReadiness
Return readiness.
Sourcepub fn is_draining(&self) -> bool
pub fn is_draining(&self) -> bool
Return whether the runtime is currently draining.
Sourcepub fn begin_request(&mut self) -> bool
pub fn begin_request(&mut self) -> bool
Begin one in-flight request.
Sourcepub fn finish_request(&mut self)
pub fn finish_request(&mut self)
Complete one in-flight request.
Sourcepub fn client_surface_ready(&self) -> bool
pub fn client_surface_ready(&self) -> bool
Return whether the external client surface is accepting work.
Sourcepub fn begin_client_subscription(&self) -> bool
pub fn begin_client_subscription(&self) -> bool
Begin a modeled client subscription stream.
Sourcepub fn client_active_subscriptions(&self) -> u64
pub fn client_active_subscriptions(&self) -> u64
Return active modeled client subscription streams.
Sourcepub fn client_surface_drain(&self) -> Option<ClientSurfaceDrain>
pub fn client_surface_drain(&self) -> Option<ClientSurfaceDrain>
Return the last client-surface drain result, if the surface is enabled.
Sourcepub fn redis_surface_ready(&self) -> bool
pub fn redis_surface_ready(&self) -> bool
Return whether the optional Redis RESP surface is accepting work.
Sourcepub fn begin_redis_connection(&mut self) -> bool
pub fn begin_redis_connection(&mut self) -> bool
Begin a modeled RESP connection.
Sourcepub fn finish_redis_connection(&mut self)
pub fn finish_redis_connection(&mut self)
Finish a modeled RESP connection.
Sourcepub fn redis_active_connections(&self) -> u64
pub fn redis_active_connections(&self) -> u64
Return active modeled RESP connections.
Sourcepub fn redis_surface_drain(&self) -> Option<RedisSurfaceDrain>
pub fn redis_surface_drain(&self) -> Option<RedisSurfaceDrain>
Return the last Redis RESP surface drain result, if the surface is enabled.
Sourcepub fn redis_listener_addr(&self) -> Option<SocketAddr>
pub fn redis_listener_addr(&self) -> Option<SocketAddr>
Return the Redis RESP bind address when that optional listener is enabled.
Sourcepub fn redis_resp_server(
&self,
) -> Result<Option<RedisRespServer>, RedisServeError>
pub fn redis_resp_server( &self, ) -> Result<Option<RedisRespServer>, RedisServeError>
Build a Redis RESP executor using this runtime’s shared client-surface state.
Sourcepub fn redis_tls_acceptor(
&self,
) -> Result<Option<RedisTlsAcceptor>, RedisTlsError>
pub fn redis_tls_acceptor( &self, ) -> Result<Option<RedisTlsAcceptor>, RedisTlsError>
Build the optional Redis TLS acceptor when rediss:// is enabled.
Sourcepub fn client_dispatch_state(&self) -> Option<Arc<ClientSurfaceState>>
pub fn client_dispatch_state(&self) -> Option<Arc<ClientSurfaceState>>
Return the shared verified-dispatch state used by HC/1, RESP, and HC/2.
Sourcepub fn diagnostic_reset_enabled(&self) -> bool
pub fn diagnostic_reset_enabled(&self) -> bool
Return whether the local-only destructive diagnostic reset is enabled.
Sourcepub fn diagnostic_reset_targets(
&self,
) -> (HydraCache, Option<Arc<ClientSurfaceState>>)
pub fn diagnostic_reset_targets( &self, ) -> (HydraCache, Option<Arc<ClientSurfaceState>>)
Clone the owners cleared by the internal diagnostic reset route.
Sourcepub fn begin_drain(&mut self)
pub fn begin_drain(&mut self)
Stop accepting new work and enter the draining state.
Sourcepub fn request_admin_drain(&mut self) -> DrainOutcome
pub fn request_admin_drain(&mut self) -> DrainOutcome
Accept an operator/admin drain request without stopping the daemon process.
Sourcepub fn graceful_shutdown(&mut self) -> DrainOutcome
pub fn graceful_shutdown(&mut self) -> DrainOutcome
Gracefully stop accepting, drain, flush, and stop services.
Sourcepub fn shutdown(&mut self) -> DrainOutcome
pub fn shutdown(&mut self) -> DrainOutcome
Backward-compatible alias for graceful shutdown.
Sourcepub fn admin_status(&self) -> ServerAdminStatus
pub fn admin_status(&self) -> ServerAdminStatus
Return admin/operator status derived from the runtime model.
Sourcepub fn raft_compaction_status(
&self,
) -> Result<RaftCompactionStatus, RaftCompactionError>
pub fn raft_compaction_status( &self, ) -> Result<RaftCompactionStatus, RaftCompactionError>
Return current disk-backed Raft compaction progress without mutating it.
Sourcepub fn request_raft_compaction(
&self,
) -> Result<RaftCompactionStatus, ServerAdminActionError>
pub fn request_raft_compaction( &self, ) -> Result<RaftCompactionStatus, ServerAdminActionError>
Explicitly compact the durable Raft log at current applied progress.
Sourcepub fn metrics_registry(&self) -> HydraCacheRegistry
pub fn metrics_registry(&self) -> HydraCacheRegistry
Build a metrics registry snapshot for the admin surface.
Sourcepub fn cluster_overview(&self) -> ClusterOverview
pub fn cluster_overview(&self) -> ClusterOverview
Build a read-only Management Center cluster overview.
Sourcepub fn request_reshard(
&self,
) -> Result<ServerAdminAction, ServerAdminActionError>
pub fn request_reshard( &self, ) -> Result<ServerAdminAction, ServerAdminActionError>
Request an online reshard through the current runtime model.
Sourcepub fn request_backup(
&self,
) -> Result<ServerAdminAction, ServerAdminActionError>
pub fn request_backup( &self, ) -> Result<ServerAdminAction, ServerAdminActionError>
Request a backup through the current runtime model.
Sourcepub fn cache(&self) -> &HydraCache
pub fn cache(&self) -> &HydraCache
Return cache handle used by embedded tests/adapters.
Sourcepub fn config(&self) -> &ServerConfig
pub fn config(&self) -> &ServerConfig
Return the runtime config.
Trait Implementations§
Source§impl Clone for ServerRuntime
impl Clone for ServerRuntime
Source§fn clone(&self) -> ServerRuntime
fn clone(&self) -> ServerRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ServerRuntime
impl !UnwindSafe for ServerRuntime
impl Freeze for ServerRuntime
impl Send for ServerRuntime
impl Sync for ServerRuntime
impl Unpin for ServerRuntime
impl UnsafeUnpin for ServerRuntime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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>
T in a tonic::Request