Skip to main content
pub struct BulkInserterOptions 
    pub insert_options: Option<HashMap<String, String>>,
    pub flush_options: FlushOptions,
    pub max_retries: usize,
    pub worker_list: Option<WorkerList>,
    pub max_in_flight_batches: usize,
    pub batch_listener: Option<Arc<dyn BatchInsertionListener>>,

Options for configuring the BulkInserter.

The insert options map is passed directly to insert_records calls and supports the same options as the /insert/records endpoint.

Fields

insert_options: Option<HashMap<String, String>>

Optional parameters to pass to GPUdb while inserting. These are passed directly to the insert_records API call. See insert_records_options module for available option keys.

flush_options: FlushOptions

Options for controlling automatic/timed flush behavior.

max_retries: usize

Maximum number of retries for failed insertions. Default is 3.

This counts retries after the first attempt (0 means one attempt), only connection failures are retried, and the count starts again on another cluster after an HA failover.

worker_list: Option<WorkerList>

Optional worker list for multi-head ingest. If None, the worker list will be automatically configured from the server. Pass an empty WorkerList to disable multi-head ingest.

max_in_flight_batches: usize

Maximum number of concurrent in-flight batch requests. Limits memory usage by blocking when this limit is reached. Default is 100.

batch_listener: Option<Arc<dyn BatchInsertionListener>>

Optional batch insertion listener for callbacks. Called when each batch completes (success or failure).

Implementations

Source

pub fn new() -> Self

Creates a new BulkInserterOptions with default values.

Source

pub fn set_update_on_existing_pk(&mut self, value: bool) -> &mut Self

Sets whether to update existing records on primary key collision.

Source

pub fn set_ignore_existing_pk(&mut self, value: bool) -> &mut Self

Sets whether to ignore existing primary key collisions (suppress errors).

Source

pub fn set_return_individual_errors(&mut self, value: bool) -> &mut Self

Sets whether to return individual errors for each record.

Source

pub fn set_allow_partial_batch(&mut self, value: bool) -> &mut Self

Sets whether to allow partial batch insertions.

Source

pub fn set_truncate_strings(&mut self, value: bool) -> &mut Self

Sets whether to truncate strings to fit the column width.

Source

pub fn set_flush_options(&mut self, flush_options: FlushOptions) -> &mut Self

Sets the flush options for automatic/timed flush.

Source

pub fn set_max_retries(&mut self, max_retries: usize) -> &mut Self

Sets the maximum number of retries for failed insertions.

Source

pub fn set_worker_list(&mut self, worker_list: Option<WorkerList>) -> &mut Self

Sets the worker list for multi-head ingest.

Source

pub fn set_option(&mut self, key: &str, value: &str) -> &mut Self

Adds a custom option to the insert options map.

Source

pub fn set_max_in_flight_batches(&mut self, max_batches: usize) -> &mut Self

Sets the maximum number of concurrent in-flight batch requests. This limits memory usage by blocking when the limit is reached.

Source

pub fn set_batch_listener( &mut self, listener: Arc<dyn BatchInsertionListener>, ) -> &mut Self

Sets the batch insertion listener for callbacks. The listener will be called when each batch completes (success or failure).

Trait Implementations

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source

fn fmt(&self, f: &mut Formatter<’_>) -> Result

Formats the value using the given formatter. Read more
Source

fn default() -> Self

Returns the “default value” for a type. Read more