google-cloud-bigtable 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/CHANGELOG.md +8 -0
  4. data/EMULATOR.md +30 -0
  5. data/OVERVIEW.md +2 -1
  6. data/lib/google-cloud-bigtable.rb +28 -22
  7. data/lib/google/cloud/bigtable.rb +25 -13
  8. data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client_config.json +14 -14
  9. data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client_config.json +5 -5
  10. data/lib/google/cloud/bigtable/app_profile.rb +14 -14
  11. data/lib/google/cloud/bigtable/app_profile/list.rb +9 -9
  12. data/lib/google/cloud/bigtable/chunk_processor.rb +6 -6
  13. data/lib/google/cloud/bigtable/cluster.rb +5 -5
  14. data/lib/google/cloud/bigtable/cluster/job.rb +1 -1
  15. data/lib/google/cloud/bigtable/cluster/list.rb +6 -6
  16. data/lib/google/cloud/bigtable/column_family.rb +12 -12
  17. data/lib/google/cloud/bigtable/column_range.rb +8 -8
  18. data/lib/google/cloud/bigtable/gc_rule.rb +2 -2
  19. data/lib/google/cloud/bigtable/instance.rb +34 -36
  20. data/lib/google/cloud/bigtable/instance/cluster_map.rb +5 -5
  21. data/lib/google/cloud/bigtable/instance/list.rb +9 -9
  22. data/lib/google/cloud/bigtable/longrunning_job.rb +1 -1
  23. data/lib/google/cloud/bigtable/mutation_entry.rb +18 -18
  24. data/lib/google/cloud/bigtable/mutation_operations.rb +25 -23
  25. data/lib/google/cloud/bigtable/policy.rb +13 -13
  26. data/lib/google/cloud/bigtable/project.rb +27 -27
  27. data/lib/google/cloud/bigtable/read_modify_write_rule.rb +6 -6
  28. data/lib/google/cloud/bigtable/read_operations.rb +13 -13
  29. data/lib/google/cloud/bigtable/row.rb +7 -7
  30. data/lib/google/cloud/bigtable/row_filter.rb +58 -58
  31. data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +40 -41
  32. data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +6 -6
  33. data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +46 -47
  34. data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +14 -15
  35. data/lib/google/cloud/bigtable/row_range.rb +16 -16
  36. data/lib/google/cloud/bigtable/rows_mutator.rb +5 -5
  37. data/lib/google/cloud/bigtable/rows_reader.rb +8 -9
  38. data/lib/google/cloud/bigtable/service.rb +153 -141
  39. data/lib/google/cloud/bigtable/table.rb +23 -23
  40. data/lib/google/cloud/bigtable/table/cluster_state.rb +2 -2
  41. data/lib/google/cloud/bigtable/table/column_family_map.rb +5 -5
  42. data/lib/google/cloud/bigtable/table/list.rb +8 -8
  43. data/lib/google/cloud/bigtable/value_range.rb +7 -7
  44. data/lib/google/cloud/bigtable/version.rb +1 -1
  45. metadata +5 -4
@@ -24,7 +24,7 @@ module Google
24
24
  #
25
25
  class SimpleFilter
26
26
  # @private
27
- # Create simple filter instance.
27
+ # Creates a simple filter instance.
28
28
  #
29
29
  def initialize
30
30
  @grpc = Google::Bigtable::V2::RowFilter.new
@@ -59,7 +59,7 @@ module Google
59
59
  self
60
60
  end
61
61
 
62
- # Replaces each cell's value with the empty string.
62
+ # Replaces each cell's value with an empty string.
63
63
  #
64
64
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
65
65
  #
@@ -155,12 +155,11 @@ module Google
155
155
  # Values must be at most 15 characters in length, and match the RE2
156
156
  # pattern `[a-z0-9\\-]+`
157
157
  #
158
- # Due to a technical limitation, it is not currently possible to apply
159
- # multiple labels to a cell. As a result, a Chain may have no more than
160
- # one sub-filter which contains a `apply_label_transformer`. It is okay for
161
- # an Interleave to contain multiple `apply_label_transformers`, as they
162
- # will be applied to separate copies of the input. This may be relaxed in
163
- # the future.
158
+ # Due to a technical limitation, it is not possible to apply
159
+ # multiple labels to a cell. As a result, a chain may have no more than
160
+ # one sub-filter whithatch contains an `apply_label_transformer`. It is okay for
161
+ # an interleave to contain multiple `apply_label_transformers`, as they
162
+ # will be applied to separate copies of the input.
164
163
  #
165
164
  # @param value [String] Label name
166
165
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
@@ -171,7 +170,7 @@ module Google
171
170
  end
172
171
 
173
172
  # Skips the first N cells of each row, matching all subsequent cells.
174
- # If duplicate cells are present, as is possible when using an Interleave,
173
+ # If duplicate cells are present, as is possible when using an interleave,
175
174
  # each copy of the cell is counted separately.
176
175
  #
177
176
  # @param offset [Integer] Offset value.
@@ -198,7 +197,7 @@ module Google
198
197
  # if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
199
198
  # skip all earlier cells in `foo:bar`, and then begin matching again in
200
199
  # column `foo:bar2`.
201
- # If duplicate cells are present, as is possible when using an Interleave,
200
+ # If duplicate cells are present, as is possible when using an interleave,
202
201
  # each copy of the cell is counted separately.
203
202
  #
204
203
  # @param limit [String] Max cell match per column limit
@@ -209,10 +208,10 @@ module Google
209
208
  self
210
209
  end
211
210
 
212
- # Create timestamp range filter instance
211
+ # Creates a timestamp-range filter instance.
213
212
  #
214
213
  # Matches only cells with timestamps within the given range.
