pub struct BatchLoadState { /* private fields */ }Expand description
Batch/chunk state machine shared by executemany ingestion and direct
path load. Port of BatchLoadManager/DataFrameBatchLoadManager
(impl/base/batch_load_manager.pyx).
The data source is modelled as a list of chunks (an Arrow chunked array
has one entry per chunk; a plain list of rows is a single chunk). Batches
never span chunk boundaries; message_offset is the row offset within
the current chunk that must accompany the execute/load message.
Implementations§
Source§impl BatchLoadState
impl BatchLoadState
pub fn new(chunk_lengths: Vec<u64>, batch_size: u32) -> Result<Self>
Sourcepub fn for_rows(total_rows: u64, batch_size: u32) -> Result<Self>
pub fn for_rows(total_rows: u64, batch_size: u32) -> Result<Self>
Creates the state machine for a single-chunk source of total_rows
rows (a plain list of rows).
Sourcepub fn num_rows(&self) -> u32
pub fn num_rows(&self) -> u32
Number of rows in the current batch; zero means the load is complete.
Sourcepub fn message_offset(&self) -> u64
pub fn message_offset(&self) -> u64
Offset to send with the execute/load message (row offset within the current chunk at the time the batch was formed).
Sourcepub fn chunk_index(&self) -> usize
pub fn chunk_index(&self) -> usize
Index of the chunk the current batch draws from.
pub fn is_done(&self) -> bool
Sourcepub fn next_batch(&mut self)
pub fn next_batch(&mut self)
Advances to the next batch (mirrors BatchLoadManager.next_batch).
Trait Implementations§
Source§impl Clone for BatchLoadState
impl Clone for BatchLoadState
Source§fn clone(&self) -> BatchLoadState
fn clone(&self) -> BatchLoadState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BatchLoadState
impl Debug for BatchLoadState
impl Eq for BatchLoadState
Source§impl PartialEq for BatchLoadState
impl PartialEq for BatchLoadState
Source§fn eq(&self, other: &BatchLoadState) -> bool
fn eq(&self, other: &BatchLoadState) -> bool
self and other values to be equal, and is used by ==.