pub struct DataFileFieldInterner { /* private fields */ }Expand description
Interns repeated data so that fragments with identical content share a
single heap allocation via Arc.
At 20M fragments the deduplication typically saves multiple GB of heap because every fragment in a homogeneous table carries the same field list, and post-compaction fragments share identical version metadata bytes.
Uses a Vec-based linear scan when the cache is small (<=16 entries)
and upgrades to HashMap for larger caches. In the common homogeneous
case (1-3 unique values), linear scan avoids per-fragment hashing overhead.
Implementations§
Source§impl DataFileFieldInterner
impl DataFileFieldInterner
Sourcepub fn intern_data_file(&mut self, proto: DataFile) -> Result<DataFile>
pub fn intern_data_file(&mut self, proto: DataFile) -> Result<DataFile>
Convert a protobuf DataFile, interning fields and column_indices.
Sourcepub fn intern_fragment(&mut self, p: DataFragment) -> Result<Fragment>
pub fn intern_fragment(&mut self, p: DataFragment) -> Result<Fragment>
Convert a protobuf DataFragment, interning fields and version metadata.
Trait Implementations§
Source§impl Default for DataFileFieldInterner
impl Default for DataFileFieldInterner
Source§fn default() -> DataFileFieldInterner
fn default() -> DataFileFieldInterner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DataFileFieldInterner
impl RefUnwindSafe for DataFileFieldInterner
impl Send for DataFileFieldInterner
impl Sync for DataFileFieldInterner
impl Unpin for DataFileFieldInterner
impl UnsafeUnpin for DataFileFieldInterner
impl UnwindSafe for DataFileFieldInterner
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> 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>
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