215
- # Specified a contiguous range of timestamps.
214
+ # Specifies a contiguous range of timestamps.
216
215
  #
217
216
  # @param from [Integer] Inclusive lower bound. If left empty, interpreted as 0.
218
217
  # @param to [Integer] Exclusive upper bound. If left empty, interpreted as infinity.
@@ -231,8 +230,8 @@ module Google
231
230
  # See {Google::Cloud::Bigtable::ValueRange#from} and { Google::Cloud::Bigtable::ValueRange#to} for range
232
231
  # option inclusive/exclusive options
233
232
  #
234
- # * The value at which to start the range.If neither field is set, interpreted as the empty string, inclusive.
235
- # * The value at which to end the range. If neither field is set, interpreted as the infinite string, exclusive.
233
+ # * The value at which to start the range. If neither field is set, interpreted as an empty string, inclusive.
234
+ # * The value at which to end the range. If neither field is set, interpreted as an infinite string, exclusive.
236
235
  #
237
236
  # @param range [Google::Cloud::Bigtable::ValueRange]
238
237
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
@@ -260,7 +259,7 @@ module Google
260
259
 
261
260
  # @private
262
261
  #
263
- # Convet to gRPC row filter instance.
262
+ # Converts to a gRPC row filter instance.
264
263
  #
265
264
  # @return [Google::Bigtable::V2::RowFilter]
266
265
  def to_grpc
@@ -20,8 +20,8 @@ module Google
20
20
  #
21
21
  # Specifies a contiguous range of rows.
22
22
  #
23
- # * from key bound : The row key at which to from the range.
24
- # If neither field is set, interpreted as the empty string, inclusive.
23
+ # * From key bound : The row key at which to begin the range.
24
+ # If neither field is set, interpreted as an empty string, inclusive.
25
25
  # * End key bound: The row key at which to end the range.
26
26
  # If neither field is set, interpreted as the infinite row key, exclusive.
27
27
  #
@@ -54,16 +54,16 @@ module Google
54
54
  #
55
55
  class RowRange
56
56
  # @private
57
- # Create row range instance.
57
+ # Creates a row range instance.
58
58
  def initialize
59
59
  @grpc = Google::Bigtable::V2::RowRange.new
60
60
  end
61
61
 
62
- # Set row range with the lower bound.
62
+ # Sets a row range with a lower bound.
63
63
  #
64
- # @param key [String] Row key. Required
65
- # @param inclusive [String] Inclusive/Exclusive lower bound.
66
- # Default it is an inclusive lower bound.
64
+ # @param key [String] Row key. Required.
65
+ # @param inclusive [String] Inclusive/exclusive lower bound.
66
+ # Default is an inclusive lower bound.
67
67
  # @return [Google::Cloud::Bigtable::RowRange]
68
68
  #
69
69
  # @example Inclusive lower bound.
@@ -91,9 +91,9 @@ module Google
91
91
  self
92
92
  end
93
93
 
94
- # Set row range with the upper bound.
94
+ # Sets a row range with an upper bound.
95
95
  #
96
- # @param key [String] Row key. Required
96
+ # @param key [String] Row key. Required.
97
97
  # @param inclusive [String] Inclusive/Exclusive upper bound.
98
98
  # Default it is an exclusive upper bound.
99
99
  # @return [Google::Cloud::Bigtable::RowRange]
@@ -123,12 +123,12 @@ module Google
123
123
  self
124
124
  end
125
125
 
126
- # Set row range with the inclusive upper and lower bounds.
126
+ # Sets a row range with inclusive upper and lower bounds.
127
127
  #
128
- # @param from_key [String] Inclusive from row key. Required
129
- # @param to_key [String] Inclusive end row key. Required
128
+ # @param from_key [String] Inclusive from row key. Required.
129
+ # @param to_key [String] Inclusive end row key. Required.
130
130
  # @return [Google::Cloud::Bigtable::RowRange]
131
- # Range with inclusive from and end row key.
131
+ # Range with inclusive from and end row keys.
132
132
  #
133
133
  # @example
134
134
  # require "google/cloud/bigtable"
@@ -142,10 +142,10 @@ module Google
142
142
  from(from_key).to(to_key, inclusive: true)
143
143
  end
144
144
 
145
- # Set row range with the inclusive lower and the exclusive upper bound.
145
+ # Sets a row range with an inclusive lower bound and an exclusive upper bound.
146
146
  #
147
- # @param from_key [String] Inclusive from row key
148
- # @param to_key [String] Exclusive end row key
147
+ # @param from_key [String] Inclusive from row key.
148
+ # @param to_key [String] Exclusive end row key.
149
149
  # @return [Google::Cloud::Bigtable::RowRange]
150
150
  # Range with inclusive from and exclusive end row key.
151
151
  #
@@ -40,7 +40,7 @@ module Google
40
40
 
41
41
  # @private
42
42
  #
43
- # Create mutate rows instance
43
+ # Creates a mutate rows instance.
44
44
  #
45
45
  # @param table [Google::Cloud::Bigtable::TableDataOperations]
46
46
  # @param entries [Array<Google::Cloud::Bigtable::MutationEntry>]
@@ -50,7 +50,7 @@ module Google
50
50
  @entries = entries
51
51
  end
52
52
 
53
- # Apply mutations.
53
+ # Applies mutations.
54
54
  #
55
55
  # @return [Array<Google::Bigtable::V2::MutateRowsResponse::Entry>]
56
56
  #
@@ -58,7 +58,7 @@ module Google
58
58
  @req_entries = @entries.map(&:to_grpc)
59
59
  statuses = mutate_rows(@req_entries)
60
60
 
