Skip to main content
pub struct KineticaOptions 

    pub primary_url: String,
    pub username: String,
    pub password: String,
    pub oauth_token: String,
    pub hostname_regex: Option<String>,
    pub use_snappy: bool,
    pub bypass_ssl_cert_check: bool,
    pub trust_store_file_path: String,
    pub trust_store_password: String,
    pub disable_failover: bool,
    pub disable_auto_discovery: bool,
    pub ha_failover_order: HaFailoverOrder,
    pub http_headers: HashMap<String, String>,
    pub client_name: Option<String>,
    pub client_version: Option<String>,
    pub session_id: Option<String>,
    pub tcp_keep_alive: bool,
    pub tcp_keep_idle: u32,
    pub tcp_keep_interval: u32,
    pub tcp_keep_count: u32,
    pub timeout: u64,
    pub server_connection_timeout: u64,
    pub host_manager_port: u16,
    pub initial_connection_attempt_timeout: u64,
    pub max_total_connections: usize,
    pub max_connections_per_host: usize,
    pub max_retries: usize,
    pub failback_polling_interval: u64,

Extended configuration options for the Kinetica client.

This struct provides comprehensive configuration for the Kinetica client including authentication, connection settings, and HA configuration.

Large batches are encoded and decoded on rayon’s threads, with the same results as one thread gives (see crate::avro). The connection pool checks every connection before it hands one out, and timeout applies to every request.

Fields

primary_url: String

URL of the primary cluster in the HA environment

username: String

Username for authentication

password: String

Password for authentication

oauth_token: String

OAuth2 token for authentication. When set, it is sent as a Bearer token in place of the username and password.

hostname_regex: Option<String>

Regex pattern to filter URLs by hostname/IP

use_snappy: bool

Whether to Snappy-compress requests to the endpoints that carry bulk record payloads — /insert/records and /update/records.

This is a switch over an opt-in set, not a global one: every other endpoint is sent uncompressed whatever this is set to, because compressing a small request costs more than it saves.

bypass_ssl_cert_check: bool

Whether to bypass SSL certificate verification

trust_store_file_path: String

The trust store HTTPS connections trust: a PKCS#12 or JKS file, or a PEM file of certificates. Used when its password is given too and certificates are checked. A server whose own certificate is in it, or whose chain leads to one in it, is trusted, and its name is not checked.

trust_store_password: String

The password of the trust store.

disable_failover: bool

Whether to disable failover upon failures

disable_auto_discovery: bool

Whether to disable automatic discovery of clusters and worker ranks

ha_failover_order: HaFailoverOrder

Order in which to failover to backup clusters

http_headers: HashMap<String, String>

Additional HTTP headers sent with each request.

The headers the client sets itself (Authorization, Content-type, User-Agent and X-Kinetica-Group) are not sent from here. Basic credentials in an Authorization header are used in place of the username and password, and an X-Kinetica-Group header names the HA synchronicity mode, by its value on the wire or its HaSynchronicityMode constant name (REPL_SYNC or SYNCHRONOUS).

client_name: Option<String>

The client program’s name, reported first in the User-Agent header.

client_version: Option<String>

The client program’s version, reported with its name.

session_id: Option<String>

The server session the connection’s SQL #name temp tables belong to, so that several connections can share one session’s temp tables.

The caller must drop that session, with Kinetica::drop_session on a connection given the same session ID; Kinetica::close does not. If None or empty (the default), each connection has a session of its own, which its close drops.

tcp_keep_alive: bool

Whether connections send TCP keep-alive probes, with the operating system’s timings unless set below (default true).

tcp_keep_idle: u32

Seconds a connection idles before the first keep-alive probe; 0 (the default) keeps the system’s, typically 7200 on Linux.

tcp_keep_interval: u32

Seconds between keep-alive probes; 0 (the default) keeps the system’s, typically 75 on Linux.

tcp_keep_count: u32

Keep-alive probes before a connection is dropped; 0 (the default) keeps the system’s, typically 9 on Linux.

timeout: u64

Request timeout in milliseconds (0 = infinite).

A read timeout: it bounds the wait for a response once the request has been sent, and then each read of the response body, never the upload or the body as a whole. So a large request or response that keeps moving is not cut off, while a server that goes quiet for this long is given up on. A timeout waiting for a response is treated like an unreachable server and triggers HA failover.

server_connection_timeout: u64

Timeout for establishing a connection, in milliseconds (0 = infinite)

host_manager_port: u16

Host manager port number

initial_connection_attempt_timeout: u64

Initial connection attempt timeout in milliseconds (0 = no retry)

max_total_connections: usize

Maximum number of requests in flight across all hosts (default 40). At least 1.

A request beyond the limit waits up to 5 minutes for a free connection and then fails as a connection error. High-concurrency callers such as a BulkInserter with many workers should raise this to match.

max_connections_per_host: usize

Maximum number of requests in flight to one host (default 10), and the number of idle connections kept per host for reuse. At least 1.

A request beyond the limit waits as for max_total_connections. A BulkInserter with more than this many flush workers sending to one host is throttled to this many concurrent requests.

max_retries: usize

How many times a request is retried at once, on the same server, when sending it fails or the server answers 502 or 503 (default 5); see HttpClientConfig::max_retries.

