CascadeBackend

Struct CascadeBackend 

Source
pub struct CascadeBackend { /* private fields */ }

Implementations§

Source§

impl CascadeBackend

Source

pub fn new( backing: Box<dyn StorageBackend>, layout: GroupLayout, cap_slots: u32, ) -> Result<Self>

Trait Implementations§

Source§

impl Drop for CascadeBackend

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl StorageBackend for CascadeBackend

Source§

fn write_from_host(&mut self, key: GroupKey, src: &[u8]) -> Result<()>

One-shot sequential write — used at offload time to populate disk from a host-side K/V buffer.
Source§

fn read(&mut self, requests: &[ReadRequest], stream: u64) -> Result<()>

Synchronously fulfil all requests, returning when the corresponding HBM destinations are populated and visible on stream. The backend chooses how to schedule (blocking POSIX pread, batched io_uring, etc.). At return, the stream has been synchronised so the caller can issue subsequent kernels that depend on the data.
Source§

fn read_async(&mut self, requests: &[ReadRequest], stream: u64) -> Result<()>

Async variant of read: enqueue the tier read + H2D on stream and return WITHOUT a terminal host stream_sync. Default = the synchronous read, so file backends need no change and the on-demand path stays byte-identical.
Source§

fn register_landing_region(&mut self, base: u64, len: usize) -> Result<()>

Optionally pre-register [base, base+len) as the read-landing region. The RDMA backend registers it as ONE MR (per rail) so zero-copy restore reuses that lkey for every slot within it. No-op for the file backends.
Source§

fn group_layout(&self) -> GroupLayout

Immutable disk/device geometry. The default block methods below use it to fan a block op back out to the per-head path; io_uring/posix return their layout spec, Cascade delegates to its backing, RDMA returns its layout.
Source§

fn read_blocks( &mut self, requests: &[BlockReadRequest], stream: u64, ) -> Result<()>

Block-granular read: fulfil each request with ONE contiguous block_bytes op instead of 2·nkv per-head reads. Same stream contract as read. The DEFAULT fans out to read via expand_blocks_to_groups, so posix/RDMA/Cascade stay correct (just un-coalesced) with no change.
Source§

fn read_blocks_async( &mut self, requests: &[BlockReadRequest], stream: u64, ) -> Result<()>

Async block-granular read — the coalesced twin of read_async for the prefetch path. DEFAULT fans out to read_async.
Source§

fn write_block_from_host( &mut self, base_key: GroupKey, src: &[u8], ) -> Result<()>

Block-granular write: ONE contiguous block_bytes op. src is exactly block_bytes laid out [K0,K1,…,K(nkv-1),V0,…,V(nkv-1)] at group_stride pitch. base_key carries the block identity (kv_head/kind ignored). DEFAULT splits src back into the 2·nkv per-head group_stride stripes and calls write_from_host per head — byte-identical on-disk image.
Source§

fn write_blocks_run( &mut self, base_key: GroupKey, run_len: usize, src: &[u8], ) -> Result<()>

Write a run of run_len strictly-consecutive same-layer blocks in ONE contiguous op. base_key carries the run’s FIRST block; src is exactly run_len · block_bytes. DEFAULT fans out to run_len write_block_from_host calls — byte- AND op-identical to the un-coalesced path (and run_len == 1 is exactly one call).
Source§

fn supports_write_run_coalescing(&self) -> bool

Whether this backend can service write_blocks_run as a single wide op. DEFAULT false: RDMA/Cascade keep the per-block fan-out, and the caller stays on the per-block write path.
Source§

impl Sync for CascadeBackend

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more