61
- # Collect retryable mutations indices
61
+ # Collects retryable mutations indices.
62
62
  indices = statuses.each_with_object([]) do |e, r|
63
63
  if @entries[e.index].retryable? && RETRYABLE_CODES[e.status.code]
64
64
  r << e.index
@@ -77,7 +77,7 @@ module Google
77
77
 
78
78
  private
79
79
 
80
- # Mutate rows
80
+ # Mutates rows.
81
81
  #
82
82
  # @param entries [Array<Google::Cloud::Bigtable::MutationEntry>]
83
83
  # @return [Array<Google::Bigtable::V2::MutateRowsResponse::Entry>]
@@ -97,7 +97,7 @@ module Google
97
97
  raise Google::Cloud::Error.from_error(e)
98
98
  end
99
99
 
100
- # Collected failed entries, retry mutation and update status
100
+ # Collects failed entries, retries mutation, and updates status.
101
101
  #
102
102
  # @param statuses [Array<Google::Bigtable::V2::MutateRowsResponse::Entry>]
103
103
  # @param indices [Array<Integer>]
@@ -45,7 +45,7 @@ module Google
45
45
 
46
46
  # @private
47
47
  #
48
- # Create read rows instance
48
+ # Creates a read rows instance.
49
49
  #
50
50
  # @param table [Google::Cloud::Bigtable::TableDataOperations]
51
51
  #
@@ -61,12 +61,11 @@ module Google
61
61
  # @param rows [Google::Bigtable::V2::RowSet]
62
62
  # The row keys and/or ranges to read.
63
63
  # If not specified, reads from all rows.
64
- # A hash of the same form as `Google::Bigtable::V2::RowSet`
65
- # can also be provided.
64
+ # Alternatively, provide a hash in the form of `Google::Bigtable::V2::RowSet`.
66
65
  # @param filter [Google::Bigtable::V2::RowFilter | Hash]
67
66
  # The filter to apply to the contents of the specified row(s). If unset,
68
67
  # reads the entirety of each row.
69
- # A hash of the same form as `Google::Bigtable::V2::RowFilter`
68
+ # A hash in the form of `Google::Bigtable::V2::RowFilter`
70
69
  # can also be provided.
71
70
  # @param rows_limit [Integer]
72
71
  # The read will terminate after committing to N rows' worth of results.
@@ -98,7 +97,7 @@ module Google
98
97
  @chunk_processor.validate_last_row_complete
99
98
  end
100
99
 
101
- # Last read row key
100
+ # Last read row key.
102
101
  #
103
102
  # @return [String]
104
103
 
@@ -106,7 +105,7 @@ module Google
106
105
  @chunk_processor.last_key
107
106
  end
108
107
 
109
- # Calucate and return read rows limit and row set based on last read key
108
+ # Calucates and returns the read rows limit and row set based on last read key.
110
109
  #
111
110
  # @param rows_limit [Integer]
112
111
  # The read will terminate after committing to N rows' worth of results.
@@ -152,7 +151,7 @@ module Google
152
151
  [rows_limit, row_set]
153
152
  end
154
153
 
155
- # Check if read operation is retryable.
154
+ # Checks if a read operation is retryable.
156
155
  #
157
156
  # @return [Boolean]
158
157
  def retryable?
@@ -161,7 +160,7 @@ module Google
161
160
 
162
161
  private
163
162
 
164
- # Check start key already read for range
163
+ # Checks if the start key was already read for the range.
165
164
  #
166
165
  # @param range [Google::Bigtable::V2::RowRange]
167
166
  # @return [Boolean]
@@ -176,7 +175,7 @@ module Google
176
175
  start_key.empty? || last_key >= start_key
177
176
  end
178
177
 
179
- # Check end key already read for range
178
+ # Checks if the end key was already read for the range.
180
179
  #
181
180
  # @param range [Google::Bigtable::V2::RowRange]
182
181
  # @return [Boolean]
@@ -26,82 +26,104 @@ module Google
26
26
  module Cloud
27
27
  module Bigtable
28
28
  # @private
29
- # Represents the gRPC Bigtable service, including all the API methods.
29
+ # gRPC Cloud Bigtable service, including API methods.
30
30
  class Service
31
31
  # @private
32
- attr_accessor :project_id, :credentials, :timeout, :client_config
32
+ attr_accessor :project_id, :credentials, :host, :timeout, :client_config
33
33
 
34
34
  # @private
35
35
  # Creates a new Service instance.
36
36
  #
37
37
  # @param project_id [String] Project identifier
38
38
  # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
39
- # Provides the means for authenticating requests made by the client. This parameter can
40
- # be many types.
41
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
39
+ # The means for authenticating requests made by the client. This parameter can
40
+ # be one of the following types.
41
+ # `Google::Auth::Credentials` uses the properties of its represented keyfile for
42
42
  # authenticating requests made by this client.
43
- # A `String` will be treated as the path to the keyfile to be used for the construction of
43
+ # `String` will be treated as the path to the keyfile to use to construct
44
44
  # credentials for this client.
45
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
45
+ # `Hash` will be treated as the contents of a keyfile to use to construct
46
46
  # credentials for this client.
47
- # A `GRPC::Core::Channel` will be used to make calls through.
48
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
47
+ # `GRPC::Core::Channel` will be used to make calls through.
48
+ # `GRPC::Core::ChannelCredentials` will be used to set up the gRPC client. The channel credentials
49
49
  # should already be composed with a `GRPC::Core::CallCredentials` object.
50
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
50
+ # `Proc` will be used as an updater_proc for the gRPC channel. The proc transforms the
51
51
  # metadata for requests, generally, to give OAuth credentials.
52
52
  # @param timeout [Integer]
53
53
  # The default timeout, in seconds, for calls made through this client.
