google-cloud-bigtable 2.11.1 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 181c696f1d64a700deb5f67d1016a4418fb204b3830da7ee07eac490b7215214
4
- data.tar.gz: 550c9917f375b880c02862916f15b22a7d5ebf82ee75c097d96160dc847a6b3d
3
+ metadata.gz: '0587331e991797446cc8d8b1893fb724de88f47f870ef27417f2e4aea60fe375'
4
+ data.tar.gz: e05005b9b777488a397aa8ef55a62c43b3e824856bd0b43e9994ce3790b16be2
5
5
  SHA512:
6
- metadata.gz: f0b52d13a6236bbf5ec702dd3e5f157113ae8a9926cf7450c5c5823d268066d12e3380fc6b79016d9e7e7298a6db540c2b8571032805c926fc3bafaec795d94c
7
- data.tar.gz: 9edb14a3040f7fff3ea9fb4b07efcdbd4dadc41bb687f2d9efc8a3c167b7a2e46d96fbff2293e0cd20ce2066149c8195bb3f588d9634ac5583e57a6be73a6e24
6
+ metadata.gz: 3bf97892a0fdc0da3d9203424add9273451a3239056adc5fc9eb8ac70c4b6a30e7b2e1430baf4cbd16237833d26aa29982b4de24f607dbd5f0d83ef7114bf6be
7
+ data.tar.gz: f1b805236765623233a094af1b79572e7693363cf32346a9632559a6826fe66f3c9ed754fb8326344fbdb3dd00af75f080142fc6dd315deff8eba19f1079e9b5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Release History
2
2
 
