Skip to main content

TieredStore

Trait TieredStore 

Source
pub trait TieredStore: Send + Sync {
    // Required methods
    fn estimated_ram_bytes(&self) -> usize;
    fn tier(&self) -> StorageTier;
    fn persist(&self, path: &Path) -> Result<()>;
    fn open_mmap(&self, path: &Path) -> Result<()>;
    fn reload_to_ram(&self) -> Result<()>;
}
πŸ‘ŽDeprecated since 0.5.42:

Use the Section trait (with swap_to_mmap / reload_to_ram) and MemoryConsumer instead. This trait was never implemented anywhere; it will be removed in 0.6.0.

Expand description

A storage subsystem that can transition between RAM and disk tiers.

Deprecated (Phase 8c, 0.5.42): the crate::storage::section::Section trait subsumed this trait’s responsibilities β€” its swap_to_mmap and reload_to_ram methods cover the same lifecycle, and every wired section type (LPG, RDF, Vector, Ring, Compact) implements Section, not TieredStore. This trait was never implemented anywhere; it is kept for one release as a no-op to avoid breaking downstream callers who may have prepared their own impls. Migrate to Section for new code; the standalone trait will be removed in 0.6.0.

Implementors manage their own data layout for both tiers. The BufferManager triggers transitions via the MemoryConsumer trait; this trait provides the mechanics of persisting, mapping, and reloading data.

Β§Crate boundaries

This trait lives in grafeo-common so it can be referenced by both grafeo-core (section serializers) and grafeo-engine (orchestration). Implementations that need filesystem I/O (mmap, file creation) should live in grafeo-engine, not grafeo-core.

Required MethodsΒ§

Source

fn estimated_ram_bytes(&self) -> usize

πŸ‘ŽDeprecated since 0.5.42:

Use the Section trait (with swap_to_mmap / reload_to_ram) and MemoryConsumer instead. This trait was never implemented anywhere; it will be removed in 0.6.0.

Estimated RAM footprint in bytes if built entirely in memory.

Returns 0 when the structure is on disk or uninitialized.

Source

fn tier(&self) -> StorageTier

πŸ‘ŽDeprecated since 0.5.42:

Use the Section trait (with swap_to_mmap / reload_to_ram) and MemoryConsumer instead. This trait was never implemented anywhere; it will be removed in 0.6.0.

Current storage tier.

Source

fn persist(&self, path: &Path) -> Result<()>

πŸ‘ŽDeprecated since 0.5.42:

Use the Section trait (with swap_to_mmap / reload_to_ram) and MemoryConsumer instead. This trait was never implemented anywhere; it will be removed in 0.6.0.

Serializes in-memory state to the given path.

After this call, open_mmap can serve reads from the file. This does NOT free RAM: the caller should drop the in-memory representation separately (typically via the MemoryConsumer::spill path).

Β§Errors

Returns an error if serialization or I/O fails.

Source

fn open_mmap(&self, path: &Path) -> Result<()>

πŸ‘ŽDeprecated since 0.5.42:

Use the Section trait (with swap_to_mmap / reload_to_ram) and MemoryConsumer instead. This trait was never implemented anywhere; it will be removed in 0.6.0.

Switches to mmap-backed reads from a previously persisted file.

Drops the in-memory data and serves reads through the OS page cache. The tier transitions to StorageTier::OnDisk.

Β§Errors

Returns an error if the file cannot be memory-mapped.

Source

fn reload_to_ram(&self) -> Result<()>

πŸ‘ŽDeprecated since 0.5.42:

Use the Section trait (with swap_to_mmap / reload_to_ram) and MemoryConsumer instead. This trait was never implemented anywhere; it will be removed in 0.6.0.

Reloads data from disk back into RAM.

The tier transitions to StorageTier::InMemory. Used when memory becomes available and faster access is desired.

Β§Errors

Returns an error if deserialization fails.

ImplementorsΒ§