google-cloud-bigtable 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/bigtable/app_profile.rb +20 -21
- 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/backup.rb +36 -36
- 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/cluster.rb +15 -15
- data/lib/google/cloud/bigtable/cluster/job.rb +2 -2
- data/lib/google/cloud/bigtable/column_family.rb +2 -2
- data/lib/google/cloud/bigtable/column_family_map.rb +14 -14
- data/lib/google/cloud/bigtable/column_range.rb +7 -7
- 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.rb +40 -40
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +6 -6
- data/lib/google/cloud/bigtable/instance/job.rb +4 -4
- 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 +15 -15
- data/lib/google/cloud/bigtable/read_operations.rb +31 -31
- data/lib/google/cloud/bigtable/routing_policy.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter.rb +28 -28
- 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_range.rb +18 -18
- data/lib/google/cloud/bigtable/sample_row_key.rb +1 -1
- data/lib/google/cloud/bigtable/status.rb +2 -2
- data/lib/google/cloud/bigtable/table.rb +34 -34
- 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/value_range.rb +18 -18
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +2 -2
@@ -50,7 +50,7 @@ module Google
|
|
50
50
|
# require "google/cloud/bigtable"
|
51
51
|
#
|
52
52
|
# bigtable = Google::Cloud::Bigtable.new
|
53
|
-
# table = bigtable.table
|
53
|
+
# table = bigtable.table "my-instance", "my-table"
|
54
54
|
#
|
55
55
|
# table.sample_row_keys.each do |sample_row_key|
|
56
56
|
# p sample_row_key.key # user00116
|
@@ -90,7 +90,7 @@ module Google
|
|
90
90
|
# require "google/cloud/bigtable"
|
91
91
|
#
|
92
92
|
# bigtable = Google::Cloud::Bigtable.new
|
93
|
-
# table = bigtable.table
|
93
|
+
# table = bigtable.table "my-instance", "my-table"
|
94
94
|
#
|
95
95
|
# table.read_rows(limit: 10).each do |row|
|
96
96
|
# puts row
|
@@ -100,7 +100,7 @@ module Google
|
|
100
100
|
# require "google/cloud/bigtable"
|
101
101
|
#
|
102
102
|
# bigtable = Google::Cloud::Bigtable.new
|
103
|
-
# table = bigtable.table
|
103
|
+
# table = bigtable.table "my-instance", "my-table"
|
104
104
|
#
|
105
105
|
# table.read_rows(keys: ["user-1", "user-2"]).each do |row|
|
106
106
|
# puts row
|
@@ -110,9 +110,9 @@ module Google
|
|
110
110
|
# require "google/cloud/bigtable"
|
111
111
|
#
|
112
112
|
# bigtable = Google::Cloud::Bigtable.new
|
113
|
-
# table = bigtable.table
|
113
|
+
# table = bigtable.table "my-instance", "my-table"
|
114
114
|
#
|
115
|
-
# range = table.new_row_range.between
|
115
|
+
# range = table.new_row_range.between "user-1", "user-100"
|
116
116
|
#
|
117
117
|
# table.read_rows(ranges: range).each do |row|
|
118
118
|
# puts row
|
@@ -122,11 +122,11 @@ 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
|
-
# filter = table.filter.key
|
127
|
+
# filter = table.filter.key "user-*"
|
128
128
|
# # OR
|
129
|
-
# # filter = Google::Cloud::Bigtable::RowFilter.key
|
129
|
+
# # filter = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
130
130
|
#
|
131
131
|
# table.read_rows(filter: filter).each do |row|
|
132
132
|
# puts row
|
@@ -136,11 +136,11 @@ module Google
|
|
136
136
|
# require "google/cloud/bigtable"
|
137
137
|
#
|
138
138
|
# bigtable = Google::Cloud::Bigtable.new
|
139
|
-
# table = bigtable.table
|
139
|
+
# table = bigtable.table "my-instance", "my-table"
|
140
140
|
#
|
141
|
-
# filter = table.filter.key
|
141
|
+
# filter = table.filter.key "user-*"
|
142
142
|
# # OR
|
143
|
-
# # filter = Google::Cloud::Bigtable::RowFilter.key
|
143
|
+
# # filter = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
144
144
|
#
|
145
145
|
# table.read_rows(filter: filter, limit: 10).each do |row|
|
146
146
|
# puts row
|
@@ -176,19 +176,19 @@ module Google
|
|
176
176
|
# require "google/cloud/bigtable"
|
177
177
|
#
|
178
178
|
# bigtable = Google::Cloud::Bigtable.new
|
179
|
-
# table = bigtable.table
|
179
|
+
# table = bigtable.table "my-instance", "my-table"
|
180
180
|
#
|
181
|
-
# row = table.read_row
|
181
|
+
# row = table.read_row "user-1"
|
182
182
|
#
|
183
183
|
# @example Read row with filter.
|
184
184
|
# require "google/cloud/bigtable"
|
185
185
|
#
|
186
186
|
# bigtable = Google::Cloud::Bigtable.new
|
187
|
-
# table = bigtable.table
|
187
|
+
# table = bigtable.table "my-instance", "my-table"
|
188
188
|
#
|
189
|
-
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row
|
189
|
+
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row 3
|
190
190
|
#
|
191
|
-
# row = table.read_row
|
191
|
+
# row = table.read_row "user-1", filter: filter
|
192
192
|
#
|
193
193
|
def read_row key, filter: nil
|
194
194
|
read_rows(keys: [key], filter: filter).first
|
@@ -203,11 +203,11 @@ module Google
|
|
203
203
|
# require "google/cloud/bigtable"
|
204
204
|
#
|
205
205
|
# bigtable = Google::Cloud::Bigtable.new
|
206
|
-
# table = bigtable.table
|
206
|
+
# table = bigtable.table "my-instance", "my-table"
|
207
207
|
#
|
208
208
|
# range = table.new_value_range
|
209
|
-
# range.from
|
210
|
-
# range.to
|
209
|
+
# range.from "abc"
|
210
|
+
# range.to "xyz"
|
211
211
|
#
|
212
212
|
# # OR
|
213
213
|
# range = table.new_value_range.from("abc").to("xyz")
|
@@ -216,7 +216,7 @@ module Google
|
|
216
216
|
# require "google/cloud/bigtable"
|
217
217
|
#
|
218
218
|
# bigtable = Google::Cloud::Bigtable.new
|
219
|
-
# table = bigtable.table
|
219
|
+
# table = bigtable.table "my-instance", "my-table"
|
220
220
|
#
|
221
221
|
# range = table.new_value_range.from("abc", inclusive: false).to("xyz")
|
222
222
|
#
|
@@ -234,11 +234,11 @@ module Google
|
|
234
234
|
# require "google/cloud/bigtable"
|
235
235
|
#
|
236
236
|
# bigtable = Google::Cloud::Bigtable.new
|
237
|
-
# table = bigtable.table
|
237
|
+
# table = bigtable.table "my-instance", "my-table"
|
238
238
|
#
|
239
|
-
# range = table.new_column_range
|
240
|
-
# range.from
|
241
|
-
# range.to
|
239
|
+
# range = table.new_column_range "test-family"
|
240
|
+
# range.from "abc"
|
241
|
+
# range.to "xyz"
|
242
242
|
#
|
243
243
|
# # OR
|
244
244
|
# range = table.new_column_range("test-family").from("key-1").to("key-5")
|
@@ -247,7 +247,7 @@ module Google
|
|
247
247
|
# require "google/cloud/bigtable"
|
248
248
|
#
|
249
249
|
# bigtable = Google::Cloud::Bigtable.new
|
250
|
-
# table = bigtable.table
|
250
|
+
# table = bigtable.table "my-instance", "my-table"
|
251
251
|
#
|
252
252
|
# range = table.new_column_range("test-family").from("key-1", inclusive: false).to("key-5")
|
253
253
|
#
|
@@ -264,11 +264,11 @@ module Google
|
|
264
264
|
# require "google/cloud/bigtable"
|
265
265
|
#
|
266
266
|
# bigtable = Google::Cloud::Bigtable.new
|
267
|
-
# table = bigtable.table
|
267
|
+
# table = bigtable.table "my-instance", "my-table"
|
268
268
|
#
|
269
269
|
# range = table.new_row_range
|
270
|
-
# range.from
|
271
|
-
# range.to
|
270
|
+
# range.from "abc"
|
271
|
+
# range.to "xyz"
|
272
272
|
#
|
273
273
|
# # OR
|
274
274
|
# range = table.new_row_range.from("key-1").to("key-5")
|
@@ -277,7 +277,7 @@ module Google
|
|
277
277
|
# require "google/cloud/bigtable"
|
278
278
|
#
|
279
279
|
# bigtable = Google::Cloud::Bigtable.new
|
280
|
-
# table = bigtable.table
|
280
|
+
# table = bigtable.table "my-instance", "my-table"
|
281
281
|
#
|
282
282
|
# range = table.new_row_range.from("key-1", inclusive: false).to("key-5")
|
283
283
|
#
|
@@ -294,9 +294,9 @@ module Google
|
|
294
294
|
# require "google/cloud/bigtable"
|
295
295
|
#
|
296
296
|
# bigtable = Google::Cloud::Bigtable.new
|
297
|
-
# table = bigtable.table
|
297
|
+
# table = bigtable.table "my-instance", "my-table"
|
298
298
|
#
|
299
|
-
# filter = table.filter.key
|
299
|
+
# filter = table.filter.key "user-*"
|
300
300
|
#
|
301
301
|
def filter
|
302
302
|
Google::Cloud::Bigtable::RowFilter
|
@@ -38,10 +38,10 @@ module Google
|
|
38
38
|
#
|
39
39
|
# bigtable = Google::Cloud::Bigtable.new
|
40
40
|
#
|
41
|
-
# instance = bigtable.instance
|
41
|
+
# instance = bigtable.instance "my-instance"
|
42
42
|
#
|
43
43
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.single_cluster_routing(
|
44
|
-
# "my-
|
44
|
+
# "my-cluster",
|
45
45
|
# allow_transactional_writes: true
|
46
46
|
# )
|
47
47
|
#
|
@@ -57,7 +57,7 @@ module Google
|
|
57
57
|
#
|
58
58
|
# bigtable = Google::Cloud::Bigtable.new
|
59
59
|
#
|
60
|
-
# instance = bigtable.instance
|
60
|
+
# instance = bigtable.instance "my-instance"
|
61
61
|
#
|
62
62
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.multi_cluster_routing
|
63
63
|
#
|
@@ -85,7 +85,7 @@ module Google
|
|
85
85
|
#
|
86
86
|
# bigtable = Google::Cloud::Bigtable.new
|
87
87
|
#
|
88
|
-
# instance = bigtable.instance
|
88
|
+
# instance = bigtable.instance "my-instance"
|
89
89
|
#
|
90
90
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.multi_cluster_routing
|
91
91
|
#
|
@@ -116,10 +116,10 @@ module Google
|
|
116
116
|
#
|
117
117
|
# bigtable = Google::Cloud::Bigtable.new
|
118
118
|
#
|
119
|
-
# instance = bigtable.instance
|
119
|
+
# instance = bigtable.instance "my-instance"
|
120
120
|
#
|
121
121
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.single_cluster_routing(
|
122
|
-
# "my-
|
122
|
+
# "my-cluster",
|
123
123
|
# allow_transactional_writes: true
|
124
124
|
# )
|
125
125
|
#
|
@@ -127,10 +127,10 @@ module Google
|
|
127
127
|
# Google::Cloud::Bigtable::RowFilter.pass
|
128
128
|
#
|
129
129
|
# # Key regex filter
|
130
|
-
# Google::Cloud::Bigtable::RowFilter.key
|
130
|
+
# Google::Cloud::Bigtable::RowFilter.key "user-*"
|
131
131
|
#
|
132
132
|
# # Cell limit filter
|
133
|
-
# Google::Cloud::Bigtable::RowFilter.cells_per_row
|
133
|
+
# Google::Cloud::Bigtable::RowFilter.cells_per_row 10
|
134
134
|
#
|
135
135
|
module RowFilter
|
136
136
|
# @private
|
@@ -166,7 +166,7 @@ module Google
|
|
166
166
|
# chain = Google::Cloud::Bigtable::RowFilter.chain
|
167
167
|
#
|
168
168
|
# # Add filters to chain filter
|
169
|
-
# chain.key
|
169
|
+
# chain.key "user-*"
|
170
170
|
# chain.strip_value
|
171
171
|
#
|
172
172
|
# # OR
|
@@ -227,7 +227,7 @@ module Google
|
|
227
227
|
# interleave = Google::Cloud::Bigtable::RowFilter.interleave
|
228
228
|
#
|
229
229
|
# # Add filters to interleave filter
|
230
|
-
# interleave.key
|
230
|
+
# interleave.key "user-*"
|
231
231
|
# interleave.sink
|
232
232
|
#
|
233
233
|
# # OR
|
@@ -267,10 +267,10 @@ module Google
|
|
267
267
|
# @example
|
268
268
|
# require "google/cloud/bigtable"
|
269
269
|
#
|
270
|
-
# predicate = Google::Cloud::Bigtable::RowFilter.key
|
271
|
-
# condition = Google::Cloud::Bigtable::RowFilter.condition
|
270
|
+
# predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
271
|
+
# condition = Google::Cloud::Bigtable::RowFilter.condition predicate
|
272
272
|
#
|
273
|
-
# label = Google::Cloud::Bigtable::RowFilter.label
|
273
|
+
# label = Google::Cloud::Bigtable::RowFilter.label "user"
|
274
274
|
# strip_value = Google::Cloud::Bigtable::RowFilter.strip_value
|
275
275
|
#
|
276
276
|
# # On match apply label, else strip cell values
|
@@ -366,7 +366,7 @@ module Google
|
|
366
366
|
# @example
|
367
367
|
# require "google/cloud/bigtable"
|
368
368
|
#
|
369
|
-
# filter = Google::Cloud::Bigtable::RowFilter.key
|
369
|
+
# filter = Google::Cloud::Bigtable::RowFilter.key "user-.*"
|
370
370
|
#
|
371
371
|
def self.key regex
|
372
372
|
SimpleFilter.new.key regex
|
@@ -385,7 +385,7 @@ module Google
|
|
385
385
|
# @example
|
386
386
|
# require "google/cloud/bigtable"
|
387
387
|
#
|
388
|
-
# filter = Google::Cloud::Bigtable::RowFilter.sample
|
388
|
+
# filter = Google::Cloud::Bigtable::RowFilter.sample 0.5
|
389
389
|
#
|
390
390
|
def self.sample probability
|
391
391
|
SimpleFilter.new.sample probability
|
@@ -409,7 +409,7 @@ module Google
|
|
409
409
|
# @example
|
410
410
|
# require "google/cloud/bigtable"
|
411
411
|
#
|
412
|
-
# filter = Google::Cloud::Bigtable::RowFilter.family
|
412
|
+
# filter = Google::Cloud::Bigtable::RowFilter.family "cf-.*"
|
413
413
|
#
|
414
414
|
def self.family regex
|
415
415
|
SimpleFilter.new.family regex
|
@@ -433,7 +433,7 @@ module Google
|
|
433
433
|
# @example
|
434
434
|
# require "google/cloud/bigtable"
|
435
435
|
#
|
436
|
-
# filter = Google::Cloud::Bigtable::RowFilter.qualifier
|
436
|
+
# filter = Google::Cloud::Bigtable::RowFilter.qualifier "user-name.*"
|
437
437
|
#
|
438
438
|
def self.qualifier regex
|
439
439
|
SimpleFilter.new.qualifier regex
|
@@ -456,7 +456,7 @@ module Google
|
|
456
456
|
# @example
|
457
457
|
# require "google/cloud/bigtable"
|
458
458
|
#
|
459
|
-
# filter = Google::Cloud::Bigtable::RowFilter.value
|
459
|
+
# filter = Google::Cloud::Bigtable::RowFilter.value "abc.*"
|
460
460
|
#
|
461
461
|
def self.value regex
|
462
462
|
SimpleFilter.new.value regex
|
@@ -485,7 +485,7 @@ module Google
|
|
485
485
|
# @example
|
486
486
|
# require "google/cloud/bigtable"
|
487
487
|
#
|
488
|
-
# filter = Google::Cloud::Bigtable::RowFilter.label
|
488
|
+
# filter = Google::Cloud::Bigtable::RowFilter.label "user-detail"
|
489
489
|
#
|
490
490
|
def self.label value
|
491
491
|
SimpleFilter.new.label value
|
@@ -504,7 +504,7 @@ module Google
|
|
504
504
|
# @example
|
505
505
|
# require "google/cloud/bigtable"
|
506
506
|
#
|
507
|
-
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row_offset
|
507
|
+
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row_offset 3
|
508
508
|
#
|
509
509
|
def self.cells_per_row_offset offset
|
510
510
|
SimpleFilter.new.cells_per_row_offset offset
|
@@ -523,7 +523,7 @@ module Google
|
|
523
523
|
# @example
|
524
524
|
# require "google/cloud/bigtable"
|
525
525
|
#
|
526
|
-
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row
|
526
|
+
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row 5
|
527
527
|
#
|
528
528
|
def self.cells_per_row limit
|
529
529
|
SimpleFilter.new.cells_per_row limit
|
@@ -542,7 +542,7 @@ module Google
|
|
542
542
|
# @example
|
543
543
|
# require "google/cloud/bigtable"
|
544
544
|
#
|
545
|
-
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_column
|
545
|
+
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_column 5
|
546
546
|
#
|
547
547
|
def self.cells_per_column limit
|
548
548
|
SimpleFilter.new.cells_per_column limit
|
@@ -561,17 +561,17 @@ module Google
|
|
561
561
|
# @example
|
562
562
|
# require "google/cloud/bigtable"
|
563
563
|
#
|
564
|
-
# timestamp_micros = (Time.now.to_f *
|
565
|
-
# from = timestamp_micros -
|
564
|
+
# timestamp_micros = (Time.now.to_f * 1_000_000).round(-3)
|
565
|
+
# from = timestamp_micros - 300_000_000
|
566
566
|
# to = timestamp_micros
|
567
567
|
#
|
568
|
-
# filter = Google::Cloud::Bigtable::RowFilter.timestamp_range
|
568
|
+
# filter = Google::Cloud::Bigtable::RowFilter.timestamp_range from: from, to: to
|
569
569
|
#
|
570
570
|
# # From to infinity
|
571
|
-
# filter = Google::Cloud::Bigtable::RowFilter.timestamp_range
|
571
|
+
# filter = Google::Cloud::Bigtable::RowFilter.timestamp_range from: from
|
572
572
|
#
|
573
573
|
# # From 0 value to `to`
|
574
|
-
# filter = Google::Cloud::Bigtable::RowFilter.timestamp_range
|
574
|
+
# filter = Google::Cloud::Bigtable::RowFilter.timestamp_range to: to
|
575
575
|
#
|
576
576
|
def self.timestamp_range from: nil, to: nil
|
577
577
|
SimpleFilter.new.timestamp_range from, to
|
@@ -597,19 +597,19 @@ module Google
|
|
597
597
|
# require "google/cloud/bigtable"
|
598
598
|
#
|
599
599
|
# bigtable = Google::Cloud::Bigtable.new
|
600
|
-
# table = bigtable.table
|
600
|
+
# table = bigtable.table "my-instance", "my-table"
|
601
601
|
#
|
602
|
-
# range = table.new_value_range.from
|
603
|
-
# filter = Google::Cloud::Bigtable::RowFilter.value_range
|
602
|
+
# range = table.new_value_range.from "value-001", inclusive: false
|
603
|
+
# filter = Google::Cloud::Bigtable::RowFilter.value_range range
|
604
604
|
#
|
605
605
|
# @example Start exclusive to infinite end range.
|
606
606
|
# require "google/cloud/bigtable"
|
607
607
|
#
|
608
608
|
# bigtable = Google::Cloud::Bigtable.new
|
609
|
-
# table = bigtable.table
|
609
|
+
# table = bigtable.table "my-instance", "my-table"
|
610
610
|
#
|
611
|
-
# range = table.new_value_range.from
|
612
|
-
# filter = Google::Cloud::Bigtable::RowFilter.value_range
|
611
|
+
# range = table.new_value_range.from "value-001", inclusive: false
|
612
|
+
# filter = Google::Cloud::Bigtable::RowFilter.value_range range
|
613
613
|
#
|
614
614
|
def self.value_range range
|
615
615
|
SimpleFilter.new.value_range range
|
@@ -628,7 +628,7 @@ module Google
|
|
628
628
|
#
|
629
629
|
# range = Google::Cloud::Bigtable::ColumnRange.new("cf").from("field0").to("field5")
|
630
630
|
#
|
631
|
-
# filter = Google::Cloud::Bigtable::RowFilter.column_range
|
631
|
+
# filter = Google::Cloud::Bigtable::RowFilter.column_range range
|
632
632
|
#
|
633
633
|
def self.column_range range
|
634
634
|
SimpleFilter.new.column_range range
|
@@ -35,7 +35,7 @@ module Google
|
|
35
35
|
#
|
36
36
|
# chain = Google::Cloud::Bigtable::RowFilter.chain
|
37
37
|
# # Add filters to chain filter
|
38
|
-
# chain.key("user-*").label
|
38
|
+
# chain.key("user-*").label "users"
|
39
39
|
#
|
40
40
|
class ChainFilter
|
41
41
|
# @private
|
@@ -65,13 +65,13 @@ module Google
|
|
65
65
|
# chain_1 = Google::Cloud::Bigtable::RowFilter.chain
|
66
66
|
#
|
67
67
|
# # Add filters to chain filter
|
68
|
-
# chain_1.key("user-*").cells_per_row
|
68
|
+
# chain_1.key("user-*").cells_per_row 5
|
69
69
|
#
|
70
70
|
# filter = Google::Cloud::Bigtable::RowFilter.chain
|
71
|
-
# filter.chain
|
71
|
+
# filter.chain chain_1
|
72
72
|
#
|
73
73
|
# # OR
|
74
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.chain
|
74
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.chain chain_1
|
75
75
|
#
|
76
76
|
def chain filter
|
77
77
|
raise RowFilterError, "Filter type must be ChainFilter" unless filter.instance_of? ChainFilter
|
@@ -124,7 +124,7 @@ module Google
|
|
124
124
|
# # Add filters to interleave filter
|
125
125
|
# interleave.key("user-*").cells_per_column(3)
|
126
126
|
#
|
127
|
-
# chain = Google::Cloud::Bigtable::RowFilter.chain.interleave
|
127
|
+
# chain = Google::Cloud::Bigtable::RowFilter.chain.interleave interleave
|
128
128
|
#
|
129
129
|
def interleave filter
|
130
130
|
raise RowFilterError, "Filter type must be InterleaveFilter" unless filter.instance_of? InterleaveFilter
|
@@ -151,15 +151,16 @@ module Google
|
|
151
151
|
# @example
|
152
152
|
# require "google/cloud/bigtable"
|
153
153
|
#
|
154
|
-
# predicate = Google::Cloud::Bigtable::RowFilter.key
|
154
|
+
# predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
155
155
|
#
|
156
|
-
# label = Google::Cloud::Bigtable::RowFilter.label
|
156
|
+
# label = Google::Cloud::Bigtable::RowFilter.label "user"
|
157
157
|
# strip_value = Google::Cloud::Bigtable::RowFilter.strip_value
|
158
158
|
#
|
159
|
-
# condition_filter = Google::Cloud::Bigtable::RowFilter.
|
160
|
-
#
|
159
|
+
# condition_filter = Google::Cloud::Bigtable::RowFilter.condition(predicate)
|
160
|
+
# .on_match(label)
|
161
|
+
# .otherwise(strip_value)
|
161
162
|
#
|
162
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.condition
|
163
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.condition condition_filter
|
163
164
|
#
|
164
165
|
def condition filter
|
165
166
|
raise RowFilterError, "Filter type must be ConditionFilter" unless filter.instance_of? ConditionFilter
|
@@ -257,7 +258,7 @@ module Google
|
|
257
258
|
# @example
|
258
259
|
# require "google/cloud/bigtable"
|
259
260
|
#
|
260
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.key
|
261
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.key "user-*"
|
261
262
|
#
|
262
263
|
def key regex
|
263
264
|
add RowFilter.key(regex)
|
@@ -277,7 +278,7 @@ module Google
|
|
277
278
|
# @example
|
278
279
|
# require "google/cloud/bigtable"
|
279
280
|
#
|
280
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.sample
|
281
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.sample 0.5
|
281
282
|
#
|
282
283
|
def sample probability
|
283
284
|
add RowFilter.sample(probability)
|
@@ -303,7 +304,7 @@ module Google
|
|
303
304
|
# @example
|
304
305
|
# require "google/cloud/bigtable"
|
305
306
|
#
|
306
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.family
|
307
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.family "cf-*"
|
307
308
|
#
|
308
309
|
def family regex
|
309
310
|
add RowFilter.family(regex)
|
@@ -329,7 +330,7 @@ module Google
|
|
329
330
|
# @example
|
330
331
|
# require "google/cloud/bigtable"
|
331
332
|
#
|
332
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.qualifier
|
333
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.qualifier "user-name*"
|
333
334
|
#
|
334
335
|
def qualifier regex
|
335
336
|
add RowFilter.qualifier(regex)
|
@@ -354,7 +355,7 @@ module Google
|
|
354
355
|
# @example
|
355
356
|
# require "google/cloud/bigtable"
|
356
357
|
#
|
357
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.value
|
358
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.value "abc*"
|
358
359
|
#
|
359
360
|
def value regex
|
360
361
|
add RowFilter.value(regex)
|
@@ -383,7 +384,7 @@ module Google
|
|
383
384
|
# @example
|
384
385
|
# require "google/cloud/bigtable"
|
385
386
|
#
|
386
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.label
|
387
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.label "user-detail"
|
387
388
|
#
|
388
389
|
def label value
|
389
390
|
add RowFilter.label(value)
|
@@ -403,7 +404,7 @@ module Google
|
|
403
404
|
# @example
|
404
405
|
# require "google/cloud/bigtable"
|
405
406
|
#
|
406
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.cells_per_row_offset
|
407
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.cells_per_row_offset 3
|
407
408
|
#
|
408
409
|
def cells_per_row_offset offset
|
409
410
|
add RowFilter.cells_per_row_offset(offset)
|
@@ -423,7 +424,7 @@ module Google
|
|
423
424
|
# @example
|
424
425
|
# require "google/cloud/bigtable"
|
425
426
|
#
|
426
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.cells_per_row
|
427
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.cells_per_row 5
|
427
428
|
#
|
428
429
|
def cells_per_row limit
|
429
430
|
add RowFilter.cells_per_row(limit)
|
@@ -446,7 +447,7 @@ module Google
|
|
446
447
|
# @example
|
447
448
|
# require "google/cloud/bigtable"
|
448
449
|
#
|
449
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.cells_per_column
|
450
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.cells_per_column 5
|
450
451
|
#
|
451
452
|
def cells_per_column limit
|
452
453
|
add RowFilter.cells_per_column(limit)
|
@@ -468,11 +469,11 @@ module Google
|
|
468
469
|
# @example
|
469
470
|
# require "google/cloud/bigtable"
|
470
471
|
#
|
471
|
-
# timestamp_micros = (Time.now.to_f *
|
472
|
-
# from = timestamp_micros -
|
472
|
+
# timestamp_micros = (Time.now.to_f * 1_000_000).round(-3)
|
473
|
+
# from = timestamp_micros - 300_000_000
|
473
474
|
# to = timestamp_micros
|
474
475
|
#
|
475
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.timestamp_range
|
476
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.timestamp_range from: from, to: to
|
476
477
|
#
|
477
478
|
def timestamp_range from: nil, to: nil
|
478
479
|
add RowFilter.timestamp_range(from: from, to: to)
|
@@ -498,19 +499,19 @@ module Google
|
|
498
499
|
# require "google/cloud/bigtable"
|
499
500
|
#
|
500
501
|
# bigtable = Google::Cloud::Bigtable.new
|
501
|
-
# table = bigtable.table
|
502
|
+
# table = bigtable.table "my-instance", "my-table"
|
502
503
|
#
|
503
504
|
# range = table.new_value_range.from("value-001").to("value-005")
|
504
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.value_range
|
505
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.value_range range
|
505
506
|
#
|
506
507
|
# @example Start exclusive to infinite end range.
|
507
508
|
# require "google/cloud/bigtable"
|
508
509
|
#
|
509
510
|
# bigtable = Google::Cloud::Bigtable.new
|
510
|
-
# table = bigtable.table
|
511
|
+
# table = bigtable.table "my-instance", "my-table"
|
511
512
|
#
|
512
|
-
# range = table.new_value_range.from
|
513
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.value_range
|
513
|
+
# range = table.new_value_range.from "value-001", inclusive: false
|
514
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.value_range range
|
514
515
|
#
|
515
516
|
def value_range range
|
516
517
|
add RowFilter.value_range(range)
|
@@ -528,9 +529,9 @@ module Google
|
|
528
529
|
# @example
|
529
530
|
# require "google/cloud/bigtable"
|
530
531
|
#
|
531
|
-
# range = Google::Cloud::Bigtable::ColumnRange.new("cf").from("field0").to(
|
532
|
+
# range = Google::Cloud::Bigtable::ColumnRange.new("cf").from("field0").to("field5")
|
532
533
|
#
|
533
|
-
# filter = Google::Cloud::Bigtable::RowFilter.chain.column_range
|
534
|
+
# filter = Google::Cloud::Bigtable::RowFilter.chain.column_range range
|
534
535
|
#
|
535
536
|
def column_range range
|
536
537
|
add RowFilter.column_range(range)
|