54
54
  # @param client_config [Hash]
55
- # A Hash for call options for each method.
55
+ # A hash for call options for each method.
56
56
  # See Google::Gax#construct_settings for the structure of
57
57
  # this data. Falls back to the default config if not specified
58
58
  # or the specified config is missing data points.
59
59
 
60
- def initialize project_id, credentials, timeout: nil, client_config: nil
60
+ def initialize project_id, credentials, host: nil, timeout: nil,
61
+ client_config: nil
61
62
  @project_id = project_id
62
63
  @credentials = credentials
64
+ @host = host
63
65
  @timeout = timeout
64
66
  @client_config = client_config || {}
65
67
  end
66
68
 
67
- # Create or return existing instance of instance admin client.
69
+ def channel default_host
70
+ require "grpc"
71
+ GRPC::Core::Channel.new((host || default_host), nil, chan_creds)
72
+ end
73
+
74
+ def chan_creds
75
+ return credentials if insecure?
76
+ require "grpc"
77
+ GRPC::Core::ChannelCredentials.new.compose \
78
+ GRPC::Core::CallCredentials.new credentials.client.updater_proc
79
+ end
80
+
81
+ # Creates or returns an instance of an instance admin client.
68
82
  #
69
83
  # @return [Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdminClient]
70
84
 
71
85
  def instances
72
- @instances ||= \
86
+ @instances ||= begin
87
+ instances_channel = channel(
88
+ Admin::V2::BigtableInstanceAdminClient::SERVICE_ADDRESS
89
+ )
73
90
  Admin::V2::BigtableInstanceAdminClient.new(
74
- credentials: credentials,
91
+ credentials: instances_channel,
75
92
  timeout: timeout,
76
93
  client_config: client_config,
77
94
  lib_name: "gccl",
78
95
  lib_version: Google::Cloud::Bigtable::VERSION
79
96
  )
97
+ end
80
98
  end
81
99
 
82
- # Create or return existing instance of table admin client.
100
+ # Creates or returns an instance of a table admin client.
83
101
  #
84
102
  # @return [Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient]
85
103
 
86
104
  def tables
87
- @tables ||= \
105
+ @tables ||= begin
106
+ tables_channel = channel(
107
+ Admin::V2::BigtableTableAdminClient::SERVICE_ADDRESS
108
+ )
88
109
  Admin::V2::BigtableTableAdminClient.new(
89
- credentials: credentials,
110
+ credentials: tables_channel,
90
111
  timeout: timeout,
91
112
  client_config: client_config,
92
113
  lib_name: "gccl",
93
114
  lib_version: Google::Cloud::Bigtable::VERSION
94
115
  )
116
+ end
95
117
  end
96
118
 
97
- # Create instance of data client.
119
+ # Creates an instance of a data client.
98
120
  #
99
121
  # @return [Google::Cloud::Bigtable::V2::BigtableClient]
100
122
 
101
123
  def client
102
124
  @client ||= \
103
125
  V2::BigtableClient.new(
104
- credentials: credentials,
126
+ credentials: channel(V2::BigtableClient::SERVICE_ADDRESS),
105
127
  timeout: timeout,
106
128
  client_config: client_config,
107
129
  lib_name: "gccl",
@@ -109,20 +131,21 @@ module Google
109
131
  )
110
132
  end
111
133
 
112
- # Create an instance within a project.
134
+ def insecure?
135
+ credentials == :this_channel_is_insecure
136
+ end
137
+ # Creates an instance within a project.
113
138
  #
114
139
  # @param instance_id [String]
115
- # The ID to be used when referring to the new instance within its project.
116
- # e.g., +myinstance+
140
+ # The permanent identifier to be used for the new instance.
141
+ #
117
142
  # @param instance [Google::Bigtable::Admin::V2::Instance | Hash]
118
143
  # @param clusters [Hash{String => Google::Bigtable::Admin::V2::Cluster | Hash}]
119
- # The clusters to be created within the instance, mapped by desired
120
- # cluster ID, e.g., just +mycluster+ rather than
144
+ # The clusters to be created in the instance.
145
+ # Note that the cluster ID is the last segment of a cluster name. In the
146
+ # following cluster name, 'mycluster' is the cluster ID:
121
147
  # +projects/myproject/instances/myinstance/clusters/mycluster+.
122
- # Fields marked +OutputOnly+ must be left blank.
123
- # Currently exactly one cluster must be specified.
124
- # A hash of the same form as `Google::Bigtable::Admin::V2::Cluster`
125
- # can also be provided.
148
+ # Alternatively, provide a hash in the form of `Google::Bigtable::Admin::V2::Cluster`
126
149
  # @return [Google::Gax::Operation]
127
150
 
128
151
  def create_instance \
@@ -139,7 +162,7 @@ module Google
139
162
  end
140
163
  end
141
164
 
142
- # Lists information about instances in a project.
165
+ # Lists the instances in a project.
143
166
  #
144
167
  # @param token [String]
145
168
  # The value of +next_page_token+ returned by a previous call.
@@ -157,7 +180,7 @@ module Google
157
180
  # Gets information about an instance.
158
181
  #
159
182
  # @param instance_id [String]
160
- # The unique ID of the requested instance.
183
+ # Unique ID of the requested instance.
161
184
  # @return [Google::Bigtable::Admin::V2::Instance]
162
185
 
163
186
  def get_instance instance_id
@@ -168,17 +191,15 @@ module Google
168
191
  end
169
192
  end
170
193
 
171
- # Partially updates an instance within a project.
194
+ # Partially updates an instance.
172
195
  #
173
196
  # @param instance [Google::Bigtable::Admin::V2::Instance | Hash]
