pub trait VortexReadAt:
Send
+ Sync
+ 'static {
// Required methods
fn concurrency(&self) -> usize;
fn size(&self) -> BoxFuture<'static, VortexResult<u64>>;
fn read_at(
&self,
offset: u64,
length: usize,
alignment: Alignment,
) -> BoxFuture<'static, VortexResult<BufferHandle>>;
// Provided methods
fn uri(&self) -> Option<&Arc<str>> { ... }
fn coalesce_config(&self) -> Option<CoalesceConfig> { ... }
}Expand description
The unified read trait for Vortex I/O sources.
This trait provides async positional reads to underlying storage and is used by the vortex-file crate to read data from files or object stores.
Required Methods§
Sourcefn concurrency(&self) -> usize
fn concurrency(&self) -> usize
Maximum number of concurrent I/O requests for that should be pulled from this source.
This value is used to control how many VortexReadAt::read_at calls can
be in-flight simultaneously. Higher values allow more parallelism but consume
more resources (memory, file descriptors, network connections).
Implementations should choose a value appropriate for their underlying storage characteristics. Low-latency sources benefit less from high concurrency, while high-latency sources (like remote storage) benefit significantly from issuing many requests in parallel.
Sourcefn size(&self) -> BoxFuture<'static, VortexResult<u64>>
fn size(&self) -> BoxFuture<'static, VortexResult<u64>>
Asynchronously get the number of bytes of the underlying source.
Sourcefn read_at(
&self,
offset: u64,
length: usize,
alignment: Alignment,
) -> BoxFuture<'static, VortexResult<BufferHandle>>
fn read_at( &self, offset: u64, length: usize, alignment: Alignment, ) -> BoxFuture<'static, VortexResult<BufferHandle>>
Request an asynchronous positional read. Results will be returned as a BufferHandle.
If the reader does not have the requested number of bytes, the returned Future will complete
with an UnexpectedEof error.
Provided Methods§
Sourcefn uri(&self) -> Option<&Arc<str>>
fn uri(&self) -> Option<&Arc<str>>
URI for debugging/logging. Returns None for anonymous sources.
Sourcefn coalesce_config(&self) -> Option<CoalesceConfig>
fn coalesce_config(&self) -> Option<CoalesceConfig>
Configuration for merging nearby I/O requests into fewer, larger reads.
Implementations on Foreign Types§
Source§impl VortexReadAt for Arc<dyn VortexReadAt>
impl VortexReadAt for Arc<dyn VortexReadAt>
fn uri(&self) -> Option<&Arc<str>>
fn coalesce_config(&self) -> Option<CoalesceConfig>
fn concurrency(&self) -> usize
fn size(&self) -> BoxFuture<'static, VortexResult<u64>>
fn read_at( &self, offset: u64, length: usize, alignment: Alignment, ) -> BoxFuture<'static, VortexResult<BufferHandle>>
Source§impl VortexReadAt for ByteBuffer
impl VortexReadAt for ByteBuffer
fn size(&self) -> BoxFuture<'static, VortexResult<u64>>
fn concurrency(&self) -> usize
fn read_at( &self, offset: u64, length: usize, alignment: Alignment, ) -> BoxFuture<'static, VortexResult<BufferHandle>>
Source§impl<R: VortexReadAt> VortexReadAt for Arc<R>
impl<R: VortexReadAt> VortexReadAt for Arc<R>
fn uri(&self) -> Option<&Arc<str>>
fn coalesce_config(&self) -> Option<CoalesceConfig>
fn concurrency(&self) -> usize
fn size(&self) -> BoxFuture<'static, VortexResult<u64>>
fn read_at( &self, offset: u64, length: usize, alignment: Alignment, ) -> BoxFuture<'static, VortexResult<BufferHandle>>
Implementors§
impl VortexReadAt for ObjectStoreReadAt
impl VortexReadAt for FileReadAt
impl<R: VortexReadAt> VortexReadAt for Compat<R>
Compatibility adapter for VortexReadAt implementations that are based on Tokio.