pub struct WarmStore {
dir: PathBuf,
index: RwLock<BTreeMap<(u64, u32), Vec<i64>>>,
zone_map: RwLock<ZoneManifest>,
chunk_size: usize,
}Expand description
Warm storage backend using partitioned files.
Fields§
§dir: PathBuf§index: RwLock<BTreeMap<(u64, u32), Vec<i64>>>In-memory index: (entity_id, space_id) → sorted timestamps in this tier.
zone_map: RwLock<ZoneManifest>Zone map manifest for chunk-level temporal pruning.
chunk_size: usizeImplementations§
Source§impl WarmStore
impl WarmStore
Sourcepub fn open(dir: &Path) -> Result<Self, StorageError>
pub fn open(dir: &Path) -> Result<Self, StorageError>
Open or create a warm store at the given directory.
fn load_zone_manifest(dir: &Path) -> Result<ZoneManifest, StorageError>
fn persist_zone_manifest(&self) -> Result<(), StorageError>
Sourcepub fn write_batch(
&self,
space_id: u32,
points: &[TemporalPoint],
) -> Result<(), StorageError>
pub fn write_batch( &self, space_id: u32, points: &[TemporalPoint], ) -> Result<(), StorageError>
Write a batch of points to warm storage.
Points are grouped by (entity_id, space_id) and written to chunk files.
Sourcefn read_entity_chunks(
&self,
entity_id: u64,
space_id: u32,
) -> Result<Vec<TemporalPoint>, StorageError>
fn read_entity_chunks( &self, entity_id: u64, space_id: u32, ) -> Result<Vec<TemporalPoint>, StorageError>
Read all points for an entity+space from chunk files.
Sourcefn read_entity_chunks_filtered(
&self,
entity_id: u64,
space_id: u32,
start: i64,
end: i64,
) -> Result<Vec<TemporalPoint>, StorageError>
fn read_entity_chunks_filtered( &self, entity_id: u64, space_id: u32, start: i64, end: i64, ) -> Result<Vec<TemporalPoint>, StorageError>
Read entity chunks filtered by zone map — only opens chunks whose [min_ts, max_ts] overlaps with [start, end]. Falls back to full read if no zone map data exists.
fn entity_dir(&self, entity_id: u64) -> PathBuf
fn load_index(&self) -> Result<(), StorageError>
Trait Implementations§
Source§impl StorageBackend for WarmStore
impl StorageBackend for WarmStore
Source§fn get(
&self,
entity_id: u64,
space_id: u32,
timestamp: i64,
) -> Result<Option<TemporalPoint>, StorageError>
fn get( &self, entity_id: u64, space_id: u32, timestamp: i64, ) -> Result<Option<TemporalPoint>, StorageError>
Retrieve a single point by entity, space, and timestamp.
Source§fn put(&self, space_id: u32, point: &TemporalPoint) -> Result<(), StorageError>
fn put(&self, space_id: u32, point: &TemporalPoint) -> Result<(), StorageError>
Store a temporal point.
Auto Trait Implementations§
impl !Freeze for WarmStore
impl !RefUnwindSafe for WarmStore
impl Send for WarmStore
impl Sync for WarmStore
impl Unpin for WarmStore
impl UnwindSafe for WarmStore
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