174
- # The Instance which will (partially) replace the current value.
175
- # A hash of the same form as `Google::Bigtable::Admin::V2::Instance`
176
- # can also be provided.
197
+ # The instance that will (partially) replace the current value.
198
+ # Alternatively, provide a hash in the form of `Google::Bigtable::Admin::V2::Instance.
177
199
  # @param update_mask [Google::Protobuf::FieldMask | Hash]
178
- # The subset of Instance fields which should be replaced.
200
+ # List of instance properties to be replaced.
179
201
  # Must be explicitly set.
180
- # A hash of the same form as `Google::Protobuf::FieldMask`
181
- # can also be provided.
202
+ # Alternatively, provide a hash in the form of `Google::Protobuf::FieldMask`.
182
203
  # @return [Google::Gax::Operation]
183
204
 
184
205
  def partial_update_instance instance, update_mask
@@ -187,10 +208,10 @@ module Google
187
208
  end
188
209
  end
189
210
 
190
- # Delete an instance from a project.
211
+ # Deletes an instance from a project.
191
212
  #
192
213
  # @param instance_id [String]
193
- # The unique Id of the instance to be deleted.
214
+ # Unique ID of the instance to be deleted.
194
215
 
195
216
  def delete_instance instance_id
196
217
  execute do
@@ -200,18 +221,16 @@ module Google
200
221
  end
201
222
  end
202
223
 
203
- # Create a cluster within an instance.
224
+ # Creates a cluster within an instance.
204
225
  #
205
226
  # @param instance_id [String]
206
- # The unique name of the instance in which to create the new cluster
227
+ # Unique ID of the instance in which to create the new cluster
207
228
  # @param cluster_id [String]
208
- # The ID to be used when referring to the new cluster within its instance,
209
- # e.g., just +mycluster+
229
+ # Unique permanent identifier for the new cluster
210
230
  # @param cluster [Google::Bigtable::Admin::V2::Cluster | Hash]
211
231
  # The cluster to be created.
212
- # Fields marked +OutputOnly+ must be left blank.
213
- # A hash of the same form as `Google::Bigtable::Admin::V2::Cluster`
214
- # can also be provided.
232
+ # Alternatively, provide a hash in the form of `Google::Bigtable::Admin::V2::Cluster`
233
+ #
215
234
  # @return [Google::Gax::Operation]
216
235
 
217
236
  def create_cluster instance_id, cluster_id, cluster
@@ -231,7 +250,7 @@ module Google
231
250
  # Lists information about clusters in an instance.
232
251
  #
233
252
  # @param instance_id [String]
234
- # The unique name of the instance for which a list of clusters is requested.
253
+ # Unique ID of the instance for which a list of clusters is requested.
235
254
  # @param token [String]
236
255
  # The value of +next_page_token+ returned by a previous call.
237
256
  # @return [Google::Bigtable::Admin::V2::ListClustersResponse]
@@ -248,9 +267,9 @@ module Google
248
267
  # Gets information about a cluster.
249
268
  #
250
269
  # @param instance_id [String]
251
- # The unique Id of the instance.
270
+ # Unique ID of the instance the cluster is in.
252
271
  # @param cluster_id [String]
253
- # The unique Id of the requested cluster.
272
+ # Unique ID of the requested cluster.
254
273
  # @return [Google::Bigtable::Admin::V2::Cluster]
255
274
 
256
275
  def get_cluster instance_id, cluster_id
@@ -264,14 +283,14 @@ module Google
264
283
  # Updates a cluster within an instance.
265
284
  #
266
285
  # @param instance_id [String]
267
- # The unique Id of the instance.
286
+ # Unique ID of the instance the cluster is in.
268
287
  # @param cluster_id [String]
269
- # The unique Id of the cluster.
288
+ # Unique ID of the cluster.
270
289
  # @param location [String]
271
- # The location where this cluster's nodes and storage reside. For best
290
+ # Location of this cluster's nodes and storage. For best
272
291
  # performance, clients should be located as close as possible to this
273
- # cluster. Currently only zones are supported, so values should be of the
274
- # form +projects/<project>/locations/<zone>+.
292
+ # cluster. Requird format for the location string:
293
+ # +projects/<project>/locations/<zone>+.
275
294
  # @param serve_nodes [Integer]
276
295
  # The number of nodes allocated to this cluster. More nodes enable higher
277
296
  # throughput and more consistent performance.
@@ -290,9 +309,9 @@ module Google
290
309
  # Deletes a cluster from an instance.
291
310
  #
292
311
  # @param instance_id [String]
293
- # The unique Id of the instance in which cluster present.
312
+ # Unique ID of the instance the cluster is in.
294
313
  # @param cluster_id [String]
295
- # The unique Id of the cluster to be deleted.
314
+ # Unique ID of the cluster to be deleted.
296
315
 
297
316
  def delete_cluster instance_id, cluster_id
298
317
  execute do
@@ -303,18 +322,15 @@ module Google
303
322
  end
304
323
 
305
324
  # Creates a new table in the specified instance.
306
- # The table can be created with a full set of initial column families,
307
- # specified in the request.
325
+ # Optionally, creates the table with a full set of initial column families.
308
326
  #
309
327
  # @param instance_id [String]
310
- # The unique Id of the instance in which to create the table.
328
+ # Unique ID of the instance to create the table in.
311
329
  # @param table_id [String]
312
- # The name by which the new table should be referred to within the parent
313
- # instance, e.g., +foobar+
330
+ # Unique, permanent identifier for the new table.
314
331
  # @param table [Google::Bigtable::Admin::V2::Table | Hash]
