Reference documentation and code samples for the Cloud Bigtable API class Google::Cloud::Bigtable::SingleClusterRouting.
A single-cluster routing policy for all read/write requests that use the associated app profile.
Unconditionally routes all read/write requests to a specific cluster. This option preserves read-your-writes consistency, but does not improve availability.
Example
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new instance = bigtable.instance "my-instance" routing_policy = Google::Cloud::Bigtable::AppProfile.single_cluster_routing( "my-cluster", allow_transactional_writes: true ) app_profile = instance.create_app_profile( "my-app-profile", routing_policy, description: "App profile for user data instance" ) puts app_profile.routing_policy
Methods
#allow_transactional_writes
def allow_transactional_writes() -> true, false
Returns
-
(true, false) — If true,
CheckAndMutateRow
andReadModifyWriteRow
requests are allowed by this app profile. It is unsafe to send these requests to the same table/row/column in multiple clusters. Default value is false.
#allow_transactional_writes=
def allow_transactional_writes=(value) -> true, false
Parameter
-
value (true, false) — If true,
CheckAndMutateRow
andReadModifyWriteRow
requests are allowed by this app profile. It is unsafe to send these requests to the same table/row/column in multiple clusters. Default value is false.
Returns
-
(true, false) — If true,
CheckAndMutateRow
andReadModifyWriteRow
requests are allowed by this app profile. It is unsafe to send these requests to the same table/row/column in multiple clusters. Default value is false.
#cluster_id
def cluster_id() -> String
Returns
- (String) — The cluster to which read/write requests should be routed.
#cluster_id=
def cluster_id=(value) -> String
Parameter
- value (String) — The cluster to which read/write requests should be routed.
Returns
- (String) — The cluster to which read/write requests should be routed.
#initialize
def initialize(cluster_id, allow_transactional_writes) -> SingleClusterRouting
Creates a new single-cluster routing policy.
Parameters
- cluster_id (String) — The cluster to which read/write requests should be routed.
-
allow_transactional_writes (Boolean) — If true,
CheckAndMutateRow
andReadModifyWriteRow
requests are allowed by this app profile. It is unsafe to send these requests to the same table/row/column in multiple clusters. Default value is false.
Returns
- (SingleClusterRouting) — a new instance of SingleClusterRouting