Skip to main content
pub struct ClusterAddressInfo  /* private fields */ 

Contains address information for a Kinetica cluster.

This struct stores information about a cluster including its active head node URL, worker rank URLs, hostnames, host manager URL, and system properties.

Implementations

Source

pub fn new( active_head_node_url: Url, system_properties: HashMap<String, String>, worker_rank_urls: Vec<Option<Url>>, host_names: HashSet<String>, host_manager_url: Url, ) -> Self

Creates a new ClusterAddressInfo for an active cluster.

  • active_head_node_url - The URL of the active head node
  • system_properties - System properties map from the cluster
  • worker_rank_urls - Worker rank URLs, with None at the slot of every rank removed from the cluster
  • host_names - Set of hostnames/IP addresses in the cluster
  • host_manager_url - URL for the host manager

A new ClusterAddressInfo instance with hostnames updated based on rank URLs.

Source

pub fn with_host_manager_port( active_head_node_url: Url, host_manager_port: u16, ) -> Result<Self, KineticaError>

Creates a ClusterAddressInfo with just an active URL and host manager port.

  • active_head_node_url - The URL of the active head node
  • host_manager_port - The port for the host manager

A Result containing the new ClusterAddressInfo or a KineticaError.

Source

pub fn from_url(active_head_node_url: Url) -> Result<Self, KineticaError>

Creates a ClusterAddressInfo with just an active URL using the default host manager port.

  • active_head_node_url - The URL of the active head node

A Result containing the new ClusterAddressInfo or a KineticaError.

Returns the active head node URL.

Returns the system properties map.

Source

pub fn worker_rank_urls(&self) -> &[Option<Url>]

Returns the worker rank URLs, where entry i is rank i + 1.

A rank removed from the cluster keeps its slot, as None, so that these indices stay aligned with the rank numbering used by the shard routing table. Callers walking this list must skip the empty slots; to iterate only reachable ranks, use Self::live_worker_rank_urls.

Source

pub fn live_worker_rank_urls(&self) -> impl Iterator<Item = &Url>

Returns the URLs of the worker ranks still present in the cluster, skipping the empty slots left by removed ranks.

Use this for health checks and hostname collection — anything that visits ranks without caring which rank number each one is. Never use it for routing: it is compacted, so its indices are not rank numbers.

Returns the set of hostnames.

Source

pub fn host_manager_url(&self) -> &Url

Returns the host manager URL.

Returns whether this is the primary cluster.

Whether multi-head operations are available on this cluster from this client.

Distinct from the disable_auto_discovery option, which records what the user asked for and applies to the whole HA ring. This records what was actually observed for one cluster: a cluster whose worker addresses this client cannot reach is still usable through its head node, and that loss of capability belongs to the cluster, not to the connection.

Source

pub fn ha_status(&self) -> Option<&str>

The HA drained status (“drained”, “draining”, “not_drained”) the cluster last reported, or None if it did not report one.

Source

pub fn set_active_head_node_url(&mut self, value: Url) -> &mut Self

Sets the active head node URL. Returns self for method chaining.

Source

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

Sets the system properties. Returns self for method chaining.

Source

pub fn set_worker_rank_urls(&mut self, value: Vec<Option<Url>>) -> &mut Self

Sets the worker rank URLs. Returns self for method chaining.

None marks the slot of a rank removed from the cluster; see Self::worker_rank_urls for why those slots must be kept.

Source

pub fn set_host_names(&mut self, value: HashSet<String>) -> &mut Self

Sets the list of host names. Returns self for method chaining.

Source

pub fn set_host_manager_url(&mut self, value: Url) -> &mut Self

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

Source

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

Sets whether this cluster is the primary one. Returns self for method chaining.

Source

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

Records whether multi-head operations are available on this cluster; see ClusterAddressInfo::is_multi_head_available.

Source

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

Sets the HA drained status. Returns self for method chaining.

Source

pub fn does_cluster_contain_node(&self, host_name: &str) -> bool

Checks if the given hostname (or IP address) is part of this cluster.

  • host_name - The hostname or IP address to check

true if this cluster contains a machine with the given hostname or IP address, false otherwise.

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 fmt(&self, f: &mut Formatter<’_>) -> Result

Formats the value using the given formatter. Read more
Source

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.