315
- # The Table to create.
316
- # A hash of the same form as `Google::Bigtable::Admin::V2::Table`
317
- # can also be provided.
332
+ # The table to create.
333
+ # Alternatively, provide a hash in the form of `Google::Bigtable::Admin::V2::Table`.
318
334
  # @param initial_splits [Array<Google::Bigtable::Admin::V2::CreateTableRequest::Split | Hash>]
319
335
  # The optional list of row keys that will be used to initially split the
320
336
  # table into several tablets (tablets are similar to HBase regions).
@@ -332,8 +348,8 @@ module Google
332
348
  # * Tablet 3 +[customer_1, customer_2) => {"customer_1"}.+
333
349
  # * Tablet 4 +[customer_2, other) => {"customer_2"}.+
334
350
  # * Tablet 5 +[other, ) => {"other", "zz"}.+
335
- # A hash of the same form as `Google::Bigtable::Admin::V2::CreateTableRequest::Split`
336
- # can also be provided.
351
+ # Alternatively, provide a hash in the form of
352
+ # `Google::Bigtable::Admin::V2::CreateTableRequest::Split`
337
353
  # @return [Google::Bigtable::Admin::V2::Table]
338
354
 
339
355
  def create_table \
@@ -355,17 +371,17 @@ module Google
355
371
  end
356
372
  end
357
373
 
358
- # Lists all tables served from a specified instance.
374
+ # Lists all tables in an instance.
359
375
  #
360
376
  # @param instance_id [String]
361
- # The unique Id of the instance for which tables should be listed.
377
+ # Unique ID of the instance for which tables should be listed.
362
378
  # @param view [Google::Bigtable::Admin::V2::Table::View]
363
- # The view to be applied to the returned tables' fields.
379
+ # View to be applied to the returned tables' fields.
364
380
  # Defaults to +NAME_ONLY+ if unspecified; no others are currently supported.
365
381
  # @return [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Table>]
366
382
  # An enumerable of Google::Bigtable::Admin::V2::Table instances.
367
383
  # See Google::Gax::PagedEnumerable documentation for other
368
- # operations such as per-page iteration or access to the response
384
+ # operations such as per-page iteration or access to the response.
369
385
 
370
386
  def list_tables instance_id, view: nil
371
387
  execute do
@@ -376,14 +392,14 @@ module Google
376
392
  end
377
393
  end
378
394
 
379
- # Gets metadata information about the specified table.
395
+ # Gets metadata about the specified table.
380
396
  #
381
397
  # @param instance_id [String]
382
- # The unique Id of the instance in which table is exists.
398
+ # Unique ID of the instance the table is in.
383
399
  # @param table_id [String]
384
- # The unique Id of the requested table.
400
+ # Unique ID of the requested table.
385
401
  # @param view [Google::Bigtable::Admin::V2::Table::View]
386
- # The view to be applied to the returned table's fields.
402
+ # View to be applied to the returned table's fields.
387
403
  # Defaults to +SCHEMA_VIEW+ if unspecified.
388
404
  # @return [Google::Bigtable::Admin::V2::Table]
389
405
 
@@ -396,12 +412,12 @@ module Google
396
412
  end
397
413
  end
398
414
 
399
- # Permanently deletes a specified table and all of its data.
415
+ # Permanently deletes a table and all of its data.
400
416
  #
401
417
  # @param instance_id [String]
402
- # The unique Id of the instance in which table is exists.
418
+ # Unique ID of the instance the table is in.
403
419
  # @param table_id [String]
404
- # The unique Id of the table to be deleted.
420
+ # Unique ID of the table to be deleted.
405
421
 
406
422
  def delete_table instance_id, table_id
407
423
  execute do
@@ -413,20 +429,20 @@ module Google
413
429
 
414
430
  # Performs a series of column family modifications on the specified table.
415
431
  # Either all or none of the modifications will occur before this method
416
- # returns, but data requests received prior to that point may see a table
417
- # where only some modifications have taken effect.
432
+ # returns. Data requests received prior to completion of this method may reach a table
433
+ # in which only some modifications have taken effect.
418
434
  #
419
435
  # @param instance_id [String]
420
- # The unique Id of the instance in which table is exists.
436
+ # Unique ID of the instance the table is in.
421
437
  # @param table_id [String]
422
- # The unique Id of the table whose families should be modified.
438
+ # Unique ID of the table whose families should be modified.
423
439
  # @param modifications [Array<Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification | Hash>]
424
440
  # Modifications to be atomically applied to the specified table's families.
425
441
  # Entries are applied in order, meaning that earlier modifications can be
426
442
  # masked by later ones (in the case of repeated updates to the same family,
427
443
  # for example).
428
- # A hash of the same form as `Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification`
429
- # can also be provided.
444
+ # Alternatively, provide a hash in the form of
445
+ # `Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification`.
430
446
  # @return [Google::Bigtable::Admin::V2::Table]
431
447
 
432
448
  def modify_column_families instance_id, table_id, modifications
@@ -438,15 +454,15 @@ module Google
438
454
  end
439
455
  end
440
456
 
441
- # Generates a consistency token for a Table, which can be used in
442
- # CheckConsistency to check whether mutations to the table that finished
443
- # before this call started have been replicated. The tokens will be available
444
- # for 90 days.
457
+ # Generates a consistency token for a table.
458
+ # The consistency token can be be used in CheckConsistency to check whether
459
+ # mutations to the table that finished before this call started have been replicated.
460
+ # The token will be available for 90 days.
445
461
  #
446
462
  # @param instance_id [String]
447
- # The unique Id of the instance in which table is exists.
463
+ # Unique ID of the instance the table is in.
448
464
  # @param table_id [String]
449
- # The unique Id of the Table for which to create a consistency token.
465
+ # Unique ID of the table the consistency token is for.
450
466
  # @return [Google::Bigtable::Admin::V2::GenerateConsistencyTokenResponse]
