pub struct ScanScheduler { /* private fields */ }Expand description
An I/O scheduler which wraps an ObjectStore and throttles the amount of parallel I/O that can be run.
The ScanScheduler will cancel any outstanding I/O requests when it is dropped. For this reason it should be kept alive until all I/O has finished.
Note: The 2.X file readers already do this so this is only a concern if you are using the ScanScheduler directly.
Implementations§
Source§impl ScanScheduler
impl ScanScheduler
Sourcepub fn new(object_store: Arc<ObjectStore>, config: SchedulerConfig) -> Arc<Self> ⓘ
pub fn new(object_store: Arc<ObjectStore>, config: SchedulerConfig) -> Arc<Self> ⓘ
Create a new scheduler with the given I/O capacity
§Arguments
- object_store - the store to wrap
- config - configuration settings for the scheduler
Sourcepub async fn open_file_with_priority(
self: &Arc<Self>,
path: &Path,
base_priority: u64,
file_size_bytes: &CachedFileSize,
) -> Result<FileScheduler>
pub async fn open_file_with_priority( self: &Arc<Self>, path: &Path, base_priority: u64, file_size_bytes: &CachedFileSize, ) -> Result<FileScheduler>
Open a file for reading
§Arguments
- path - the path to the file to open
- base_priority - the base priority for I/O requests submitted to this file scheduler
this will determine the upper 64 bits of priority (the lower 64 bits
come from
submit_requestandsubmit_single)
Sourcepub async fn open_file(
self: &Arc<Self>,
path: &Path,
file_size_bytes: &CachedFileSize,
) -> Result<FileScheduler>
pub async fn open_file( self: &Arc<Self>, path: &Path, file_size_bytes: &CachedFileSize, ) -> Result<FileScheduler>
Open a file with a default priority of 0
See Self::open_file_with_priority for more information on the priority
Sourcepub fn open_reader(self: &Arc<Self>, reader: Arc<dyn Reader>) -> FileScheduler
pub fn open_reader(self: &Arc<Self>, reader: Arc<dyn Reader>) -> FileScheduler
Open a FileScheduler over an already-open Reader.
Unlike Self::open_file, this skips the path lookup and size probe and
schedules I/O against reader directly. This is useful when the reader
was produced outside the scheduler’s object store (e.g. a spill file
opened via crate::spill::Spill::reader), since a bare Reader
cannot otherwise drive a v2 FileReader (which needs a scheduler).
Uses a base priority of 0; chain FileScheduler::with_priority to set
a different one.
pub fn submit_request( &self, reader: Arc<dyn Reader>, request: Vec<Range<u64>>, priority: u128, bypass_backpressure: bool, ) -> impl Future<Output = Result<Vec<Bytes>>> + Send + use<>
pub fn stats(&self) -> ScanStats
Trait Implementations§
Source§impl Debug for ScanScheduler
impl Debug for ScanScheduler
Source§impl Drop for ScanScheduler
impl Drop for ScanScheduler
Auto Trait Implementations§
impl !RefUnwindSafe for ScanScheduler
impl !UnwindSafe for ScanScheduler
impl Freeze for ScanScheduler
impl Send for ScanScheduler
impl Sync for ScanScheduler
impl Unpin for ScanScheduler
impl UnsafeUnpin for ScanScheduler
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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