pub struct SystemBootstrap;Expand description
Staged system initialization with static stability.
Follows the AWS data plane / control plane separation pattern:
Stage 1: Initialize SystemMetadataStore from local storage
Stage 2: Replay _system/* streams → populate in-memory caches
Stage 3: If empty, run first-boot bootstrap (create default tenant)
Stage 4: Return SystemRepositories → start accepting traffic§Static Stability
After bootstrap, all metadata reads go through in-memory caches (DashMap). If a system stream write fails, the error is logged but does NOT block the data plane. User event ingestion and queries continue with cached metadata until the system store recovers.
Implementations§
Source§impl SystemBootstrap
impl SystemBootstrap
Sourcepub async fn initialize(
system_data_dir: PathBuf,
bootstrap_tenant: Option<String>,
) -> Result<SystemRepositories>
pub async fn initialize( system_data_dir: PathBuf, bootstrap_tenant: Option<String>, ) -> Result<SystemRepositories>
Sourcepub async fn try_initialize(
system_data_dir: Option<PathBuf>,
bootstrap_tenant: Option<String>,
) -> Option<SystemRepositories>
pub async fn try_initialize( system_data_dir: Option<PathBuf>, bootstrap_tenant: Option<String>, ) -> Option<SystemRepositories>
Try to initialize system repositories, falling back to None if the system data directory is not configured.
This implements the backward-compatibility path: if no system_data_dir is set, the system continues with in-memory repositories.
Auto Trait Implementations§
impl Freeze for SystemBootstrap
impl RefUnwindSafe for SystemBootstrap
impl Send for SystemBootstrap
impl Sync for SystemBootstrap
impl Unpin for SystemBootstrap
impl UnwindSafe for SystemBootstrap
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