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() -> Arc<BufferCache>,
storage_backend: &dyn StorageBackend,
path: &StoragePath,
) -> Result<Self, Error>
pub fn open( factories: &[&AnyFactories], cache: fn() -> 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) -> &dyn FileReader
pub fn file_handle(&self) -> &dyn FileReader
Returns the FileReader
embedded in this Reader
.
Source§impl<K, A, N> Reader<(&'static K, &'static A, N)>
impl<K, A, N> Reader<(&'static K, &'static A, N)>
Sourcepub fn maybe_contains_key(&self, key: &K) -> bool
pub fn maybe_contains_key(&self, key: &K) -> bool
Asks the bloom filter of the reader if we have the key.
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.
Source§impl<K, A> Reader<(&'static K, &'static A, ())>
impl<K, A> Reader<(&'static K, &'static A, ())>
Source§impl<K0, A0, K1, A1> Reader<(&'static K0, &'static A0, (&'static K1, &'static A1, ()))>
impl<K0, A0, K1, A1> Reader<(&'static K0, &'static A0, (&'static K1, &'static A1, ()))>
Sourcepub fn fetch_indexed_zset<'a, 'b>(
&'a self,
keys: &'b DynVec<K0>,
) -> Result<FetchIndexedZSet<'a, 'b, K0, A0, K1, A1>, Error>
pub fn fetch_indexed_zset<'a, 'b>( &'a self, keys: &'b DynVec<K0>, ) -> Result<FetchIndexedZSet<'a, 'b, K0, A0, K1, A1>, Error>
Returns a FetchIndexedZSet
, which will build an indexed Z-set from
this reader containing just the rows whose keys are in keys
(which
must be sorted).
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,
Auto Trait Implementations§
impl<T> !Freeze for Reader<T>
impl<T> !RefUnwindSafe for Reader<T>
impl<T> Send for Reader<T>
impl<T> Sync for Reader<T>
impl<T> Unpin for Reader<T>
impl<T> !UnwindSafe 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
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