pub struct RecordBatch {
pub len: usize,
pub timestamps: Vec<i64>,
pub key_offsets: Vec<u32>,
pub key_data: Vec<u8>,
pub value_offsets: Vec<u32>,
pub value_data: Vec<u8>,
}Expand description
Record batch for columnar storage/processing
Fields§
§len: usizeNumber of records
timestamps: Vec<i64>Timestamps (columnar)
key_offsets: Vec<u32>Keys (columnar, offsets into key_data)
key_data: Vec<u8>Key data (concatenated)
value_offsets: Vec<u32>Values (columnar, offsets into value_data)
value_data: Vec<u8>Value data (concatenated)
Implementations§
Source§impl RecordBatch
impl RecordBatch
Sourcepub fn with_capacity(
records: usize,
avg_key_size: usize,
avg_value_size: usize,
) -> Self
pub fn with_capacity( records: usize, avg_key_size: usize, avg_value_size: usize, ) -> Self
Create with specified capacity
Sourcepub fn add(&mut self, timestamp: i64, key: Option<&[u8]>, value: &[u8])
pub fn add(&mut self, timestamp: i64, key: Option<&[u8]>, value: &[u8])
Add a record to the batch
Sourcepub fn memory_size(&self) -> usize
pub fn memory_size(&self) -> usize
Get total memory usage
Sourcepub fn filter<F>(&self, predicate: F) -> RecordBatch
pub fn filter<F>(&self, predicate: F) -> RecordBatch
Filter records by predicate
Sourcepub fn map_values<F>(&self, transform: F) -> RecordBatch
pub fn map_values<F>(&self, transform: F) -> RecordBatch
Transform values
Trait Implementations§
Source§impl Debug for RecordBatch
impl Debug for RecordBatch
Source§impl Default for RecordBatch
impl Default for RecordBatch
Source§impl<'a> IntoIterator for &'a RecordBatch
impl<'a> IntoIterator for &'a RecordBatch
Auto Trait Implementations§
impl Freeze for RecordBatch
impl RefUnwindSafe for RecordBatch
impl Send for RecordBatch
impl Sync for RecordBatch
impl Unpin for RecordBatch
impl UnwindSafe for RecordBatch
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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