451
467
 
452
468
  def generate_consistency_token instance_id, table_id
@@ -457,16 +473,16 @@ module Google
457
473
  end
458
474
  end
459
475
 
460
- # Checks replication consistency based on a consistency token, that is, if
461
- # replication has caught up based on the conditions specified in the token
476
+ # Checks replication consistency based on a consistency token.
477
+ # Determines if replication has caught up, based on the conditions in the token
462
478
  # and the check request.
463
479
  #
464
480
  # @param instance_id [String]
465
- # The unique Id of the instance in which table is exists.
481
+ # Unique ID of the instance the table is in.
466
482
  # @param table_id [String]
467
- # The unique Id of the Table for which to check replication consistency.
483
+ # Unique ID of the table to check for replication consistency.
468
484
  # @param token [String] Consistency token
469
- # The token created using GenerateConsistencyToken for the Table.
485
+ # The token created for the table using GenerateConsistencyToken.
470
486
  # @return [Google::Bigtable::Admin::V2::CheckConsistencyResponse]
471
487
 
472
488
  def check_consistency instance_id, table_id, token
@@ -478,21 +494,21 @@ module Google
478
494
  end
479
495
  end
480
496
 
481
- # Permanently drop/delete a row range from a specified table. The request can
482
- # specify whether to delete all rows in a table, or only those that match a
483
- # particular prefix.
497
+ # Permanently deletes a row range from a table. The request can
498
+ # specify whether to delete all rows in a table or only rows that match a
499
+ # particular row key prefix.
484
500
  #
485
501
  # @param instance_id [String]
486
- # The unique Id of the instance in which table is exists.
502
+ # Unique ID of the instance the table is in.
487
503
  # @param table_id [String]
488
- # The unique Id of the table on which to drop a range of rows.
504
+ # Unique ID of the table to delete a range of rows from.
489
505
  # @param row_key_prefix [String]
490
- # Delete all rows that start with this row key prefix. Prefix cannot be
491
- # zero length.
506
+ # All rows whose row keys start with this row key prefix will be deleted.
507
+ # Prefix cannot be zero length.
492
508
  # @param delete_all_data_from_table [true, false]
493
- # Delete all rows in the table. Setting this to false is a no-op.
509
+ # If true, delete all rows in the table. Setting this to false is a no-op.
494
510
  # @param timeout [Integer]
495
- # Set api call timeout if deadline exceeded exception.
511
+ # Sets the API call timeout if deadline exceeds exception.
496
512
 
497
513
  def drop_row_range \
498
514
  instance_id,
@@ -502,8 +518,8 @@ module Google
502
518
  timeout: nil
503
519
  call_options = nil
504
520
 
505
- # Pass timeout with larger value if drop operation throw error for
506
- # tiemout time.
521
+ # Pass a timeout with a larger value if the drop operation throws
522
+ # an error for timeout time.
507
523
  if timeout