failback_polling_interval: u64

How often, in seconds, to check whether the primary cluster is back after an HA failover has moved the connection off it (default 5). Once it passes, the connection fails back to it; see the failback module.

Implementations

Source

pub fn new() -> Self

Creates a new KineticaOptions with default values.

Source

pub fn set_primary_url(&mut self, value: impl Into<String>) -> &mut Self

Sets the primary URL. Returns self for method chaining.

Source

pub fn set_username(&mut self, value: impl Into<String>) -> &mut Self

Sets the username. Returns self for method chaining.

Source

pub fn set_password(&mut self, value: impl Into<String>) -> &mut Self

Sets the password. Returns self for method chaining.

Source

pub fn set_oauth_token(&mut self, value: impl Into<String>) -> &mut Self

Sets the OAuth2 token. Returns self for method chaining.

Source

pub fn set_http_headers(&mut self, value: HashMap<String, String>) -> &mut Self

Replaces the additional HTTP headers sent with each request; see KineticaOptions::http_headers. Returns self for method chaining.

Source

pub fn add_http_header( &mut self, header: impl Into<String>, value: impl Into<String>, ) -> &mut Self

Adds an HTTP header sent with each request, replacing one of the same name; see KineticaOptions::http_headers. Returns self for method chaining.

Source

pub fn set_client_info( &mut self, client_name: Option<&str>, client_version: Option<&str>, ) -> &mut Self

Sets the client program’s name and version, reported first in the User-Agent header. A None name clears both. Returns self for method chaining.

Source

pub fn set_session_id(&mut self, value: Option<&str>) -> &mut Self

Sets the server session to share; see KineticaOptions::session_id. None gives each connection a session of its own. Returns self for method chaining.

Source

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

Sets whether connections send TCP keep-alive probes; see KineticaOptions::tcp_keep_alive. Returns self for method chaining.

Source

pub fn set_tcp_keep_idle(&mut self, seconds: u32) -> &mut Self

Sets the seconds a connection idles before the first keep-alive probe, 0 for the system’s. Ignored, with a warning, when keep-alive is off. Returns self for method chaining.

Source

pub fn set_tcp_keep_interval(&mut self, seconds: u32) -> &mut Self

Sets the seconds between keep-alive probes, 0 for the system’s. Ignored, with a warning, when keep-alive is off. Returns self for method chaining.

Source

pub fn set_tcp_keep_count(&mut self, count: u32) -> &mut Self

Sets the keep-alive probes before a connection is dropped, 0 for the system’s. Ignored, with a warning, when keep-alive is off. Returns self for method chaining.

Source

pub fn set_hostname_regex(&mut self, value: Option<String>) -> &mut Self

Sets the hostname regex. Returns self for method chaining.

Source

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

Sets whether to Snappy-compress bulk record requests (/insert/records and /update/records). Returns self for method chaining.

See KineticaOptions::use_snappy — other endpoints are unaffected.

Source

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

Sets whether to bypass SSL certificate check. Returns self for method chaining.

Source

pub fn set_trust_store_file_path( &mut self, value: impl Into<String>, ) -> &mut Self

Sets the trust store file. See KineticaOptions::trust_store_file_path.

Source

pub fn set_trust_store_password( &mut self, value: impl Into<String>, ) -> &mut Self

Sets the trust store’s password.

The trust store file.

The trust store’s password.

Source

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

Sets whether to disable failover. Returns self for method chaining.

Source

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

Sets whether to disable auto-discovery. Returns self for method chaining.

Source

pub fn set_ha_failover_order(&mut self, value: HaFailoverOrder) -> &mut Self

Sets the HA failover order. Returns self for method chaining.

Source

pub fn set_timeout(&mut self, value: u64) -> &mut Self

Sets the request timeout in milliseconds. Returns self for method chaining.

Source

pub fn set_server_connection_timeout(&mut self, value: u64) -> &mut Self

Sets the server connection timeout in milliseconds. Returns self for method chaining.

Source

pub fn set_host_manager_port(&mut self, value: u16) -> &mut Self

Sets the host manager port. Returns self for method chaining.

A host manager address the server publishes for the head node’s host (conf.host<i>_host_manager_public_url) is used over any port, and while this is left at DEFAULT_HOST_MANAGER_PORT the server’s reported conf.hm_http_port is used instead of it.

Source

pub fn set_initial_connection_attempt_timeout( &mut self, value: u64, ) -> &mut Self

Sets the initial connection attempt timeout in milliseconds. Returns self for method chaining.

Source

pub fn set_failback_polling_interval(&mut self, seconds: u64) -> &mut Self

Sets how often, in seconds, to poll the primary cluster for fail-back. Returns self for method chaining.

Source

pub fn set_max_total_connections(&mut self, value: usize) -> &mut Self

Sets the maximum total connections. Returns self for method chaining.

Source

pub fn set_max_connections_per_host(&mut self, value: usize) -> &mut Self

Sets the maximum connections per host. Returns self for method chaining.

Source

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

Sets the maximum number of HTTP retries. Returns self for method chaining.

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

impl Debug for KineticaOptions

Prints the options with the password masked: <********>, or "" when it is empty.

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