Struct lance_file::page_table::PageTable
source · pub struct PageTable { /* private fields */ }
Expand description
Page lookup table.
Implementations§
source§impl PageTable
impl PageTable
sourcepub async fn load<'a>(
reader: &dyn Reader,
position: usize,
num_columns: i32,
num_batches: i32,
field_id_offset: i32
) -> Result<Self>
pub async fn load<'a>( reader: &dyn Reader, position: usize, num_columns: i32, num_batches: i32, field_id_offset: i32 ) -> Result<Self>
Load PageTable from disk.
The field_ids that are loaded are field_id_offset
to field_id_offset + num_columns
.
field_id_offset
should be the smallest field_id in the schema. num_columns
should
be the total unique number of field ids, including struct fields despite the fact
they have no data pages.
sourcepub async fn write(
&self,
writer: &mut dyn Writer,
field_id_offset: i32
) -> Result<usize>
pub async fn write( &self, writer: &mut dyn Writer, field_id_offset: i32 ) -> Result<usize>
Write PageTable to disk.
field_id_offset
is the smallest field_id that is present in the schema.
This might be a struct field, which has no data pages, but it still must
be serialized to the page table per the format spec.
Any (field_id, batch_id) combinations that are not present in the page table will be written as (0, 0) to indicate an empty page.
sourcepub fn set(&mut self, field_id: i32, batch: i32, page_info: PageInfo)
pub fn set(&mut self, field_id: i32, batch: i32, page_info: PageInfo)
Set page lookup info for a page identified by (column, batch)
pair.
pub fn get(&self, field_id: i32, batch: i32) -> Option<&PageInfo>
Trait Implementations§
source§impl PartialEq for PageTable
impl PartialEq for PageTable
impl StructuralPartialEq for PageTable
Auto Trait Implementations§
impl Freeze for PageTable
impl RefUnwindSafe for PageTable
impl Send for PageTable
impl Sync for PageTable
impl Unpin for PageTable
impl UnwindSafe for PageTable
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
Converts
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>
Converts
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