google-cloud-bigtable 2.6.0 → 2.10.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 +4 -4
- data/AUTHENTICATION.md +10 -27
- data/CHANGELOG.md +72 -0
- data/CONTRIBUTING.md +328 -115
- data/EMULATOR.md +1 -1
- data/LOGGING.md +1 -1
- data/OVERVIEW.md +1 -1
- data/lib/google/cloud/bigtable/app_profile/job.rb +4 -4
- data/lib/google/cloud/bigtable/app_profile/list.rb +5 -7
- data/lib/google/cloud/bigtable/app_profile.rb +20 -21
- data/lib/google/cloud/bigtable/backup/job.rb +8 -8
- data/lib/google/cloud/bigtable/backup/list.rb +9 -11
- data/lib/google/cloud/bigtable/backup.rb +103 -36
- data/lib/google/cloud/bigtable/chunk_processor.rb +5 -5
- data/lib/google/cloud/bigtable/cluster/job.rb +2 -2
- data/lib/google/cloud/bigtable/cluster.rb +15 -15
- data/lib/google/cloud/bigtable/column_family.rb +2 -2
- data/lib/google/cloud/bigtable/column_family_map.rb +18 -21
- data/lib/google/cloud/bigtable/column_range.rb +7 -7
- data/lib/google/cloud/bigtable/convert.rb +34 -0
- data/lib/google/cloud/bigtable/encryption_info.rb +4 -4
- data/lib/google/cloud/bigtable/gc_rule.rb +20 -20
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +7 -7
- data/lib/google/cloud/bigtable/instance/job.rb +4 -4
- data/lib/google/cloud/bigtable/instance.rb +49 -52
- data/lib/google/cloud/bigtable/mutation_entry.rb +21 -21
- data/lib/google/cloud/bigtable/mutation_operations.rb +34 -34
- data/lib/google/cloud/bigtable/policy.rb +4 -4
- data/lib/google/cloud/bigtable/project.rb +84 -26
- data/lib/google/cloud/bigtable/read_operations.rb +40 -33
- data/lib/google/cloud/bigtable/routing_policy.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +30 -29
- data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +27 -26
- data/lib/google/cloud/bigtable/row_filter.rb +28 -28
- data/lib/google/cloud/bigtable/row_range.rb +18 -18
- data/lib/google/cloud/bigtable/rows_reader.rb +77 -32
- data/lib/google/cloud/bigtable/sample_row_key.rb +1 -1
- data/lib/google/cloud/bigtable/service.rb +69 -29
- data/lib/google/cloud/bigtable/status.rb +2 -2
- data/lib/google/cloud/bigtable/table/cluster_state.rb +1 -1
- data/lib/google/cloud/bigtable/table/list.rb +2 -2
- data/lib/google/cloud/bigtable/table/restore_job.rb +12 -12
- data/lib/google/cloud/bigtable/table.rb +42 -40
- data/lib/google/cloud/bigtable/value_range.rb +18 -18
- data/lib/google/cloud/bigtable/version.rb +1 -1
- data/lib/google/cloud/bigtable.rb +28 -7
- data/lib/google-cloud-bigtable.rb +6 -2
- metadata +15 -113
|
@@ -41,15 +41,15 @@ module Google
|
|
|
41
41
|
#
|
|
42
42
|
# bigtable = Google::Cloud::Bigtable.new
|
|
43
43
|
#
|
|
44
|
-
# table = bigtable.create_table
|
|
45
|
-
# cfm.add
|
|
46
|
-
# cfm.add
|
|
44
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
45
|
+
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
|
|
46
|
+
# cfm.add "cf2", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
|
47
47
|
#
|
|
48
48
|
# gc_rule = Google::Cloud::Bigtable::GcRule.union(
|
|
49
49
|
# Google::Cloud::Bigtable::GcRule.max_age(1800),
|
|
50
50
|
# Google::Cloud::Bigtable::GcRule.max_versions(3)
|
|
51
51
|
# )
|
|
52
|
-
# cfm.add
|
|
52
|
+
# cfm.add "cf3", gc_rule: gc_rule
|
|
53
53
|
# end
|
|
54
54
|
#
|
|
55
55
|
# puts table.column_families
|
|
@@ -59,15 +59,15 @@ module Google
|
|
|
59
59
|
#
|
|
60
60
|
# bigtable = Google::Cloud::Bigtable.new
|
|
61
61
|
#
|
|
62
|
-
# table = bigtable.table
|
|
62
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
|
63
63
|
#
|
|
64
64
|
# table.column_families do |cfm|
|
|
65
65
|
# cfm.add "cf4", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
|
66
66
|
# cfm.add "cf5", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
|
|
67
67
|
#
|
|
68
|
-
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions
|
|
69
|
-
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age
|
|
70
|
-
# rule_union = Google::Cloud::Bigtable::GcRule.union
|
|
68
|
+
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions 3
|
|
69
|
+
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age 600
|
|
70
|
+
# rule_union = Google::Cloud::Bigtable::GcRule.union rule_1, rule_2
|
|
71
71
|
# cfm.update "cf2", gc_rule: rule_union
|
|
72
72
|
#
|
|
73
73
|
# cfm.delete "cf3"
|
|
@@ -196,7 +196,7 @@ module Google
|
|
|
196
196
|
#
|
|
197
197
|
# bigtable = Google::Cloud::Bigtable.new
|
|
198
198
|
#
|
|
199
|
-
# table = bigtable.table
|
|
199
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
|
200
200
|
#
|
|
201
201
|
# table.column_families do |column_families|
|
|
202
202
|
# column_families.add "cf4", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
|
@@ -237,12 +237,12 @@ module Google
|
|
|
237
237
|
#
|
|
238
238
|
# bigtable = Google::Cloud::Bigtable.new
|
|
239
239
|
#
|
|
240
|
-
# table = bigtable.table
|
|
240
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
|
241
241
|
#
|
|
242
242
|
# table.column_families do |column_families|
|
|
243
|
-
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions
|
|
244
|
-
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age
|
|
245
|
-
# rule_union = Google::Cloud::Bigtable::GcRule.union
|
|
243
|
+
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions 3
|
|
244
|
+
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age 600
|
|
245
|
+
# rule_union = Google::Cloud::Bigtable::GcRule.union rule_1, rule_2
|
|
246
246
|
#
|
|
247
247
|
# column_families.update "cf2", gc_rule: rule_union
|
|
248
248
|
# end
|
|
@@ -270,7 +270,7 @@ module Google
|
|
|
270
270
|
#
|
|
271
271
|
# bigtable = Google::Cloud::Bigtable.new
|
|
272
272
|
#
|
|
273
|
-
# table = bigtable.table
|
|
273
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
|
274
274
|
#
|
|
275
275
|
# table.column_families do |column_families|
|
|
276
276
|
# column_families.delete "cf3"
|
|
@@ -331,7 +331,7 @@ module Google
|
|
|
331
331
|
# @return [Hash]
|
|
332
332
|
#
|
|
333
333
|
def to_grpc_hash
|
|
334
|
-
|
|
334
|
+
to_grpc.to_a.to_h
|
|
335
335
|
end
|
|
336
336
|
|
|
337
337
|
##
|
|
@@ -370,8 +370,7 @@ module Google
|
|
|
370
370
|
added_keys = @column_families.keys - comparison_map.keys
|
|
371
371
|
|
|
372
372
|
added_keys.map do |name|
|
|
373
|
-
Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::
|
|
374
|
-
Modification.new(
|
|
373
|
+
Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification.new(
|
|
375
374
|
id: name,
|
|
376
375
|
create: @column_families[name]
|
|
377
376
|
)
|
|
@@ -394,8 +393,7 @@ module Google
|
|
|
394
393
|
end
|
|
395
394
|
|
|
396
395
|
updated_keys.map do |name|
|
|
397
|
-
Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::
|
|
398
|
-
Modification.new(
|
|
396
|
+
Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification.new(
|
|
399
397
|
id: name,
|
|
400
398
|
update: @column_families[name]
|
|
401
399
|
)
|
|
@@ -415,8 +413,7 @@ module Google
|
|
|
415
413
|
dropped_keys = comparison_map.keys - @column_families.keys
|
|
416
414
|
|
|
417
415
|
dropped_keys.map do |name|
|
|
418
|
-
Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::
|
|
419
|
-
Modification.new(
|
|
416
|
+
Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification.new(
|
|
420
417
|
id: name,
|
|
421
418
|
drop: true
|
|
422
419
|
)
|
|
@@ -32,7 +32,7 @@ module Google
|
|
|
32
32
|
# require "google/cloud/bigtable"
|
|
33
33
|
#
|
|
34
34
|
# bigtable = Google::Cloud::Bigtable.new
|
|
35
|
-
# table = bigtable.table
|
|
35
|
+
# table = bigtable.table "my-instance", "my-table"
|
|
36
36
|
#
|
|
37
37
|
# # Range that includes all qualifiers including "user-001" up until "user-010"
|
|
38
38
|
# table.new_column_range("cf").from("user-001").to("user-010")
|
|
@@ -89,7 +89,7 @@ module Google
|
|
|
89
89
|
# require "google/cloud/bigtable"
|
|
90
90
|
#
|
|
91
91
|
# bigtable = Google::Cloud::Bigtable.new
|
|
92
|
-
# table = bigtable.table
|
|
92
|
+
# table = bigtable.table "my-instance", "my-table"
|
|
93
93
|
#
|
|
94
94
|
# table.new_column_range("cf").from("qualifier-1")
|
|
95
95
|
#
|
|
@@ -97,7 +97,7 @@ module Google
|
|
|
97
97
|
# require "google/cloud/bigtable"
|
|
98
98
|
#
|
|
99
99
|
# bigtable = Google::Cloud::Bigtable.new
|
|
100
|
-
# table = bigtable.table
|
|
100
|
+
# table = bigtable.table "my-instance", "my-table"
|
|
101
101
|
#
|
|
102
102
|
# table.new_column_range("cf").from("qualifier-1", inclusive: false)
|
|
103
103
|
#
|
|
@@ -122,7 +122,7 @@ module Google
|
|
|
122
122
|
# require "google/cloud/bigtable"
|
|
123
123
|
#
|
|
124
124
|
# bigtable = Google::Cloud::Bigtable.new
|
|
125
|
-
# table = bigtable.table
|
|
125
|
+
# table = bigtable.table "my-instance", "my-table"
|
|
126
126
|
#
|
|
127
127
|
# table.new_column_range("cf").to("qualifier-10", inclusive: true)
|
|
128
128
|
#
|
|
@@ -130,7 +130,7 @@ module Google
|
|
|
130
130
|
# require "google/cloud/bigtable"
|
|
131
131
|
#
|
|
132
132
|
# bigtable = Google::Cloud::Bigtable.new
|
|
133
|
-
# table = bigtable.table
|
|
133
|
+
# table = bigtable.table "my-instance", "my-table"
|
|
134
134
|
#
|
|
135
135
|
# table.new_column_range("cf").to("qualifier-10")
|
|
136
136
|
#
|
|
@@ -154,7 +154,7 @@ module Google
|
|
|
154
154
|
# require "google/cloud/bigtable"
|
|
155
155
|
#
|
|
156
156
|
# bigtable = Google::Cloud::Bigtable.new
|
|
157
|
-
# table = bigtable.table
|
|
157
|
+
# table = bigtable.table "my-instance", "my-table"
|
|
158
158
|
#
|
|
159
159
|
# table.new_column_range("cf").between("qualifier-1", "qualifier-10")
|
|
160
160
|
#
|
|
@@ -173,7 +173,7 @@ module Google
|
|
|
173
173
|
# require "google/cloud/bigtable"
|
|
174
174
|
#
|
|
175
175
|
# bigtable = Google::Cloud::Bigtable.new
|
|
176
|
-
# table = bigtable.table
|
|
176
|
+
# table = bigtable.table "my-instance", "my-table"
|
|
177
177
|
#
|
|
178
178
|
# table.new_column_range("cf").of("qualifier-1", "qualifier-10")
|
|
179
179
|
#
|
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
require "time"
|
|
19
19
|
require "date"
|
|
20
|
+
require "gapic/protobuf"
|
|
21
|
+
require "gapic/call_options"
|
|
22
|
+
require "gapic/headers"
|
|
23
|
+
require "google/cloud/bigtable/version"
|
|
24
|
+
require "google/cloud/bigtable/v2/version"
|
|
25
|
+
require "google/bigtable/v2/bigtable_pb"
|
|
26
|
+
require "google/cloud/bigtable/admin/v2"
|
|
20
27
|
|
|
21
28
|
module Google
|
|
22
29
|
module Cloud
|
|
@@ -89,6 +96,33 @@ module Google
|
|
|
89
96
|
return [value].pack "q>" if value.is_a? Integer
|
|
90
97
|
value
|
|
91
98
|
end
|
|
99
|
+
|
|
100
|
+
def ping_and_warm_request table_path, app_profile_id, timeout
|
|
101
|
+
request = {
|
|
102
|
+
name: table_path.split("/").slice(0, 4).join("/"),
|
|
103
|
+
app_profile_id: app_profile_id
|
|
104
|
+
}
|
|
105
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::PingAndWarmRequest
|
|
106
|
+
|
|
107
|
+
header_params = {}
|
|
108
|
+
if request.name && %r{^projects/[^/]+/instances/[^/]+/?$}.match?(request.name)
|
|
109
|
+
header_params["name"] = request.name
|
|
110
|
+
end
|
|
111
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
|
112
|
+
header_params["app_profile_id"] = request.app_profile_id
|
|
113
|
+
end
|
|
114
|
+
request_params_header = URI.encode_www_form header_params
|
|
115
|
+
metadata = {
|
|
116
|
+
"x-goog-request-params": request_params_header,
|
|
117
|
+
"x-goog-api-client":
|
|
118
|
+
::Gapic::Headers.x_goog_api_client(lib_name: "gccl",
|
|
119
|
+
lib_version: ::Google::Cloud::Bigtable::VERSION,
|
|
120
|
+
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION),
|
|
121
|
+
"google-cloud-resource-prefix": "projects/#{table_path.split('/')[1]}"
|
|
122
|
+
}
|
|
123
|
+
options = ::Gapic::CallOptions.new timeout: timeout, metadata: metadata
|
|
124
|
+
[request, options]
|
|
125
|
+
end
|
|
92
126
|
end
|
|
93
127
|
end
|
|
94
128
|
end
|
|
@@ -31,10 +31,10 @@ module Google
|
|
|
31
31
|
# require "google/cloud/bigtable"
|
|
32
32
|
#
|
|
33
33
|
# bigtable = Google::Cloud::Bigtable.new
|
|
34
|
-
# instance = bigtable.instance
|
|
35
|
-
# cluster = instance.cluster
|
|
34
|
+
# instance = bigtable.instance "my-instance"
|
|
35
|
+
# cluster = instance.cluster "my-cluster"
|
|
36
36
|
#
|
|
37
|
-
# backup = cluster.backup
|
|
37
|
+
# backup = cluster.backup "my-backup"
|
|
38
38
|
#
|
|
39
39
|
# encryption_info = backup.encryption_info
|
|
40
40
|
# encryption_info.encryption_type #=> :GOOGLE_DEFAULT_ENCRYPTION
|
|
@@ -44,7 +44,7 @@ module Google
|
|
|
44
44
|
#
|
|
45
45
|
# bigtable = Google::Cloud::Bigtable.new
|
|
46
46
|
#
|
|
47
|
-
# table = bigtable.table
|
|
47
|
+
# table = bigtable.table "my-instance", "my-table", view: :ENCRYPTION_VIEW, perform_lookup: true
|
|
48
48
|
#
|
|
49
49
|
# table.cluster_states.each do |cs|
|
|
50
50
|
# puts cs.cluster_name
|
|
@@ -49,15 +49,15 @@ module Google
|
|
|
49
49
|
#
|
|
50
50
|
# bigtable = Google::Cloud::Bigtable.new
|
|
51
51
|
#
|
|
52
|
-
# table = bigtable.create_table
|
|
53
|
-
# cfm.add
|
|
54
|
-
# cfm.add
|
|
52
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
53
|
+
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
|
|
54
|
+
# cfm.add "cf2", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
|
55
55
|
#
|
|
56
56
|
# gc_rule = Google::Cloud::Bigtable::GcRule.union(
|
|
57
57
|
# Google::Cloud::Bigtable::GcRule.max_age(1800),
|
|
58
58
|
# Google::Cloud::Bigtable::GcRule.max_versions(3)
|
|
59
59
|
# )
|
|
60
|
-
# cfm.add
|
|
60
|
+
# cfm.add "cf3", gc_rule: gc_rule
|
|
61
61
|
# end
|
|
62
62
|
#
|
|
63
63
|
# puts table.column_families["cf1"].gc_rule.max_versions
|
|
@@ -95,8 +95,8 @@ module Google
|
|
|
95
95
|
#
|
|
96
96
|
# bigtable = Google::Cloud::Bigtable.new
|
|
97
97
|
#
|
|
98
|
-
# table = bigtable.create_table
|
|
99
|
-
# cfm.add
|
|
98
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
99
|
+
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
|
|
100
100
|
# end
|
|
101
101
|
#
|
|
102
102
|
# puts table.column_families["cf1"].gc_rule.max_versions
|
|
@@ -131,8 +131,8 @@ module Google
|
|
|
131
131
|
#
|
|
132
132
|
# bigtable = Google::Cloud::Bigtable.new
|
|
133
133
|
#
|
|
134
|
-
# table = bigtable.create_table
|
|
135
|
-
# cfm.add
|
|
134
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
135
|
+
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
|
136
136
|
# end
|
|
137
137
|
#
|
|
138
138
|
# puts table.column_families["cf1"].gc_rule.max_age
|
|
@@ -162,12 +162,12 @@ module Google
|
|
|
162
162
|
#
|
|
163
163
|
# bigtable = Google::Cloud::Bigtable.new
|
|
164
164
|
#
|
|
165
|
-
# table = bigtable.create_table
|
|
165
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
166
166
|
# gc_rule = Google::Cloud::Bigtable::GcRule.intersection(
|
|
167
167
|
# Google::Cloud::Bigtable::GcRule.max_age(1800),
|
|
168
168
|
# Google::Cloud::Bigtable::GcRule.max_versions(3)
|
|
169
169
|
# )
|
|
170
|
-
# cfm.add
|
|
170
|
+
# cfm.add "cf1", gc_rule: gc_rule
|
|
171
171
|
# end
|
|
172
172
|
#
|
|
173
173
|
# puts table.column_families["cf1"].gc_rule.intersection
|
|
@@ -203,12 +203,12 @@ module Google
|
|
|
203
203
|
#
|
|
204
204
|
# bigtable = Google::Cloud::Bigtable.new
|
|
205
205
|
#
|
|
206
|
-
# table = bigtable.create_table
|
|
206
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
207
207
|
# gc_rule = Google::Cloud::Bigtable::GcRule.union(
|
|
208
208
|
# Google::Cloud::Bigtable::GcRule.max_age(1800),
|
|
209
209
|
# Google::Cloud::Bigtable::GcRule.max_versions(3)
|
|
210
210
|
# )
|
|
211
|
-
# cfm.add
|
|
211
|
+
# cfm.add "cf1", gc_rule: gc_rule
|
|
212
212
|
# end
|
|
213
213
|
#
|
|
214
214
|
# puts table.column_families["cf1"].gc_rule.union
|
|
@@ -231,8 +231,8 @@ module Google
|
|
|
231
231
|
#
|
|
232
232
|
# bigtable = Google::Cloud::Bigtable.new
|
|
233
233
|
#
|
|
234
|
-
# table = bigtable.create_table
|
|
235
|
-
# cfm.add
|
|
234
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
235
|
+
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
|
|
236
236
|
# end
|
|
237
237
|
#
|
|
238
238
|
def self.max_versions versions
|
|
@@ -252,8 +252,8 @@ module Google
|
|
|
252
252
|
#
|
|
253
253
|
# bigtable = Google::Cloud::Bigtable.new
|
|
254
254
|
#
|
|
255
|
-
# table = bigtable.create_table
|
|
256
|
-
# cfm.add
|
|
255
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
256
|
+
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
|
257
257
|
# end
|
|
258
258
|
#
|
|
259
259
|
def self.max_age age
|
|
@@ -274,12 +274,12 @@ module Google
|
|
|
274
274
|
#
|
|
275
275
|
# bigtable = Google::Cloud::Bigtable.new
|
|
276
276
|
#
|
|
277
|
-
# table = bigtable.create_table
|
|
277
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
278
278
|
# gc_rule = Google::Cloud::Bigtable::GcRule.union(
|
|
279
279
|
# Google::Cloud::Bigtable::GcRule.max_age(1800),
|
|
280
280
|
# Google::Cloud::Bigtable::GcRule.max_versions(3)
|
|
281
281
|
# )
|
|
282
|
-
# cfm.add
|
|
282
|
+
# cfm.add "cf1", gc_rule: gc_rule
|
|
283
283
|
# end
|
|
284
284
|
#
|
|
285
285
|
def self.union *rules
|
|
@@ -300,12 +300,12 @@ module Google
|
|
|
300
300
|
#
|
|
301
301
|
# bigtable = Google::Cloud::Bigtable.new
|
|
302
302
|
#
|
|
303
|
-
# table = bigtable.create_table
|
|
303
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
|
304
304
|
# gc_rule = Google::Cloud::Bigtable::GcRule.intersection(
|
|
305
305
|
# Google::Cloud::Bigtable::GcRule.max_age(1800),
|
|
306
306
|
# Google::Cloud::Bigtable::GcRule.max_versions(3)
|
|
307
307
|
# )
|
|
308
|
-
# cfm.add
|
|
308
|
+
# cfm.add "cf1", gc_rule: gc_rule
|
|
309
309
|
# end
|
|
310
310
|
#
|
|
311
311
|
def self.intersection *rules
|
|
@@ -30,8 +30,8 @@ module Google
|
|
|
30
30
|
#
|
|
31
31
|
# bigtable = Google::Cloud::Bigtable.new
|
|
32
32
|
#
|
|
33
|
-
# job = bigtable.create_instance
|
|
34
|
-
# clusters.add
|
|
33
|
+
# job = bigtable.create_instance "my-instance" do |clusters|
|
|
34
|
+
# clusters.add "test-cluster", "us-east1-b", nodes: 3, storage_type: :SSD
|
|
35
35
|
# end
|
|
36
36
|
#
|
|
37
37
|
# job.wait_until_done!
|
|
@@ -74,8 +74,8 @@ module Google
|
|
|
74
74
|
#
|
|
75
75
|
# bigtable = Google::Cloud::Bigtable.new
|
|
76
76
|
#
|
|
77
|
-
# job = bigtable.create_instance
|
|
78
|
-
# clusters.add
|
|
77
|
+
# job = bigtable.create_instance "my-instance" do |clusters|
|
|
78
|
+
# clusters.add "test-cluster", "us-east1-b", nodes: 3, storage_type: :SSD
|
|
79
79
|
# end
|
|
80
80
|
#
|
|
81
81
|
# job.wait_until_done!
|
|
@@ -86,8 +86,8 @@ module Google
|
|
|
86
86
|
# bigtable = Google::Cloud::Bigtable.new
|
|
87
87
|
#
|
|
88
88
|
# kms_key_name = "projects/a/locations/b/keyRings/c/cryptoKeys/d"
|
|
89
|
-
# job = bigtable.create_instance
|
|
90
|
-
# clusters.add
|
|
89
|
+
# job = bigtable.create_instance "my-instance" do |clusters|
|
|
90
|
+
# clusters.add "test-cluster", "us-east1-b", kms_key: kms_key_name
|
|
91
91
|
# end
|
|
92
92
|
#
|
|
93
93
|
# job.wait_until_done!
|
|
@@ -103,7 +103,7 @@ module Google
|
|
|
103
103
|
location: location,
|
|
104
104
|
default_storage_type: storage_type,
|
|
105
105
|
encryption_config: encryption_config
|
|
106
|
-
}.
|
|
106
|
+
}.compact
|
|
107
107
|
|
|
108
108
|
self[name] = Google::Cloud::Bigtable::Admin::V2::Cluster.new attrs
|
|
109
109
|
end
|
|
@@ -38,9 +38,9 @@ module Google
|
|
|
38
38
|
# "my-instance",
|
|
39
39
|
# display_name: "Instance for user data",
|
|
40
40
|
# type: :DEVELOPMENT,
|
|
41
|
-
# labels: { "env" => "dev"}
|
|
41
|
+
# labels: { "env" => "dev" }
|
|
42
42
|
# ) do |clusters|
|
|
43
|
-
# clusters.add
|
|
43
|
+
# clusters.add "test-cluster", "us-east1-b" # nodes not allowed
|
|
44
44
|
# end
|
|
45
45
|
#
|
|
46
46
|
# # Check and reload.
|
|
@@ -74,9 +74,9 @@ module Google
|
|
|
74
74
|
# "my-instance",
|
|
75
75
|
# display_name: "Instance for user data",
|
|
76
76
|
# type: :DEVELOPMENT,
|
|
77
|
-
# labels: { "env" => "dev"}
|
|
77
|
+
# labels: { "env" => "dev" }
|
|
78
78
|
# ) do |clusters|
|
|
79
|
-
# clusters.add
|
|
79
|
+
# clusters.add "test-cluster", "us-east1-b" # nodes not allowed
|
|
80
80
|
# end
|
|
81
81
|
#
|
|
82
82
|
# job.done? #=> false
|