pub struct StatisticalDataStorage { /* private fields */ }Expand description
Statistical data storage using ZNS for efficient data management
Implementations§
Source§impl StatisticalDataStorage
impl StatisticalDataStorage
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), StatisticalError>
pub fn store_dataset( &mut self, dataset: Dataset, ) -> Result<(), StatisticalError>
pub fn get_dataset(&self, dataset_id: &str) -> Result<Dataset, StatisticalError>
pub fn get_dataset_metadata(&self, dataset_id: &str) -> Option<DatasetMetadata>
pub fn list_datasets(&self) -> Vec<String>
Sourcepub fn store_dataset_data(
&mut self,
dataset: &Dataset,
) -> Result<(), StatisticalError>
pub fn store_dataset_data( &mut self, dataset: &Dataset, ) -> Result<(), StatisticalError>
Persist a dataset through the storage layer.
The dataset is serialised (so the byte representation that would be
written to a ZNS zone is materialised) and cached in the in-memory
dataset_cache. When a real ZnsZoneManager device handle is
available the serialised bytes would be written to the selected zone;
the cache acts as the always-available fallback persistence layer.
Sourcepub fn retrieve_dataset_data(&self, dataset_id: &str) -> Option<&Dataset>
pub fn retrieve_dataset_data(&self, dataset_id: &str) -> Option<&Dataset>
Retrieve a cached dataset by id without consuming the cache entry.
Sourcepub fn store_dataset_to_zone(
&mut self,
dataset_id: &str,
zone_id: &str,
) -> Result<(), StatisticalError>
pub fn store_dataset_to_zone( &mut self, dataset_id: &str, zone_id: &str, ) -> Result<(), StatisticalError>
Explicitly store a cached dataset’s metadata into a named zone.
The dataset must already have been persisted via store_dataset_data
(so it is present in the in-memory cache). Its metadata is then
registered with the requested zone, mirroring what a ZNS write into
that zone would record.
Sourcepub fn attach_zns_manager(&mut self, manager: Arc<Mutex<ZnsZoneManager>>)
pub fn attach_zns_manager(&mut self, manager: Arc<Mutex<ZnsZoneManager>>)
Attach a real ZNS zone manager so dataset persistence can delegate to the hardware-backed zone device. When unset, the in-memory cache is used.
Sourcepub fn sample_dataset(&self) -> Result<Dataset, StatisticalError>
pub fn sample_dataset(&self) -> Result<Dataset, StatisticalError>
Returns a small built-in sample dataset (3 rows × 5 columns) useful for
demos, tests, and as a fallback when no real dataset is registered. This
is backed by get_dataset_data_legacy.
Auto Trait Implementations§
impl Freeze for StatisticalDataStorage
impl RefUnwindSafe for StatisticalDataStorage
impl Send for StatisticalDataStorage
impl Sync for StatisticalDataStorage
impl Unpin for StatisticalDataStorage
impl UnsafeUnpin for StatisticalDataStorage
impl UnwindSafe for StatisticalDataStorage
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more