pub trait IOBackend: Send + Sync {
// Required methods
fn schedule_read(
&self,
page_id: PageId,
) -> QuillSQLResult<DiskCommandResultReceiver<BytesMut>>;
fn schedule_read_pages(
&self,
page_ids: Vec<PageId>,
) -> QuillSQLResult<DiskCommandResultReceiver<Vec<BytesMut>>>;
fn schedule_write(
&self,
page_id: PageId,
data: Bytes,
) -> QuillSQLResult<DiskCommandResultReceiver<()>>;
fn schedule_allocate(
&self,
) -> QuillSQLResult<DiskCommandResultReceiver<PageId>>;
fn schedule_deallocate(
&self,
page_id: PageId,
) -> QuillSQLResult<DiskCommandResultReceiver<()>>;
}
Expand description
IO backend abstraction for DiskScheduler. Implementations are responsible for request routing and graceful shutdown.
Required Methods§
Sourcefn schedule_read(
&self,
page_id: PageId,
) -> QuillSQLResult<DiskCommandResultReceiver<BytesMut>>
fn schedule_read( &self, page_id: PageId, ) -> QuillSQLResult<DiskCommandResultReceiver<BytesMut>>
Schedule single-page read.
Sourcefn schedule_read_pages(
&self,
page_ids: Vec<PageId>,
) -> QuillSQLResult<DiskCommandResultReceiver<Vec<BytesMut>>>
fn schedule_read_pages( &self, page_ids: Vec<PageId>, ) -> QuillSQLResult<DiskCommandResultReceiver<Vec<BytesMut>>>
Schedule batch reads, preserving order of input page_ids in the output.
Sourcefn schedule_write(
&self,
page_id: PageId,
data: Bytes,
) -> QuillSQLResult<DiskCommandResultReceiver<()>>
fn schedule_write( &self, page_id: PageId, data: Bytes, ) -> QuillSQLResult<DiskCommandResultReceiver<()>>
Schedule single-page write (exact PAGE_SIZE bytes).
Sourcefn schedule_allocate(&self) -> QuillSQLResult<DiskCommandResultReceiver<PageId>>
fn schedule_allocate(&self) -> QuillSQLResult<DiskCommandResultReceiver<PageId>>
Allocate a new page id.
Sourcefn schedule_deallocate(
&self,
page_id: PageId,
) -> QuillSQLResult<DiskCommandResultReceiver<()>>
fn schedule_deallocate( &self, page_id: PageId, ) -> QuillSQLResult<DiskCommandResultReceiver<()>>
Deallocate a page id (zeroing on disk, then freelist push).