pub struct Reader<T> { /* private fields */ }Expand description
Layer file reader.
T in Reader<T> must be a ColumnSpec that specifies the key and
auxiliary data types for all of the columns in the file to be read.
Use Reader::rows to read data.
Implementations§
Source§impl<T> Reader<T>where
T: ColumnSpec,
impl<T> Reader<T>where
T: ColumnSpec,
Sourcepub fn mark_for_checkpoint(&self)
pub fn mark_for_checkpoint(&self)
Marks the file of the reader as being part of a checkpoint.
Sourcepub fn open(
factories: &[&AnyFactories],
cache: fn() -> Option<Arc<BufferCache>>,
storage_backend: &dyn StorageBackend,
path: &StoragePath,
) -> Result<Self, Error>
pub fn open( factories: &[&AnyFactories], cache: fn() -> Option<Arc<BufferCache>>, storage_backend: &dyn StorageBackend, path: &StoragePath, ) -> Result<Self, Error>
Instantiates a reader given an existing path.
Sourcepub fn n_columns(&self) -> usize
pub fn n_columns(&self) -> usize
The number of columns in the layer file.
This is a fixed value for any given Reader.
Sourcepub fn n_rows(&self, column: usize) -> u64
pub fn n_rows(&self, column: usize) -> u64
The number of rows in the given column.
For column 0, this is the number of rows that may be visited with
rows. In other columns, it is the number of rows that
may be visited in total by calling next_column() on each of the rows
in the previous column.
Sourcepub fn path(&self) -> &StoragePath
pub fn path(&self) -> &StoragePath
Returns the storage path for the underlying object.
Sourcepub fn byte_size(&self) -> Result<u64, Error>
pub fn byte_size(&self) -> Result<u64, Error>
Returns the size of the underlying file in bytes.
Sourcepub fn cache_stats(&self) -> CacheStats
pub fn cache_stats(&self) -> CacheStats
Returns the cache statistics for this file. The statistics are specific to this file’s cache behavior for reads.
Sourcepub fn file_handle(&self) -> &Arc<dyn FileReader> ⓘ
pub fn file_handle(&self) -> &Arc<dyn FileReader> ⓘ
Returns the FileReader embedded in this Reader.
Sourcepub fn metadata(&self) -> &BatchMetadata
pub fn metadata(&self) -> &BatchMetadata
Returns additional metadata added to the file by the writer.
Source§impl<K, A, N> Reader<(&'static K, &'static A, N)>
impl<K, A, N> Reader<(&'static K, &'static A, N)>
Sourcepub fn membership_filter(&self) -> Result<Option<BatchKeyFilter>, Error>
pub fn membership_filter(&self) -> Result<Option<BatchKeyFilter>, Error>
Reads and deserializes the per-batch membership filter, if present.
For roaring filters this also threads the batch minimum into the min-offset decoder, so the returned filter can be queried directly.
Sourcepub fn key_range(&self) -> Result<Option<(Box<K>, Box<K>)>, Error>
pub fn key_range(&self) -> Result<Option<(Box<K>, Box<K>)>, Error>
Returns the min and max keys stored in column 0.
The bounds are loaded from the root node when first requested and can then be cached by higher-level batch types.
Sourcepub fn rows(&self) -> RowGroup<'_, K, A, N, (&'static K, &'static A, N)>
pub fn rows(&self) -> RowGroup<'_, K, A, N, (&'static K, &'static A, N)>
Returns a RowGroup for all of the rows in column 0.
Sourcepub fn bulk_rows(
&self,
) -> Result<BulkRows<'_, K, A, N, (&'static K, &'static A, N)>, Error>
pub fn bulk_rows( &self, ) -> Result<BulkRows<'_, K, A, N, (&'static K, &'static A, N)>, Error>
Returns a BulkRows for column 0.
Trait Implementations§
Source§impl<K, A, N> FallibleEq for Reader<(&'static K, &'static A, N)>where
K: DataTrait + ?Sized,
A: DataTrait + ?Sized,
(&'static K, &'static A, N): ColumnSpec,
for<'a> RowGroup<'a, K, A, N, (&'static K, &'static A, N)>: FallibleEq,
impl<K, A, N> FallibleEq for Reader<(&'static K, &'static A, N)>where
K: DataTrait + ?Sized,
A: DataTrait + ?Sized,
(&'static K, &'static A, N): ColumnSpec,
for<'a> RowGroup<'a, K, A, N, (&'static K, &'static A, N)>: FallibleEq,
Source§impl<T> SizeOf for Reader<T>where
T: ColumnSpec,
impl<T> SizeOf for Reader<T>where
T: ColumnSpec,
Source§fn size_of_children(&self, context: &mut Context)
fn size_of_children(&self, context: &mut Context)
Source§fn size_of_with_context(&self, context: &mut Context)
fn size_of_with_context(&self, context: &mut Context)
Context,
including both the size of the value itself and all of its childrenAuto Trait Implementations§
impl<T> !Freeze for Reader<T>
impl<T> !RefUnwindSafe for Reader<T>
impl<T> !UnwindSafe for Reader<T>
impl<T> Send for Reader<T>
impl<T> Sync for Reader<T>
impl<T> Unpin for Reader<T>
impl<T> UnsafeUnpin for Reader<T>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> ErasedDestructor for Twhere
T: 'static,
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