pub struct ObjectStoreChunkReader { /* private fields */ }Expand description
Adapter to convert ObjectStore to AsyncChunkReader for orc-rust.
This adapter bridges the gap between DataFusion’s ObjectStore abstraction
and orc-rust’s AsyncChunkReader trait, enabling ORC files to be read
from any supported object store (local filesystem, S3, GCS, Azure, etc.).
When metrics are provided, it automatically tracks:
bytes_scanned: Total bytes read from the object storeio_requests: Number of I/O operations performed
Implementations§
Source§impl ObjectStoreChunkReader
impl ObjectStoreChunkReader
Sourcepub fn new(store: Arc<dyn ObjectStore>, path: Path) -> Self
pub fn new(store: Arc<dyn ObjectStore>, path: Path) -> Self
Create a new ObjectStoreChunkReader
Sourcepub fn with_size(store: Arc<dyn ObjectStore>, path: Path, size: u64) -> Self
pub fn with_size(store: Arc<dyn ObjectStore>, path: Path, size: u64) -> Self
Create with known file size (for optimization)
Sourcepub fn with_metrics(self, bytes_scanned: Count, io_requests: Count) -> Self
pub fn with_metrics(self, bytes_scanned: Count, io_requests: Count) -> Self
Attach metrics counters to track I/O statistics.
When metrics are attached, every read operation will automatically
update the bytes_scanned and io_requests counters.
§Example
ⓘ
use datafusion_datasource_orc::metrics::OrcFileMetrics;
let metrics = OrcFileMetrics::new(0, "file.orc", &metrics_set);
let reader = ObjectStoreChunkReader::with_size(store, path, size)
.with_metrics(metrics.bytes_scanned.clone(), metrics.io_requests.clone());Trait Implementations§
Auto Trait Implementations§
impl Freeze for ObjectStoreChunkReader
impl !RefUnwindSafe for ObjectStoreChunkReader
impl Send for ObjectStoreChunkReader
impl Sync for ObjectStoreChunkReader
impl Unpin for ObjectStoreChunkReader
impl !UnwindSafe for ObjectStoreChunkReader
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> 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