struct RecordBatchStore {
next_id: u32,
batches: HashMap<u32, RecordBatchEntry>,
batches_size: usize,
}Expand description
This structure tracks [RecordBatch] by an id so that:
- The baches can be tracked via an id that can be copied cheaply
- The total memory held by all batches is tracked
Fields§
§next_id: u32id generator
batches: HashMap<u32, RecordBatchEntry>storage
batches_size: usizetotal size of all record batches tracked by this store
Implementations§
Source§impl RecordBatchStore
impl RecordBatchStore
fn new() -> Self
Sourcepub fn register(&mut self, batch: RecordBatch) -> RecordBatchEntry
pub fn register(&mut self, batch: RecordBatch) -> RecordBatchEntry
Register this batch with the store and assign an ID. No attempt is made to compare this batch to other batches
Sourcepub fn insert(&mut self, entry: RecordBatchEntry)
pub fn insert(&mut self, entry: RecordBatchEntry)
Insert a record batch entry into this store, tracking its memory use, if it has any uses
fn get(&self, id: u32) -> Option<&RecordBatchEntry>
Sourcefn unused_rows(&self) -> usize
fn unused_rows(&self) -> usize
Returns the total number of rows in batches minus the number which are in use
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RecordBatchStore
impl !RefUnwindSafe for RecordBatchStore
impl Send for RecordBatchStore
impl Sync for RecordBatchStore
impl Unpin for RecordBatchStore
impl !UnwindSafe for RecordBatchStore
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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