508
524
  retry_options = Google::Gax::RetryOptions.new(
509
525
  [],
@@ -527,15 +543,13 @@ module Google
527
543
  # Creates an app profile within an instance.
528
544
  #
529
545
  # @param instance_id [String]
530
- # The unique Id of the instance.
546
+ # Unique ID of the instance.
531
547
  # @param app_profile_id [String]
532
- # The ID to be used when referring to the new app profile within its
533
- # instance, e.g., +myprofile+
548
+ # The permanent identifier for the new app profile within its
549
+ # instance.
534
550
  # @param app_profile [Google::Bigtable::Admin::V2::AppProfile | Hash]
535
551
  # The app profile to be created.
536
- # Fields marked +OutputOnly+ will be ignored.
537
- # A hash of the same form as `Google::Bigtable::Admin::V2::AppProfile`
538
- # can also be provided.
552
+ # Alternatively, provide a hash in the form of `Google::Bigtable::Admin::V2::AppProfile`.
539
553
  # @param ignore_warnings [Boolean]
540
554
  # If true, ignore safety checks when creating the app profile.
541
555
  # @return [Google::Bigtable::Admin::V2::AppProfile]
@@ -558,9 +572,9 @@ module Google
558
572
  # Gets information about an app profile.
559
573
  #
560
574
  # @param instance_id [String]
561
- # The unique Id of the instance.
575
+ # Unique ID of the instance.
562
576
  # @param app_profile_id [String]
563
- # The unique Id of the requested app profile.
577
+ # Unique ID of the requested app profile.
564
578
  # @return [Google::Bigtable::Admin::V2::AppProfile]
565
579
 
566
580
  def get_app_profile instance_id, app_profile_id
@@ -574,7 +588,7 @@ module Google
574
588
  # Lists information about app profiles in an instance.
575
589
  #
576
590
  # @param instance_id [String]
577
- # The unique Id of the instanc
591
+ # Unique ID of the instance
578
592
  # @return [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::AppProfile>]
579
593
  # An enumerable of Google::Bigtable::Admin::V2::AppProfile instances.
580
594
  # See Google::Gax::PagedEnumerable documentation for other
@@ -591,14 +605,13 @@ module Google
591
605
  # Updates an app profile within an instance.
592
606
  #
593
607
  # @param app_profile [Google::Bigtable::Admin::V2::AppProfile | Hash]
594
- # The app profile which will (partially) replace the current value.
595
- # A hash of the same form as `Google::Bigtable::Admin::V2::AppProfile`
596
- # can also be provided.
608
+ # The app profile that will (partially) replace the current value.
609
+ # Alternatively, provide a hash in the form of
610
+ # `Google::Bigtable::Admin::V2::AppProfile`.
597
611
  # @param update_mask [Google::Protobuf::FieldMask | Hash]
598
- # The subset of app profile fields which should be replaced.
612
+ # The subset of app profile fields that should be replaced.
599
613
  # If unset, all fields will be replaced.
600
- # A hash of the same form as `Google::Protobuf::FieldMask`
601
- # can also be provided.
614
+ # Alternatively, provide a hash similar to `Google::Protobuf::FieldMask`.
602
615
  # @param ignore_warnings [Boolean]
603
616
  # If true, ignore safety checks when updating the app profile.
604
617
  # @return [Google::Longrunning::Operation]
@@ -616,9 +629,9 @@ module Google
616
629
  # Deletes an app profile from an instance.
617
630
  #
618
631
  # @param instance_id [String]
619
- # The unique Id of the instance.
632
+ # Unique ID of the instance.
620
633
  # @param app_profile_id [String]
621
- # The unique Id of the app profile to be deleted.
634
+ # Unique ID of the app profile to be deleted.
622
635
  # @param ignore_warnings [Boolean]
623
636
  # If true, ignore safety checks when deleting the app profile.
624
637
 
@@ -635,7 +648,7 @@ module Google
635
648
  # policy if an instance exists but does not have a policy set.
636
649
  #
637
650
  # @param instance_id [String]
638
- # The unique Id of the instance for which the policy is being requested.
651
+ # Unique ID of the instance for which the policy is being requested.
639
652
  # @return [Google::Iam::V1::Policy]
640
653
 
641
654
  def get_instance_policy instance_id
@@ -650,14 +663,13 @@ module Google
650
663
  # existing policy.
651
664
  #
652
665
  # @param instance_id [String]
653
- # The unique Id of the instance for which the policy is being updated.
666
+ # Unique ID of the instance the policy is for.
654
667
  # @param policy [Google::Iam::V1::Policy | Hash]
655
668
  # REQUIRED: The complete policy to be applied to the +resource+. The size of
656
- # the policy is limited to a few 10s of KB. An empty policy is a
657
- # valid policy but certain Cloud Platform services (such as Projects)
658
- # might reject them.
659
- # A hash of the same form as `Google::Iam::V1::Policy`
660
- # can also be provided.
669
+ # the policy is limited to a few 10s of KB. An empty policy is valid
670
+ # for Cloud Bigtable, but certain Cloud Platform services (such as Projects)
671
+ # might reject an empty policy.
672
+ # Alternatively, provide a hash similar to `Google::Iam::V1::Policy`.
661
673
  # @return [Google::Iam::V1::Policy]
662
674
 
663
675
  def set_instance_policy instance_id, policy
@@ -669,10 +681,10 @@ module Google
669
681
  end
670
682
  end
671
683
 
672
- # Returns permissions that the caller has on the specified instance resource.
684
+ # Returns permissions that the caller has for the specified instance resource.
673
685
  #
674
686
  # @param instance_id [String]
675
- # The instance Id of instance for which the policy detail is being requested.
687
+ # The instance ID that the policy detail is being requested for.
676
688
  # @param permissions [Array<String>]
677
689
  # The set of permissions to check for the +resource+. Permissions with
678
690
  # wildcards (such as '*' or 'storage.*') are not allowed. For more
@@ -689,7 +701,7 @@ module Google
689
701
  end
690
702
  end
691
703
 
692
- # Execute api call and wrap errors to {Google::Cloud::Error}
704
+ # Executes the API call and wrap errors to {Google::Cloud::Error}.
693
705
  #
694
706
  # @raise [Google::Cloud::Error]
695
707
 
@@ -701,7 +713,7 @@ module Google
701
713
  raise Google::Cloud::Error.from_error(e)
702
714
  end
703
715
 
704
- # Create formatted project path
716
+ # Creates a formatted project path.
705
717
  #
706
718
  # @return [String]
707
719
  # Formatted project path
@@ -711,7 +723,7 @@ module Google
711
723
  Admin::V2::BigtableInstanceAdminClient.project_path(project_id)
712
724
  end
713
725
 
714
- # Create formatted instance path
726
+ # Creates a formatted instance path.
715
727
  #
716
728
  # @param instance_id [String]
717
729
  # @return [String]
@@ -725,7 +737,7 @@ module Google
725
737
  )
726
738
  end
727
739
 
728
- # Create formatted cluster path
740
+ # Creates a formatted cluster path.
729
741
  #
730
742
  # @param instance_id [String]
731
743
  # @param cluster_id [String]
@@ -741,7 +753,7 @@ module Google
741
753
  )
742
754
  end
743
755
 
744
- # Create formatted location path
756
+ # Creates a formatted location path.
745
757
  #
746
758
  # @param location [String]
747
759
  # zone name i.e us-east1-b
@@ -756,7 +768,7 @@ module Google
756
768
  )
757
769
  end
758
770
 
759
- # Create formatted table path
771
+ # Creates a formatted table path.
760
772
  #
761
773
  # @param table_id [String]
762
774
  # @return [String]
@@ -771,7 +783,7 @@ module Google
771
783
  )
772
784
  end
773
785
 
774
- # Create formatted snapshot path
786
+ # Creates a formatted snapshot path.
775
787
  #
776
788
  # @param instance_id [String]
777
789
  # @param cluster_id [String]
@@ -789,7 +801,7 @@ module Google
789
801
  )
790
802
  end
791
803
 
792
- # Create formatted app profile path
804
+ # Creates a formatted app profile path.
793
805
  #
794
806
  # @param instance_id [String]
795
807
  # @param app_profile_id [String]
@@ -805,7 +817,7 @@ module Google
805
817
  )
806
818
  end
807
819
 
808
- # Inspect service object
820
+ # Inspects the service object.
809
821
  # @return [String]
810
822
 
811
823
  def inspect