Class: Google::Cloud::Bigtable::SingleClusterRouting
- Inherits:
-
RoutingPolicy
- Object
- RoutingPolicy
- Google::Cloud::Bigtable::SingleClusterRouting
- Defined in:
- lib/google/cloud/bigtable/routing_policy.rb
Overview
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.
Instance Attribute Summary collapse
-
#allow_transactional_writes ⇒ true, false
If true,
CheckAndMutateRowandReadModifyWriteRowrequests are allowed by this app profile. -
#cluster_id ⇒ String
The cluster to which read/write requests should be routed.
Instance Method Summary collapse
-
#initialize(cluster_id, allow_transactional_writes) ⇒ SingleClusterRouting
constructor
Creates a new single-cluster routing policy.
Constructor Details
#initialize(cluster_id, allow_transactional_writes) ⇒ SingleClusterRouting
Creates a new single-cluster routing policy.
158 159 160 161 162 |
# File 'lib/google/cloud/bigtable/routing_policy.rb', line 158 def initialize cluster_id, allow_transactional_writes super() @cluster_id = cluster_id @allow_transactional_writes = allow_transactional_writes end |
Instance Attribute Details
#allow_transactional_writes ⇒ true, false
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/google/cloud/bigtable/routing_policy.rb', line 143 class SingleClusterRouting < RoutingPolicy attr_reader :cluster_id attr_reader :allow_transactional_writes ## # Creates a new single-cluster routing policy. # # @param cluster_id [String] The cluster to which read/write requests # should be routed. # @param allow_transactional_writes [Boolean] # If true, `CheckAndMutateRow` and `ReadModifyWriteRow` 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. # def initialize cluster_id, allow_transactional_writes super() @cluster_id = cluster_id @allow_transactional_writes = allow_transactional_writes end # @private def to_grpc Google::Cloud::Bigtable::Admin::V2::AppProfile::SingleClusterRouting.new( cluster_id: cluster_id, allow_transactional_writes: allow_transactional_writes ) end end |
#cluster_id ⇒ String
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/google/cloud/bigtable/routing_policy.rb', line 143 class SingleClusterRouting < RoutingPolicy attr_reader :cluster_id attr_reader :allow_transactional_writes ## # Creates a new single-cluster routing policy. # # @param cluster_id [String] The cluster to which read/write requests # should be routed. # @param allow_transactional_writes [Boolean] # If true, `CheckAndMutateRow` and `ReadModifyWriteRow` 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. # def initialize cluster_id, allow_transactional_writes super() @cluster_id = cluster_id @allow_transactional_writes = allow_transactional_writes end # @private def to_grpc Google::Cloud::Bigtable::Admin::V2::AppProfile::SingleClusterRouting.new( cluster_id: cluster_id, allow_transactional_writes: allow_transactional_writes ) end end |