google-cloud-bigtable 2.4.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/AUTHENTICATION.md +2 -1
- data/CHANGELOG.md +32 -0
- data/CONTRIBUTING.md +2 -3
- data/OVERVIEW.md +1 -1
- 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 +83 -32
- 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 +37 -17
- 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 +118 -0
- 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 +61 -21
- 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/service.rb +6 -3
- data/lib/google/cloud/bigtable/status.rb +2 -2
- data/lib/google/cloud/bigtable/table.rb +66 -43
- data/lib/google/cloud/bigtable/table/cluster_state.rb +43 -9
- 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 +4 -3
@@ -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)
|
@@ -34,9 +34,9 @@ module Google
|
|
34
34
|
# evaluated on the input row. Otherwise, `false_filter` will be evaluated.
|
35
35
|
#
|
36
36
|
# @example
|
37
|
-
# predicate = Google::Cloud::Bigtable::RowFilter.key
|
37
|
+
# predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
38
38
|
#
|
39
|
-
# label = Google::Cloud::Bigtable::RowFilter.label
|
39
|
+
# label = Google::Cloud::Bigtable::RowFilter.label "user"
|
40
40
|
# strip_value = Google::Cloud::Bigtable::RowFilter.strip_value
|
41
41
|
#
|
42
42
|
# Google::Cloud::Bigtable::RowFilter.condition(predicate).on_match(label).otherwise(strip_value)
|
@@ -63,9 +63,9 @@ module Google
|
|
63
63
|
#
|
64
64
|
# @example
|
65
65
|
# require "google/cloud/bigtable"
|
66
|
-
# predicate = Google::Cloud::Bigtable::RowFilter.key
|
66
|
+
# predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
67
67
|
#
|
68
|
-
# label = Google::Cloud::Bigtable::RowFilter.label
|
68
|
+
# label = Google::Cloud::Bigtable::RowFilter.label "user"
|
69
69
|
# strip_value = Google::Cloud::Bigtable::RowFilter.strip_value
|
70
70
|
#
|
71
71
|
# Google::Cloud::Bigtable::RowFilter.condition(predicate).on_match(label).otherwise(strip_value)
|
@@ -88,9 +88,9 @@ module Google
|
|
88
88
|
# @example
|
89
89
|
# require "google/cloud/bigtable"
|
90
90
|
#
|
91
|
-
# predicate = Google::Cloud::Bigtable::RowFilter.key
|
91
|
+
# predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
92
92
|
#
|
93
|
-
# label = Google::Cloud::Bigtable::RowFilter.label
|
93
|
+
# label = Google::Cloud::Bigtable::RowFilter.label "user"
|
94
94
|
# strip_value = Google::Cloud::Bigtable::RowFilter.strip_value
|
95
95
|
#
|
96
96
|
# Google::Cloud::Bigtable::RowFilter.condition(predicate).on_match(label).otherwise(strip_value)
|
@@ -57,7 +57,7 @@ module Google
|
|
57
57
|
# interleave = Google::Cloud::Bigtable::RowFilter.interleave
|
58
58
|
#
|
59
59
|
# # Add filters to interleave filter
|
60
|
-
# interleave.key
|
60
|
+
# interleave.key "user-*"
|
61
61
|
# interleave.sink
|
62
62
|
#
|
63
63
|
# # OR
|
@@ -104,7 +104,7 @@ module Google
|
|
104
104
|
# # Add filters to chain filter
|
105
105
|
# chain.key("user-*").cells_per_row(5)
|
106
106
|
#
|
107
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.chain
|
107
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.chain chain
|
108
108
|
#
|
109
109
|
def chain filter
|
110
110
|
raise RowFilterError, "Filter type must be ChainFilter" unless filter.instance_of? ChainFilter
|
@@ -155,7 +155,7 @@ module Google
|
|
155
155
|
# # Add filters to an interleave filter.
|
156
156
|
# interleave.key("user-*").cells_per_column(3)
|
157
157
|
#
|
158
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.interleave
|
158
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.interleave interleave
|
159
159
|
#
|
160
160
|
def interleave filter
|
161
161
|
raise RowFilterError, "Filter type must be InterleaveFilter" unless filter.instance_of? InterleaveFilter
|
@@ -182,15 +182,16 @@ module Google
|
|
182
182
|
# @example
|
183
183
|
# require "google/cloud/bigtable"
|
184
184
|
#
|
185
|
-
# predicate = Google::Cloud::Bigtable::RowFilter.key
|
185
|
+
# predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"
|
186
186
|
#
|
187
|
-
# label = Google::Cloud::Bigtable::RowFilter.label
|
187
|
+
# label = Google::Cloud::Bigtable::RowFilter.label "user"
|
188
188
|
# strip_value = Google::Cloud::Bigtable::RowFilter.strip_value
|
189
189
|
#
|
190
|
-
# condition_filter = Google::Cloud::Bigtable::RowFilter.
|
191
|
-
#
|
190
|
+
# condition_filter = Google::Cloud::Bigtable::RowFilter.condition(predicate)
|
191
|
+
# .on_match(label)
|
192
|
+
# .otherwise(strip_value)
|
192
193
|
#
|
193
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.condition
|
194
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.condition condition_filter
|
194
195
|
#
|
195
196
|
def condition filter
|
196
197
|
raise RowFilterError, "Filter type must be ConditionFilter" unless filter.instance_of? ConditionFilter
|
@@ -288,7 +289,7 @@ module Google
|
|
288
289
|
# @example
|
289
290
|
# require "google/cloud/bigtable"
|
290
291
|
#
|
291
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.key
|
292
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.key "user-*"
|
292
293
|
#
|
293
294
|
def key regex
|
294
295
|
add RowFilter.key(regex)
|
@@ -308,7 +309,7 @@ module Google
|
|
308
309
|
# @example
|
309
310
|
# require "google/cloud/bigtable"
|
310
311
|
#
|
311
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.sample
|
312
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.sample 0.5
|
312
313
|
#
|
313
314
|
def sample probability
|
314
315
|
add RowFilter.sample(probability)
|
@@ -334,7 +335,7 @@ module Google
|
|
334
335
|
# @example
|
335
336
|
# require "google/cloud/bigtable"
|
336
337
|
#
|
337
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.family
|
338
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.family "cf-*"
|
338
339
|
#
|
339
340
|
def family regex
|
340
341
|
add RowFilter.family(regex)
|
@@ -360,7 +361,7 @@ module Google
|
|
360
361
|
# @example
|
361
362
|
# require "google/cloud/bigtable"
|
362
363
|
#
|
363
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.qualifier
|
364
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.qualifier "user-name*"
|
364
365
|
#
|
365
366
|
def qualifier regex
|
366
367
|
add RowFilter.qualifier(regex)
|
@@ -385,7 +386,7 @@ module Google
|
|
385
386
|
# @example
|
386
387
|
# require "google/cloud/bigtable"
|
387
388
|
#
|
388
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.value
|
389
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.value "abc*"
|
389
390
|
#
|
390
391
|
def value regex
|
391
392
|
add RowFilter.value(regex)
|
@@ -414,7 +415,7 @@ module Google
|
|
414
415
|
# @example
|
415
416
|
# require "google/cloud/bigtable"
|
416
417
|
#
|
417
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.label
|
418
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.label "user-detail"
|
418
419
|
#
|
419
420
|
def label value
|
420
421
|
add RowFilter.label(value)
|
@@ -434,7 +435,7 @@ module Google
|
|
434
435
|
# @example
|
435
436
|
# require "google/cloud/bigtable"
|
436
437
|
#
|
437
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_row_offset
|
438
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_row_offset 3
|
438
439
|
#
|
439
440
|
def cells_per_row_offset offset
|
440
441
|
add RowFilter.cells_per_row_offset(offset)
|
@@ -454,7 +455,7 @@ module Google
|
|
454
455
|
# @example
|
455
456
|
# require "google/cloud/bigtable"
|
456
457
|
#
|
457
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_row
|
458
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_row 5
|
458
459
|
#
|
459
460
|
def cells_per_row limit
|
460
461
|
add RowFilter.cells_per_row(limit)
|
@@ -477,7 +478,7 @@ module Google
|
|
477
478
|
# @example
|
478
479
|
# require "google/cloud/bigtable"
|
479
480
|
#
|
480
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_column
|
481
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_column 5
|
481
482
|
#
|
482
483
|
def cells_per_column limit
|
483
484
|
add RowFilter.cells_per_column(limit)
|
@@ -499,11 +500,11 @@ module Google
|
|
499
500
|
# @example
|
500
501
|
# require "google/cloud/bigtable"
|
501
502
|
#
|
502
|
-
# timestamp_micros = (Time.now.to_f *
|
503
|
-
# from = timestamp_micros -
|
503
|
+
# timestamp_micros = (Time.now.to_f * 1_000_000).round(-3)
|
504
|
+
# from = timestamp_micros - 300_000_000
|
504
505
|
# to = timestamp_micros
|
505
506
|
#
|
506
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.timestamp_range
|
507
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.timestamp_range from: from, to: to
|
507
508
|
#
|
508
509
|
def timestamp_range from: nil, to: nil
|
509
510
|
add RowFilter.timestamp_range(from: from, to: to)
|
@@ -529,19 +530,19 @@ module Google
|
|
529
530
|
# require "google/cloud/bigtable"
|
530
531
|
#
|
531
532
|
# bigtable = Google::Cloud::Bigtable.new
|
532
|
-
# table = bigtable.table
|
533
|
+
# table = bigtable.table "my-instance", "my-table"
|
533
534
|
#
|
534
535
|
# range = table.new_value_range.from("value-001").to("value-005")
|
535
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.value_range
|
536
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.value_range range
|
536
537
|
#
|
537
538
|
# @example Start exlusive to infinite end range.
|
538
539
|
# require "google/cloud/bigtable"
|
539
540
|
#
|
540
541
|
# bigtable = Google::Cloud::Bigtable.new
|
541
|
-
# table = bigtable.table
|
542
|
+
# table = bigtable.table "my-instance", "my-table"
|
542
543
|
#
|
543
|
-
# range = table.new_value_range.from
|
544
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.value_range
|
544
|
+
# range = table.new_value_range.from "value-001", inclusive: false
|
545
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.value_range range
|
545
546
|
#
|
546
547
|
def value_range range
|
547
548
|
add RowFilter.value_range(range)
|
@@ -561,7 +562,7 @@ module Google
|
|
561
562
|
#
|
562
563
|
# range = Google::Cloud::Bigtable::ColumnRange.new("cf").from("field0").to("field5")
|
563
564
|
#
|
564
|
-
# filter = Google::Cloud::Bigtable::RowFilter.interleave.column_range
|
565
|
+
# filter = Google::Cloud::Bigtable::RowFilter.interleave.column_range range
|
565
566
|
#
|
566
567
|
def column_range range
|
567
568
|
add RowFilter.column_range(range)
|