Struct lance_encoding::encodings::logical::list::ListPageScheduler
source · pub struct ListPageScheduler { /* private fields */ }Expand description
A page scheduler for list fields that encodes offsets in one field and items in another
The list scheduler is somewhat unique because it requires indirect I/O. We cannot know the
ranges we need simply by looking at the metadata. This means that list scheduling doesn’t
fit neatly into the two-thread schedule-loop / decode-loop model. To handle this, when a
list page is scheduled, we only schedule the I/O for the offsets and then we immediately
launch a new tokio task. This new task waits for the offsets, decodes them, and then
schedules the I/O for the items. Keep in mind that list items can be lists themselves. If
that is the case then this indirection will continue. The decode task that is returned will
only finish waiting when all of the I/O has completed.
Whenever we schedule follow-up I/O like this the priority is based on the top-level row index. This helps ensure that earlier rows get finished completely (including follow up tasks) before we perform I/O for later rows.
TODO: Actually implement the priority system described above
Implementations§
source§impl ListPageScheduler
impl ListPageScheduler
pub fn new( offsets_scheduler: Box<dyn LogicalPageScheduler>, items_schedulers: Vec<Box<dyn LogicalPageScheduler>>, items_type: DataType, offset_type: DataType, null_offset_adjustment: u64 ) -> Self
Trait Implementations§
source§impl Debug for ListPageScheduler
impl Debug for ListPageScheduler
source§impl LogicalPageScheduler for ListPageScheduler
impl LogicalPageScheduler for ListPageScheduler
source§fn schedule_ranges(
&self,
ranges: &[Range<u32>],
scheduler: &Arc<dyn EncodingsIo>,
sink: &UnboundedSender<Box<dyn LogicalPageDecoder>>
) -> Result<()>
fn schedule_ranges( &self, ranges: &[Range<u32>], scheduler: &Arc<dyn EncodingsIo>, sink: &UnboundedSender<Box<dyn LogicalPageDecoder>> ) -> Result<()>
source§fn schedule_take(
&self,
indices: &[u32],
scheduler: &Arc<dyn EncodingsIo>,
sink: &UnboundedSender<Box<dyn LogicalPageDecoder>>
) -> Result<()>
fn schedule_take( &self, indices: &[u32], scheduler: &Arc<dyn EncodingsIo>, sink: &UnboundedSender<Box<dyn LogicalPageDecoder>> ) -> Result<()>
Auto Trait Implementations§
impl Freeze for ListPageScheduler
impl !RefUnwindSafe for ListPageScheduler
impl Send for ListPageScheduler
impl Sync for ListPageScheduler
impl Unpin for ListPageScheduler
impl !UnwindSafe for ListPageScheduler
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
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>
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>
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