#[non_exhaustive]pub struct MultiClusterRoutingUseAny {
pub cluster_ids: Vec<String>,
pub affinity: Option<Affinity>,
/* private fields */
}Expand description
Read/write requests are routed to the nearest cluster in the instance, and will fail over to the nearest cluster that is available in the event of transient errors or delays. Clusters in a region are considered equidistant. Choosing this option sacrifices read-your-writes consistency to improve availability.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cluster_ids: Vec<String>The set of clusters to route to. The order is ignored; clusters will be tried in order of distance. If left empty, all clusters are eligible.
affinity: Option<Affinity>Possible algorithms for routing affinity. If enabled, Bigtable will route between equidistant clusters in a deterministic order rather than choosing randomly.
This mechanism gives read-your-writes consistency for most requests under most circumstances, without sacrificing availability. Consistency is not guaranteed, as requests might still fail over between clusters in the event of errors or latency.
Implementations§
Source§impl MultiClusterRoutingUseAny
impl MultiClusterRoutingUseAny
pub fn new() -> Self
Sourcepub fn set_cluster_ids<T, V>(self, v: T) -> Self
pub fn set_cluster_ids<T, V>(self, v: T) -> Self
Sets the value of cluster_ids.
§Example
let x = MultiClusterRoutingUseAny::new().set_cluster_ids(["a", "b", "c"]);Sourcepub fn set_affinity<T: Into<Option<Affinity>>>(self, v: T) -> Self
pub fn set_affinity<T: Into<Option<Affinity>>>(self, v: T) -> Self
Sets the value of affinity.
Note that all the setters affecting affinity are mutually
exclusive.
§Example
use google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::RowAffinity;
let x = MultiClusterRoutingUseAny::new().set_affinity(Some(
google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::Affinity::RowAffinity(RowAffinity::default().into())));Sourcepub fn row_affinity(&self) -> Option<&Box<RowAffinity>>
pub fn row_affinity(&self) -> Option<&Box<RowAffinity>>
The value of affinity
if it holds a RowAffinity, None if the field is not set or
holds a different branch.
Sourcepub fn set_row_affinity<T: Into<Box<RowAffinity>>>(self, v: T) -> Self
pub fn set_row_affinity<T: Into<Box<RowAffinity>>>(self, v: T) -> Self
Sets the value of affinity
to hold a RowAffinity.
Note that all the setters affecting affinity are
mutually exclusive.
§Example
use google_cloud_bigtable_admin_v2::model::app_profile::multi_cluster_routing_use_any::RowAffinity;
let x = MultiClusterRoutingUseAny::new().set_row_affinity(RowAffinity::default()/* use setters */);
assert!(x.row_affinity().is_some());Trait Implementations§
Source§impl Clone for MultiClusterRoutingUseAny
impl Clone for MultiClusterRoutingUseAny
Source§fn clone(&self) -> MultiClusterRoutingUseAny
fn clone(&self) -> MultiClusterRoutingUseAny
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more