google-cloud-bigtable 0.1.3 → 0.2.0
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 +4 -4
- data/.yardopts +1 -0
- data/CHANGELOG.md +8 -0
- data/EMULATOR.md +30 -0
- data/OVERVIEW.md +2 -1
- data/lib/google-cloud-bigtable.rb +28 -22
- data/lib/google/cloud/bigtable.rb +25 -13
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client_config.json +14 -14
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client_config.json +5 -5
- data/lib/google/cloud/bigtable/app_profile.rb +14 -14
- data/lib/google/cloud/bigtable/app_profile/list.rb +9 -9
- data/lib/google/cloud/bigtable/chunk_processor.rb +6 -6
- data/lib/google/cloud/bigtable/cluster.rb +5 -5
- data/lib/google/cloud/bigtable/cluster/job.rb +1 -1
- data/lib/google/cloud/bigtable/cluster/list.rb +6 -6
- data/lib/google/cloud/bigtable/column_family.rb +12 -12
- data/lib/google/cloud/bigtable/column_range.rb +8 -8
- data/lib/google/cloud/bigtable/gc_rule.rb +2 -2
- data/lib/google/cloud/bigtable/instance.rb +34 -36
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +5 -5
- data/lib/google/cloud/bigtable/instance/list.rb +9 -9
- data/lib/google/cloud/bigtable/longrunning_job.rb +1 -1
- data/lib/google/cloud/bigtable/mutation_entry.rb +18 -18
- data/lib/google/cloud/bigtable/mutation_operations.rb +25 -23
- data/lib/google/cloud/bigtable/policy.rb +13 -13
- data/lib/google/cloud/bigtable/project.rb +27 -27
- data/lib/google/cloud/bigtable/read_modify_write_rule.rb +6 -6
- data/lib/google/cloud/bigtable/read_operations.rb +13 -13
- data/lib/google/cloud/bigtable/row.rb +7 -7
- data/lib/google/cloud/bigtable/row_filter.rb +58 -58
- data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +40 -41
- data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +46 -47
- data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +14 -15
- data/lib/google/cloud/bigtable/row_range.rb +16 -16
- data/lib/google/cloud/bigtable/rows_mutator.rb +5 -5
- data/lib/google/cloud/bigtable/rows_reader.rb +8 -9
- data/lib/google/cloud/bigtable/service.rb +153 -141
- data/lib/google/cloud/bigtable/table.rb +23 -23
- data/lib/google/cloud/bigtable/table/cluster_state.rb +2 -2
- data/lib/google/cloud/bigtable/table/column_family_map.rb +5 -5
- data/lib/google/cloud/bigtable/table/list.rb +8 -8
- data/lib/google/cloud/bigtable/value_range.rb +7 -7
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +5 -4
@@ -24,7 +24,7 @@ module Google
|
|
24
24
|
#
|
25
25
|
class SimpleFilter
|
26
26
|
# @private
|
27
|
-
#
|
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
|
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
|
159
|
-
# multiple labels to a cell. As a result, a
|
160
|
-
# one sub-filter
|
161
|
-
# an
|
162
|
-
# will be applied to separate copies of the input.
|
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
|
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
|
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
|
-
#
|
211
|
+
# Creates a timestamp-range filter instance.
|
213
212
|
#
|
214
213
|
# Matches only cells with timestamps within the given range.
|
215
|
-
#
|
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
|
235
|
-
# * The value at which to end the range. If neither field is set, interpreted as
|
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
|
-
#
|
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
|
-
# *
|
24
|
-
# If neither field is set, interpreted as
|
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
|
-
#
|
57
|
+
# Creates a row range instance.
|
58
58
|
def initialize
|
59
59
|
@grpc = Google::Bigtable::V2::RowRange.new
|
60
60
|
end
|
61
61
|
|
62
|
-
#
|
62
|
+
# Sets a row range with a lower bound.
|
63
63
|
#
|
64
|
-
# @param key [String] Row key. Required
|
65
|
-
# @param inclusive [String] Inclusive/
|
66
|
-
# Default
|
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
|
-
#
|
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
|
-
#
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
40
|
-
# be
|
41
|
-
#
|
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
|
-
#
|
43
|
+
# `String` will be treated as the path to the keyfile to use to construct
|
44
44
|
# credentials for this client.
|
45
|
-
#
|
45
|
+
# `Hash` will be treated as the contents of a keyfile to use to construct
|
46
46
|
# credentials for this client.
|
47
|
-
#
|
48
|
-
#
|
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
|
-
#
|
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
|
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,
|
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
|
-
|
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:
|
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
|
-
#
|
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:
|
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
|
-
#
|
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:
|
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
|
-
|
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
|
116
|
-
#
|
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
|
120
|
-
# cluster ID
|
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
|
-
#
|
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
|
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
|
-
#
|
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
|
194
|
+
# Partially updates an instance.
|
172
195
|
#
|
173
196
|
# @param instance [Google::Bigtable::Admin::V2::Instance | Hash]
|
174
|
-
# The
|
175
|
-
#
|
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
|
-
#
|
200
|
+
# List of instance properties to be replaced.
|
179
201
|
# Must be explicitly set.
|
180
|
-
#
|
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
|
-
#
|
211
|
+
# Deletes an instance from a project.
|
191
212
|
#
|
192
213
|
# @param instance_id [String]
|
193
|
-
#
|
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
|
-
#
|
224
|
+
# Creates a cluster within an instance.
|
204
225
|
#
|
205
226
|
# @param instance_id [String]
|
206
|
-
#
|
227
|
+
# Unique ID of the instance in which to create the new cluster
|
207
228
|
# @param cluster_id [String]
|
208
|
-
#
|
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
|
-
#
|
213
|
-
#
|
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
|
-
#
|
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
|
-
#
|
270
|
+
# Unique ID of the instance the cluster is in.
|
252
271
|
# @param cluster_id [String]
|
253
|
-
#
|
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
|
-
#
|
286
|
+
# Unique ID of the instance the cluster is in.
|
268
287
|
# @param cluster_id [String]
|
269
|
-
#
|
288
|
+
# Unique ID of the cluster.
|
270
289
|
# @param location [String]
|
271
|
-
#
|
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.
|
274
|
-
#
|
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
|
-
#
|
312
|
+
# Unique ID of the instance the cluster is in.
|
294
313
|
# @param cluster_id [String]
|
295
|
-
#
|
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
|
-
#
|
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
|
-
#
|
328
|
+
# Unique ID of the instance to create the table in.
|
311
329
|
# @param table_id [String]
|
312
|
-
#
|
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
|
316
|
-
#
|
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
|
-
#
|
336
|
-
#
|
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
|
374
|
+
# Lists all tables in an instance.
|
359
375
|
#
|
360
376
|
# @param instance_id [String]
|
361
|
-
#
|
377
|
+
# Unique ID of the instance for which tables should be listed.
|
362
378
|
# @param view [Google::Bigtable::Admin::V2::Table::View]
|
363
|
-
#
|
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
|
395
|
+
# Gets metadata about the specified table.
|
380
396
|
#
|
381
397
|
# @param instance_id [String]
|
382
|
-
#
|
398
|
+
# Unique ID of the instance the table is in.
|
383
399
|
# @param table_id [String]
|
384
|
-
#
|
400
|
+
# Unique ID of the requested table.
|
385
401
|
# @param view [Google::Bigtable::Admin::V2::Table::View]
|
386
|
-
#
|
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
|
415
|
+
# Permanently deletes a table and all of its data.
|
400
416
|
#
|
401
417
|
# @param instance_id [String]
|
402
|
-
#
|
418
|
+
# Unique ID of the instance the table is in.
|
403
419
|
# @param table_id [String]
|
404
|
-
#
|
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
|
417
|
-
#
|
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
|
-
#
|
436
|
+
# Unique ID of the instance the table is in.
|
421
437
|
# @param table_id [String]
|
422
|
-
#
|
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
|
-
#
|
429
|
-
#
|
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
|
442
|
-
#
|
443
|
-
# before this call started have been replicated.
|
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
|
-
#
|
463
|
+
# Unique ID of the instance the table is in.
|
448
464
|
# @param table_id [String]
|
449
|
-
#
|
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
|
461
|
-
# replication has caught up based on the conditions
|
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
|
-
#
|
481
|
+
# Unique ID of the instance the table is in.
|
466
482
|
# @param table_id [String]
|
467
|
-
#
|
483
|
+
# Unique ID of the table to check for replication consistency.
|
468
484
|
# @param token [String] Consistency token
|
469
|
-
# The token created
|
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
|
482
|
-
# specify whether to delete all rows in a table
|
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
|
-
#
|
502
|
+
# Unique ID of the instance the table is in.
|
487
503
|
# @param table_id [String]
|
488
|
-
#
|
504
|
+
# Unique ID of the table to delete a range of rows from.
|
489
505
|
# @param row_key_prefix [String]
|
490
|
-
#
|
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
|
-
#
|
509
|
+
# If true, delete all rows in the table. Setting this to false is a no-op.
|
494
510
|
# @param timeout [Integer]
|
495
|
-
#
|
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
|
506
|
-
#
|
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
|
-
#
|
546
|
+
# Unique ID of the instance.
|
531
547
|
# @param app_profile_id [String]
|
532
|
-
# The
|
533
|
-
# instance
|
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
|
-
#
|
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
|
-
#
|
575
|
+
# Unique ID of the instance.
|
562
576
|
# @param app_profile_id [String]
|
563
|
-
#
|
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
|
-
#
|
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
|
595
|
-
#
|
596
|
-
#
|
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
|
612
|
+
# The subset of app profile fields that should be replaced.
|
599
613
|
# If unset, all fields will be replaced.
|
600
|
-
#
|
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
|
-
#
|
632
|
+
# Unique ID of the instance.
|
620
633
|
# @param app_profile_id [String]
|
621
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
657
|
-
#
|
658
|
-
# might reject
|
659
|
-
#
|
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
|
684
|
+
# Returns permissions that the caller has for the specified instance resource.
|
673
685
|
#
|
674
686
|
# @param instance_id [String]
|
675
|
-
# The instance
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
820
|
+
# Inspects the service object.
|
809
821
|
# @return [String]
|
810
822
|
|
811
823
|
def inspect
|