3
+ ### 2.12.1 (2025-08-12)
4
+
5
+ #### Bug Fixes
6
+
7
+ * Fix mutate rows logic to handle errors ([#30766](https://github.com/googleapis/google-cloud-ruby/issues/30766))
8
+
9
+ ### 2.12.0 (2025-02-25)
10
+
11
+ #### Features
12
+
13
+ * Provide easier access to the admin clients ([#28917](https://github.com/googleapis/google-cloud-ruby/issues/28917))
14
+ * Support for setting the universe domain ([#29173](https://github.com/googleapis/google-cloud-ruby/issues/29173))
15
+
3
16
  ### 2.11.1 (2024-12-12)
4
17
 
5
18
  #### Bug Fixes
data/OVERVIEW.md CHANGED
@@ -25,22 +25,34 @@ allocation of resources that are used by Cloud Bigtable. When you create an
25
25
  instance, you must specify at least one cluster. Clusters describe where your
26
26
  data is stored and how many nodes are used for your data.
27
27
 
28
- Use {Google::Cloud::Bigtable::Project#create_instance Project#create_instance}
29
- to create an instance. The following example creates a production instance with
30
- one cluster and three nodes:
28
+ To create an instance, use the instance admin client, which you can get from
29
+ {Google::Cloud::Bigtable::Project#instance_admin_client Project#instance_admin_client}.
30
+ The following example creates a production instance with one cluster and three
31
+ nodes:
31
32
 
32
33
  ```ruby
33
34
  require "google/cloud/bigtable"
34
35
 
35
36
  bigtable = Google::Cloud::Bigtable.new
37
+ instance_client = bigtable.instance_admin_client
36
38
 
37
- job = bigtable.create_instance(
38
- "my-instance",
39
+ instance_attrs = {
39
40
  display_name: "Instance for user data",
40
41
  labels: { "env" => "dev"}
41
- ) do |clusters|
42
- clusters.add("test-cluster", "us-east1-b", nodes: 3, storage_type: :SSD)
43
- end
42
+ }
43
+ clusters = {
44
+ "test-cluster" => {
45
+ location: "us-east1-b",
46
+ nodes: 3,
47
+ storage_type: :SSD
48
+ }
49
+ }
50
+ job = instance_client.create_instance(
51
+ parent: "projects/my-project",
52
+ instance_id: "my-instance",
53
+ instance: instance_attrs,
54
+ clusters: clusters
55
+ )
44
56
 
45
57
  job.done? #=> false
46
58
 
@@ -51,7 +63,7 @@ job.done? #=> true
51
63
  if job.error?
52
64
  status = job.error
53
65
  else
54
- instance = job.instance
66
+ instance = job.response.instance
55
67
  end
56
68
  ```
57
69
 
@@ -61,19 +73,28 @@ monitoring or throughput guarantees; replication is not available; and the SLA
61
73
  does not apply. When creating a development instance, you do not specify `nodes`
62
74
  for your clusters:
63
75
 
64
- ```ruby
76
+ ```ruby
65
77
  require "google/cloud/bigtable"
66
78
 
67
79
  bigtable = Google::Cloud::Bigtable.new
80
+ instance_client = bigtable.instance_admin_client
68
81
 
69
- job = bigtable.create_instance(
70
- "my-instance",
82
+ instance_attrs = {
71
83
  display_name: "Instance for user data",
72
84
  type: :DEVELOPMENT,
73
85
  labels: { "env" => "dev"}
74
- ) do |clusters|
75
- clusters.add("test-cluster", "us-east1-b") # nodes not allowed
76
- end
86
+ }
87
+ clusters = {
88
+ "test-cluster" => {
89
+ location: "us-east1-b", # nodes not allowed
90
+ }
91
+ }
92
+ job = instance_client.create_instance(
93
+ parent: "projects/my-project",
94
+ instance_id: "my-instance",
95
+ instance: instance_attrs,
96
+ clusters: clusters
97
+ )
77
98
 
78
99
  job.done? #=> false
79
100
 
@@ -84,9 +105,9 @@ job.done? #=> true
84
105
  if job.error?
85
106
  status = job.error
86
107
  else
87
- instance = job.instance
108
+ instance = job.response.instance
88
109
  end
89
- ```
110
+ ```
90
111
 
91
112
  You can upgrade a development instance to a production instance at any time.
92
113
 
@@ -105,20 +126,25 @@ different timestamps, providing a record of how the stored data has been altered
105
126
  over time. Cloud Bigtable tables are sparse; if a cell does not contain any
106
127
  data, it does not take up any space.
107
128
 
108
- Use {Google::Cloud::Bigtable::Project#create_table Project#create_table} or
109
- {Google::Cloud::Bigtable::Instance#create_table Instance#create_table} to
110
- create a table:
129
+ To create an instance, use the table admin client, which you can get from
130
+ {Google::Cloud::Bigtable::Project#table_admin_client Project#table_admin_client},
131
+ as illustrated in the following example:
111
132
 
112
133
  ```ruby
113
134
  require "google/cloud/bigtable"
114
135
 
115
136
  bigtable = Google::Cloud::Bigtable.new
137
+ table_client = bigtable.table_admin_client
138
+
139
+ instance_name = table_client.instance_path project: "my-project", instance: "my-instance"
140
+ table = table_client.create_table parent: instance_name,
141
+ table_id: "my-table",
142
+ table: {}
116
143
 
117
- table = bigtable.create_table("my-instance", "my-table")
118
144
  puts table.name
119
145
  ```
120
146
 
121
- When you create a table, you may specify the column families to use in the
147
+ When you create a table, you can specify the column families to use in the
122
148
  table, as well as a list of row keys that will be used to initially split the
123
149
  table into several tablets (tablets are similar to HBase regions):
124
150
 
@@ -126,45 +152,75 @@ table into several tablets (tablets are similar to HBase regions):
126
152
  require "google/cloud/bigtable"
127
153
 
128
154
  bigtable = Google::Cloud::Bigtable.new
129
-
130
- initial_splits = ["user-00001", "user-100000", "others"]
131
- table = bigtable.create_table("my-instance", "my-table", initial_splits: initial_splits) do |cfm|
132
- cfm.add('cf1', gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5))
133
- cfm.add('cf2', gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600))
134
-
135
- gc_rule = Google::Cloud::Bigtable::GcRule.union(
136
- Google::Cloud::Bigtable::GcRule.max_age(1800),
137
- Google::Cloud::Bigtable::GcRule.max_versions(3)
138
- )
139
- cfm.add('cf3', gc_rule: gc_rule)
140
- end
155
+ table_client = bigtable.table_admin_client
156
+
157
+ instance_name = table_client.instance_path project: "my-project", instance: "my-instance"
158
+ initial_splits = [
159
+ {key: "user-00001"},
160
+ {key: "user-100000"},
161
+ {key: "others"}
162
+ ]
163
+ column_families = {
164
+ "cf1" => {
165
+ gc_rule: Google::Cloud::Bigtable::Admin::V2::GcRule.max_num_versions(5)
166
+ },
167
+ "cf2" => {
168
+ gc_rule: Google::Cloud::Bigtable::Admin::V2::GcRule.max_age(600)
169
+ },
170
+ "cf3" => {
171
+ gc_rule: Google::Cloud::Bigtable::Admin::V2::GcRule.union(
172
+ Google::Cloud::Bigtable::Admin::V2::GcRule.max_age(1800),
173
+ Google::Cloud::Bigtable::Admin::V2::GcRule.max_num_versions(3)
174
+ )
175
+ }
176
+ }
177
+ table = table_client.create_table parent: instance_name,
178
+ table_id: "my-table",
179
+ table: {column_families: column_families},
180
+ initial_splits: initial_splits
141
181
 
142
182
  puts table
143
183
  ```
144
184
 
145
- You may also add, update, and delete column families later by passing a block to
146
- {Google::Cloud::Bigtable::Table#column_families Table#column_families}:
185
+ You can also add, update, and delete column families later:
147
186
 
148
187
  ```ruby
149
188
  require "google/cloud/bigtable"
150
189
 
151
190
  bigtable = Google::Cloud::Bigtable.new
152
-
153
- table = bigtable.table("my-instance", "my-table", perform_lookup: true)
154
-
155
- table.column_families do |cfm|
156
- cfm.add "cf4", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
157
- cfm.add "cf5", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
158
-
159
- rule_1 = Google::Cloud::Bigtable::GcRule.max_versions(3)
160
- rule_2 = Google::Cloud::Bigtable::GcRule.max_age(600)
161
- rule_union = Google::Cloud::Bigtable::GcRule.union(rule_1, rule_2)
162
- cfm.update "cf2", gc_rule: rule_union
163
-
164
- cfm.delete "cf3"
165
- end
166
-
167
- puts table.column_families["cf3"] #=> nil
191
+ table_client = bigtable.table_admin_client
192
+
193
+ table_name = table_client.table_path project: "my-project",
194
+ instance: "my-instance",
195
+ table: "my-table"
196
+ modifications = [
197
+ {
198
+ id: "cf4",
199
+ create: {
200
+ gc_rule: Google::Cloud::Bigtable::Admin::V2::GcRule.max_age(600)
201
+ }
202
+ },
203
+ {
204
+ id: "cf5",
205
+ create: {
206
+ gc_rule: Google::Cloud::Bigtable::Admin::V2::GcRule.max_num_versions(5)
207
+ }
208
+ },
209
+ {
210
+ id: "cf2",
211
+ update: {
212
+ gc_rule: Google::Cloud::Bigtable::Admin::V2::GcRule.union(
213
+ Google::Cloud::Bigtable::Admin::V2::GcRule.max_age(600),
214
+ Google::Cloud::Bigtable::Admin::V2::GcRule.max_num_versions(3)
215
+ )
216
+ }
217
+ },
218
+ {
219
+ id: "cf3",
220
+ drop: true
221
+ }
222
+ ]
223
+ table_client.modify_column_families name: table_name, modifications: modifications
168
224
  ```
169
225
 
170
226
  ## Writing data
@@ -94,12 +94,23 @@ module Google
94
94
  # or if family name or column qualifier are empty
95
95
  #
96
96
  def validate_new_row
97
- raise_if row.key, "A new row cannot have existing state"
98
- raise_if chunk.row_key.empty?, "A row key must be set"
99
- raise_if chunk.reset_row, "A new row cannot be reset"
100
- raise_if last_key == chunk.row_key, "A commit happened but the same key followed"
101
- raise_if chunk.family_name.nil?, "A family must be set"
102
- raise_if chunk.qualifier.nil?, "A column qualifier must be set"
97
+ validations = [
98
+ [row.key, "A new row cannot have existing state"],
99
+ [chunk.row_key.empty?, "A row key must be set"],
100
+ [chunk.reset_row, "A new row cannot be reset"],
101
+ [last_key == chunk.row_key, "A commit happened but the same key followed"],
102
+ [
103
+ last_key && chunk.row_key < last_key,
104
+ "Out of order row key, must be strictly increasing. " \
105
+ "New key: '#{chunk.row_key}', Previous key: '#{last_key}'"
106
+ ],
107
+ [chunk.family_name.nil?, "A family must be set"],
108
+ [chunk.qualifier.nil?, "A column qualifier must be set"]
109
+ ]
110
+
111
+ validations.each do |condition, message|
112
+ raise_if condition, message
113
+ end
103
114
  end
104
115
 
105
116
  ##
@@ -61,6 +61,41 @@ module Google
61
61
  @service = service
62
62
  end
63
63
 
64
+ ##
65
+ # Retrieve a client for instance administration. This client should be
66
+ # used for instance administration operations such as managing
67
+ # clusters, instances, and app profiles. See
68
+ # https://cloud.google.com/ruby/docs/reference/google-cloud-bigtable-admin-v2/latest/Google-Cloud-Bigtable-Admin-V2-BigtableInstanceAdmin-Client
69
+ # for documentation on this class.
70
+ #
71
+ # @return [Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client]
72
+ #
73
+ def instance_admin_client
74
+ service.instances
75
+ end
76
+
77
+ ##
78
+ # Retrieve a client for table administration. This client should be
79
+ # used for table administration operations such as managing tables,
80
+ # backups, snapshots, and authorized views. See
81
+ # https://cloud.google.com/ruby/docs/reference/google-cloud-bigtable-admin-v2/latest/Google-Cloud-Bigtable-Admin-V2-BigtableTableAdmin-Client
82
+ # for documentation on this class.
83
+ #
84
+ # @return [Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client]
85
+ #
86
+ def table_admin_client
87
+ service.tables
88
+ end
89
+
90
+ # The universe domain the client is connected to
91
+ #
92
+ # @return [String]
93
+ #
94
+ def universe_domain
95
+ ensure_service!
96
+ service.universe_domain
97
+ end
98
+
64
99
  ##
65
100
  # The identifier for the Cloud Bigtable project.
66
101
  #
@@ -39,6 +39,10 @@ module Google
39
39
  RETRY_LIMIT = 3
40
40
 
41
41
  # @private
42
+ # The prefix for routing cookies. Used to dynamically find cookie
43
+ # headers in metadata.
44
+ COOKIE_KEY_PREFIX = "x-goog-cbt-cookie"
45
+
42
46
  #
43
47
  # Creates a mutate rows instance.
44
48
  #
@@ -57,18 +61,20 @@ module Google
57
61
  #
58
62
  def apply_mutations
59
63
  @req_entries = @entries.map(&:to_grpc)
60
- statuses = mutate_rows @req_entries
64
+ statuses, delay, cookies = mutate_rows @req_entries
61
65
 
62
- # Collects retryable mutations indices.
63
66
  indices = statuses.each_with_object [] do |e, r|
64
67
  r << e.index if @entries[e.index].retryable? && RETRYABLE_CODES[e.status.code]
65
68
  end
66
69
 
67
70
  return statuses if indices.empty?
68
71
 
69
- (RETRY_LIMIT - 1).times do
72
+ RETRY_LIMIT.times do
70
73
  break if indices.empty?
71
- indices = retry_entries statuses, indices
74
+
75
+ sleep delay if delay
76
+
77
+ indices, delay, cookies = retry_entries statuses, indices, cookies
72
78
  end
73
79
 
74
80
  statuses
@@ -80,13 +86,35 @@ module Google
80
86
  # Mutates rows.
81
87
  #
82
88
  # @param entries [Array<Google::Cloud::Bigtable::MutationEntry>]
83
- # @return [Array<Google::Cloud::Bigtable::V2::MutateRowsResponse::Entry>]
89
+ # @param cookies [Hash]
90
+ # @return [Array<Google::Cloud::Bigtable::V2::MutateRowsResponse::Entry>, Float|nil, Hash]
84
91
  #
85
- def mutate_rows entries
86
- response = @table.service.mutate_rows @table.path, entries, app_profile_id: @table.app_profile_id
87
- response.each_with_object [] do |res, statuses|
88
- statuses.concat res.entries
92
+ def mutate_rows entries, cookies = {}
93
+ call_options = Gapic::CallOptions.new(metadata: cookies) unless cookies.empty?
94
+
95
+ response = @table.service.mutate_rows(
96
+ @table.path,
97
+ entries,
98
+ app_profile_id: @table.app_profile_id,
99
+ call_options: call_options
100
+ )
101
+ [response.flat_map(&:entries), nil, cookies]
102
+ rescue GRPC::BadStatus => e
103
+ info = e.status_details.find { |d| d.is_a? Google::Rpc::RetryInfo }
104
+ delay = if info&.retry_delay
105
+ info.retry_delay.seconds + (info.retry_delay.nanos / 1_000_000_000.0)
106
+ end
107
+
108
+ cookies.merge!(e.metadata.select { |k, _| k.start_with? COOKIE_KEY_PREFIX })
109
+
110
+ status = Google::Rpc::Status.new code: e.code, message: e.message
111
+ statuses = entries.map.with_index do |_, i|
112
+ Google::Cloud::Bigtable::V2::MutateRowsResponse::Entry.new(
113
+ index: i,
114
+ status: status
115
+ )
89
116
  end
117
+ [statuses, delay, cookies]
90
118
  end
91
119
 
92
120
  ##
@@ -94,18 +122,19 @@ module Google
94
122
  #
95
123
  # @param statuses [Array<Google::Cloud::Bigtable::V2::MutateRowsResponse::Entry>]
96
124
  # @param indices [Array<Integer>]
97
- # Retry entries position mapping list
98
- # @return [Array<Integer>]
99
- # New list of failed entries positions
125
+ # @param cookies [Hash]
126
+ # @return [Array<Integer>, Float|nil, Hash]
100
127
  #
101
- def retry_entries statuses, indices
128
+ def retry_entries statuses, indices, cookies
102
129
  entries = indices.map { |i| @req_entries[i] }
103
- retry_statuses = mutate_rows entries
130
+ retry_statuses, delay, cookies = mutate_rows entries, cookies
104
131
 
105
- retry_statuses.each_with_object [] do |e, next_indices|
106
- next_indices << indices[e.index] if RETRYABLE_CODES[e.status.code]
107
- statuses[indices[e.index]].status = e.status
132
+ next_indices = retry_statuses.each_with_object [] do |e, list|
133
+ next_index = indices[e.index]
134
+ statuses[next_index].status = e.status
135
+ list << next_index if RETRYABLE_CODES[e.status.code]
108
136
  end
137
+ [next_indices, delay, cookies]
109
138
  end
110
139
  end
111
140
  end
@@ -92,6 +92,10 @@ module Google
92
92
  yield row
93
93
  @rows_count += 1
94
94
  end
95
+
96
+ if res.last_scanned_row_key && !res.last_scanned_row_key.empty?
97
+ @chunk_processor.last_key = res.last_scanned_row_key
98
+ end
95
99
  end
96
100
 
97
101
  @chunk_processor.validate_last_row_complete
@@ -33,6 +33,11 @@ module Google
33
33
  # @private
34
34
  attr_accessor :project_id, :credentials, :host, :host_admin, :timeout
35
35
 
36
+ # @private
37
+ def universe_domain
38
+ tables.universe_domain
39
+ end
40
+
36
41
  # @private
37
42
  # Creates a new Service instance.
38
43
  #
@@ -53,7 +58,7 @@ module Google
53
58
  # The default timeout, in seconds, for calls made through this client.
54
59
  #
55
60
  def initialize project_id, credentials, host: nil, host_admin: nil, timeout: nil,
56
- channel_selection: nil, channel_count: nil
61
+ channel_selection: nil, channel_count: nil, universe_domain: nil
57
62
  @project_id = project_id
58
63
  @credentials = credentials
59
64
  @host = host
@@ -61,6 +66,7 @@ module Google
61
66
  @timeout = timeout
62
67
  @channel_selection = channel_selection
63
68
  @channel_count = channel_count
69
+ @universe_domain_override = universe_domain
64
70
  @bigtable_clients = ::Gapic::LruHash.new 10
65
71
  @mutex = Mutex.new
66
72
  end
@@ -68,6 +74,7 @@ module Google
68
74
  def instances
69
75
  return mocked_instances if mocked_instances
70
76
  @instances ||= Admin::V2::BigtableInstanceAdmin::Client.new do |config|
77
+ config.universe_domain = @universe_domain_override if @universe_domain_override
71
78
  config.credentials = credentials if credentials
72
79
  config.timeout = timeout if timeout
73
80
  config.endpoint = host_admin if host_admin
@@ -81,6 +88,7 @@ module Google
81
88
  def tables
82
89
  return mocked_tables if mocked_tables
83
90
  @tables ||= Admin::V2::BigtableTableAdmin::Client.new do |config|
91
+ config.universe_domain = @universe_domain_override if @universe_domain_override
84
92
  config.credentials = credentials if credentials
85
93
  config.timeout = timeout if timeout
86
94
  config.endpoint = host_admin if host_admin
@@ -681,14 +689,13 @@ module Google
681
689
  )
682
690
  end
683
691
 
684
- def mutate_rows table_name, entries, app_profile_id: nil
685
- client(table_name, app_profile_id).mutate_rows(
686
- **{
687
- table_name: table_name,
688
- app_profile_id: app_profile_id,
689
- entries: entries
690
- }.compact
691
- )
692
+ def mutate_rows table_name, entries, app_profile_id: nil, call_options: nil
693
+ request = {
694
+ table_name: table_name,
695
+ app_profile_id: app_profile_id,
696
+ entries: entries
697
+ }.compact
698
+ client(table_name, app_profile_id).mutate_rows request, call_options
692
699
  end
693
700
 
694
701
  def check_and_mutate_row table_name,
@@ -895,6 +902,7 @@ module Google
895
902
  def create_bigtable_client table_path, app_profile_id
896
903
  V2::Bigtable::Client.new do |config|
897
904
  config.credentials = credentials if credentials
905
+ config.universe_domain = @universe_domain_override if @universe_domain_override
898
906
  config.timeout = timeout if timeout
899
907
  config.endpoint = host if host
900
908
  config.lib_name = "gccl"
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigtable
19
- VERSION = "2.11.1".freeze
19
+ VERSION = "2.12.1".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -27,6 +27,9 @@ module Google
27
27
  # See {file:OVERVIEW.md Bigtable Overview}.
28
28
  #
29
29
  module Bigtable
30
+ # rubocop:disable Metrics/CyclomaticComplexity
31
+ # rubocop:disable Metrics/AbcSize
32
+
30
33
  ##
31
34
  # Service for managing Cloud Bigtable instances and tables and for reading from and
32
35
  # writing to Bigtable tables.
@@ -49,11 +52,12 @@ module Google
49
52
  # should already be composed with a `GRPC::Core::CallCredentials` object.
50
53
  # `Proc` will be used as an updater_proc for the gRPC channel. The proc transforms the
51
54
  # metadata for requests, generally, to give OAuth credentials.
52
- # @param [String] endpoint Override of the endpoint host name. Optional.
55
+ # @param universe_domain [String] Override of the universe domain. Optional.
56
+ # @param endpoint [String] Override of the endpoint host name. Optional.
53
57
  # If the param is nil, uses the default endpoint.
54
- # @param [String] endpoint_admin Override of the admin service endpoint host name. Optional.
58
+ # @param endpoint_admin [String] Override of the admin service endpoint host name. Optional.
55
59
  # If the param is nil, uses the default admin endpoint.
56
- # @param [String] emulator_host Bigtable emulator host. Optional.
60
+ # @param emulator_host [String] Bigtable emulator host. Optional.
57
61
  # If the parameter is nil, uses the value of the `emulator_host` config.
58
62
  # @param scope [Array<String>]
59
63
  # The OAuth 2.0 scopes controlling the set of resources and operations
@@ -74,10 +78,9 @@ module Google
74
78
  #
75
79
  # client = Google::Cloud::Bigtable.new
76
80
  #
77
- # rubocop:disable Metrics/CyclomaticComplexity
78
- # rubocop:disable Metrics/AbcSize
79
81
  def self.new project_id: nil,
80
82
  credentials: nil,
83
+ universe_domain: nil,
81
84
  emulator_host: nil,
82
85
  scope: nil,
83
86
  endpoint: nil,
@@ -86,6 +89,7 @@ module Google
86
89
  channel_selection: nil,
87
90
  channel_count: nil
88
91
  project_id ||= default_project_id
92
+ universe_domain ||= configure.universe_domain
89
93
  scope ||= configure.scope
90
94
  timeout ||= configure.timeout
91
95
  emulator_host ||= configure.emulator_host
@@ -100,8 +104,11 @@ module Google
100
104
  project_id = resolve_project_id project_id, credentials
101
105
  raise ArgumentError, "project_id is missing" if project_id.empty?
102
106
 
103
- service = Bigtable::Service.new project_id, credentials, host: endpoint,
104
- host_admin: endpoint_admin, timeout: timeout,
107
+ service = Bigtable::Service.new project_id, credentials,
108
+ universe_domain: universe_domain,
109
+ host: endpoint,
110
+ host_admin: endpoint_admin,
111
+ timeout: timeout,
105
112
  channel_selection: channel_selection,
106
113
  channel_count: channel_count
107
114
  Bigtable::Project.new service
@@ -109,7 +116,6 @@ module Google
109
116
  # rubocop:enable Metrics/CyclomaticComplexity
110
117
  # rubocop:enable Metrics/AbcSize
111
118
 
112
-
113
119
  ##
114
120
  # Configure the Google Cloud Bigtable library.
115
121
  #
@@ -171,8 +171,9 @@ Google::Cloud.configure.add_config! :bigtable do |config|
171
171
  config.add_field! :quota_project, nil, match: String
172
172
  config.add_field! :timeout, nil, match: Integer
173
173
  config.add_field! :emulator_host, default_emulator, match: String, allow_nil: true
174
- config.add_field! :endpoint, "bigtable.googleapis.com", match: String
175
- config.add_field! :endpoint_admin, "bigtableadmin.googleapis.com", match: String
174
+ config.add_field! :endpoint, nil, match: String
175
+ config.add_field! :endpoint_admin, nil, match: String
176
176
  config.add_field! :channel_selection, :least_loaded, match: Symbol
177
177
  config.add_field! :channel_count, 1, match: Integer
178
+ config.add_field! :universe_domain, nil, match: String, allow_nil: true
178
179
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-bigtable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.1
4
+ version: 2.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: concurrent-ruby
@@ -28,42 +27,30 @@ dependencies:
28
27
  name: google-cloud-bigtable-admin-v2
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0.0'
34
- - - "<"
30
+ - - "~>"
35
31
  - !ruby/object:Gem::Version
36
- version: 2.a
32
+ version: '1.7'
37
33
  type: :runtime
38
34
  prerelease: false
39
35
  version_requirements: !ruby/object:Gem::Requirement
40
36
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '0.0'
44
- - - "<"
37
+ - - "~>"
45
38
  - !ruby/object:Gem::Version
46
- version: 2.a
39
+ version: '1.7'
47
40
  - !ruby/object:Gem::Dependency
48
41
  name: google-cloud-bigtable-v2
49
42
  requirement: !ruby/object:Gem::Requirement
50
43
  requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0.14'
54
- - - "<"
44
+ - - "~>"
55
45
  - !ruby/object:Gem::Version
56
- version: 2.a
46
+ version: '1.5'
57
47
  type: :runtime
58
48
  prerelease: false
59
49
  version_requirements: !ruby/object:Gem::Requirement
60
50
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0.14'
64
- - - "<"
51
+ - - "~>"
65
52
  - !ruby/object:Gem::Version
66
- version: 2.a
53
+ version: '1.5'
67
54
  - !ruby/object:Gem::Dependency
68
55
  name: google-cloud-core
69
56
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +135,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-clo
148
135
  licenses:
149
136
  - Apache-2.0
150
137
  metadata: {}
151
- post_install_message:
152
138
  rdoc_options: []
153
139
  require_paths:
154
140
  - lib
@@ -156,15 +142,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
142
  requirements:
157
143
  - - ">="
158
144
  - !ruby/object:Gem::Version
159
- version: '2.7'
145
+ version: '3.0'
160
146
  required_rubygems_version: !ruby/object:Gem::Requirement
161
147
  requirements:
162
148
  - - ">="
163
149
  - !ruby/object:Gem::Version
164
150
  version: '0'
165
151
  requirements: []
166
- rubygems_version: 3.5.23
167
- signing_key:
152
+ rubygems_version: 3.6.9
168
153
  specification_version: 4
169
154
  summary: API Client library for Cloud Bigtable API
170
155
  test_files: []