google-cloud-bigtable 0.6.2 → 0.7.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/CONTRIBUTING.md +1 -1
  4. data/lib/google-cloud-bigtable.rb +19 -21
  5. data/lib/google/cloud/bigtable.rb +11 -17
  6. data/lib/google/cloud/bigtable/app_profile.rb +148 -82
  7. data/lib/google/cloud/bigtable/app_profile/job.rb +5 -8
  8. data/lib/google/cloud/bigtable/app_profile/list.rb +11 -5
  9. data/lib/google/cloud/bigtable/chunk_processor.rb +23 -35
  10. data/lib/google/cloud/bigtable/cluster.rb +38 -11
  11. data/lib/google/cloud/bigtable/cluster/job.rb +3 -7
  12. data/lib/google/cloud/bigtable/cluster/list.rb +20 -18
  13. data/lib/google/cloud/bigtable/column_family.rb +22 -229
  14. data/lib/google/cloud/bigtable/column_family_map.rb +426 -0
  15. data/lib/google/cloud/bigtable/column_range.rb +9 -1
  16. data/lib/google/cloud/bigtable/convert.rb +12 -4
  17. data/lib/google/cloud/bigtable/errors.rb +4 -1
  18. data/lib/google/cloud/bigtable/gc_rule.rb +184 -65
  19. data/lib/google/cloud/bigtable/instance.rb +136 -126
  20. data/lib/google/cloud/bigtable/instance/cluster_map.rb +9 -7
  21. data/lib/google/cloud/bigtable/instance/job.rb +4 -3
  22. data/lib/google/cloud/bigtable/instance/list.rb +14 -9
  23. data/lib/google/cloud/bigtable/longrunning_job.rb +6 -0
  24. data/lib/google/cloud/bigtable/mutation_entry.rb +19 -23
  25. data/lib/google/cloud/bigtable/mutation_operations.rb +82 -29
  26. data/lib/google/cloud/bigtable/policy.rb +9 -5
  27. data/lib/google/cloud/bigtable/project.rb +62 -140
  28. data/lib/google/cloud/bigtable/read_modify_write_rule.rb +9 -4
  29. data/lib/google/cloud/bigtable/read_operations.rb +28 -41
  30. data/lib/google/cloud/bigtable/routing_policy.rb +171 -0
  31. data/lib/google/cloud/bigtable/row.rb +18 -7
  32. data/lib/google/cloud/bigtable/row_filter.rb +49 -20
  33. data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +71 -43
  34. data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +4 -1
  35. data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +74 -43
  36. data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +22 -7
  37. data/lib/google/cloud/bigtable/row_range.rb +5 -0
  38. data/lib/google/cloud/bigtable/rows_mutator.rb +14 -17
  39. data/lib/google/cloud/bigtable/rows_reader.rb +18 -14
  40. data/lib/google/cloud/bigtable/sample_row_key.rb +5 -2
  41. data/lib/google/cloud/bigtable/service.rb +161 -242
  42. data/lib/google/cloud/bigtable/status.rb +76 -0
  43. data/lib/google/cloud/bigtable/table.rb +141 -236
  44. data/lib/google/cloud/bigtable/table/cluster_state.rb +7 -1
  45. data/lib/google/cloud/bigtable/table/list.rb +14 -7
  46. data/lib/google/cloud/bigtable/value_range.rb +5 -0
  47. data/lib/google/cloud/bigtable/version.rb +1 -1
  48. metadata +27 -25
  49. data/lib/google/cloud/bigtable/table/column_family_map.rb +0 -70
@@ -19,6 +19,7 @@ module Google
19
19
  module Cloud
20
20
  module Bigtable
21
21
  module RowFilter
22
+ ##
22
23
  # # ConditionFilter
23
24
  #
24
25
  # A RowFilter that evaluates one of two possible RowFilters, depending on
@@ -51,6 +52,7 @@ module Google
51
52
  @grpc.predicate_filter = predicate.to_grpc
52
53
  end
53
54
 
55
+ ##
54
56
  # Set a true filter on predicate-filter match.
55
57
  #
56
58
  # The filter to apply to the input row if `predicate_filter` returns any
@@ -72,6 +74,7 @@ module Google
72
74
  self
73
75
  end
74
76
 
77
+ ##
75
78
  # Set otherwise(false) filter.
76
79
  #
77
80
  # The filter to apply to the input row if `predicate_filter` does not
@@ -99,7 +102,7 @@ module Google
99
102
  # @return [Google::Bigtable::V2::RowFilter]
100
103
  #
101
104
  def to_grpc
102
- Google::Bigtable::V2::RowFilter.new(condition: @grpc)
105
+ Google::Bigtable::V2::RowFilter.new condition: @grpc
103
106
  end
104
107
  end
105
108
  end
@@ -19,6 +19,7 @@ module Google
19
19
  module Cloud
20
20
  module Bigtable
21
21
  module RowFilter
22
+ ##
22
23
  # # InterleaveFilter
23
24
  #
24
25
  # A RowFilter that sends each row to each of several component
@@ -59,7 +60,7 @@ module Google
59
60
  # interleave.sink
60
61
  #
61
62
  # # OR
62
- # interleave.key("user-*).sink
63
+ # interleave.key("user-*").sink
63
64
  #
64
65
  # @example Create a complex interleave filter.
65
66
  #
@@ -69,13 +70,16 @@ module Google
69
70
  # chain_1.label("users").qualifier("name").cells_per_row(5)
70
71
  #
71
72
  # # Add to main chain filter
72
- # interleave.chain(chain_1).value("xyz*).key("user-*")
73
+ # interleave.chain(chain_1).value("xyz*").key("user-*")
73
74
  #
74
75
  class InterleaveFilter
76
+ # @private
77
+ # Creates an instance of an interleave filter.
75
78
  def initialize
76
- @grpc = Google::Bigtable::V2::RowFilter::Interleave.new
79
+ @filters = []
77
80
  end
78
81
 
82
+ ##
79
83
  # Adds a chain filter instance.
80
84
  #
81
85
  # A Chain RowFilter that sends rows through several RowFilters in sequence.
@@ -100,12 +104,11 @@ module Google
100
104
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.chain(chain)
101
105
  #
102
106
  def chain filter
103
- unless filter.instance_of?(ChainFilter)
104
- raise RowFilterError, "Filter type must be ChainFilter"
105
- end
106
- add(filter)
107
+ raise RowFilterError, "Filter type must be ChainFilter" unless filter.instance_of? ChainFilter
108
+ add filter
107
109
  end
108
110
 
111
+ ##
109
112
  # Adds an interleave filter.
110
113
  #
111
114
  # A RowFilter that sends each row to each of several component
@@ -151,12 +154,11 @@ module Google
151
154
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.interleave(interleave)
152
155
  #
153
156
  def interleave filter
154
- unless filter.instance_of?(InterleaveFilter)
155
- raise RowFilterError, "Filter type must be InterleaveFilter"
156
- end
157
- add(filter)
157
+ raise RowFilterError, "Filter type must be InterleaveFilter" unless filter.instance_of? InterleaveFilter
158
+ add filter
158
159
  end
159
160
 
161
+ ##
160
162
  # Adds a condition filter instance.
161
163
  #
162
164
  # A RowFilter that evaluates one of two possible RowFilters, depending on
@@ -180,17 +182,17 @@ module Google
180
182
  # label = Google::Cloud::Bigtable::RowFilter.label("user")
181
183
  # strip_value = Google::Cloud::Bigtable::RowFilter.strip_value
182
184
  #
183
- # condition_filter = Google::Cloud::Bigtable::RowFilter.condition(predicate).on_match(label).otherwise(strip_value)
185
+ # condition_filter = Google::Cloud::Bigtable::RowFilter.
186
+ # condition(predicate).on_match(label).otherwise(strip_value)
184
187
  #
185
188
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.condition(condition_filter)
186
189
  #
187
190
  def condition filter
188
- unless filter.instance_of?(ConditionFilter)
189
- raise RowFilterError, "Filter type must be ConditionFilter"
190
- end
191
- add(filter)
191
+ raise RowFilterError, "Filter type must be ConditionFilter" unless filter.instance_of? ConditionFilter
192
+ add filter
192
193
  end
193
194
 
195
+ ##
194
196
  # Adds a pass filter instance.
195
197
  #
196
198
  # Matches all cells, regardless of input. Functionally equivalent to
@@ -204,9 +206,10 @@ module Google
204
206
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.pass
205
207
  #
206
208
  def pass
207
- add(RowFilter.pass)
209
+ add RowFilter.pass
208
210
  end
209
211
 
212
+ ##
210
213
  # Adds a block-all filter instance.
211
214
  #
212
215
  # Does not match any cells, regardless of input. Useful for temporarily
@@ -220,9 +223,10 @@ module Google
220
223
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.block
221
224
  #
222
225
  def block
223
- add(RowFilter.block)
226
+ add RowFilter.block
224
227
  end
225
228
 
229
+ ##
226
230
  # Adds a sink filter instance.
227
231
  #
228
232
  # Outputs all cells directly to the output of the read rather than to any parent filter.
@@ -235,9 +239,10 @@ module Google
235
239
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.sink
236
240
  #
237
241
  def sink
238
- add(RowFilter.sink)
242
+ add RowFilter.sink
239
243
  end
240
244
 
245
+ ##
241
246
  # Adds a strip-value filter instance.
242
247
  #
243
248
  # Replaces each cell's value with an empty string.
@@ -250,9 +255,10 @@ module Google
250
255
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.strip_value
251
256
  #
252
257
  def strip_value
253
- add(RowFilter.strip_value)
258
+ add RowFilter.strip_value
254
259
  end
255
260
 
261
+ ##
256
262
  # Adds a row-key filter instance to match key using a regular expression.
257
263
  #
258
264
  # Matches only cells from rows whose keys satisfy the given RE2 regex. In
@@ -275,9 +281,10 @@ module Google
275
281
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.key("user-*")
276
282
  #
277
283
  def key regex
278
- add(RowFilter.key(regex))
284
+ add RowFilter.key(regex)
279
285
  end
280
286
 
287
+ ##
281
288
  # Adds a sample-probability filter instance.
282
289
  #
283
290
  # Matches all cells from a row with probability p, and matches no cells
@@ -293,9 +300,10 @@ module Google
293
300
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.sample(0.5)
294
301
  #
295
302
  def sample probability
296
- add(RowFilter.sample(probability))
303
+ add RowFilter.sample(probability)
297
304
  end
298
305
 
306
+ ##
299
307
  # Adds a family-name-match filter using a regular expression.
300
308
  #
301
309
  # Matches only cells from columns whose families satisfy the given RE2
@@ -317,9 +325,10 @@ module Google
317
325
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.family("cf-*")
318
326
  #
319
327
  def family regex
320
- add(RowFilter.family(regex))
328
+ add RowFilter.family(regex)
321
329
  end
322
330
 
331
+ ##
323
332
  # Adds a column-qualifier-match filter using a regular expression.
324
333
  #
325
334
  # Matches only cells from columns whose qualifiers satisfy the given RE2
@@ -341,9 +350,10 @@ module Google
341
350
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.qualifier("user-name*")
342
351
  #
343
352
  def qualifier regex
344
- add(RowFilter.qualifier(regex))
353
+ add RowFilter.qualifier(regex)
345
354
  end
346
355
 
356
+ ##
347
357
  # Adds a value-match filter using a regular expression.
348
358
  #
349
359
  # Matches only cells with values that satisfy the given regular expression.
@@ -364,9 +374,10 @@ module Google
364
374
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.value("abc*")
365
375
  #
366
376
  def value regex
367
- add(RowFilter.value(regex))
377
+ add RowFilter.value(regex)
368
378
  end
369
379
 
380
+ ##
370
381
  # Adds a label filter instance to apply a label based on the result of read rows.
371
382
  #
372
383
  # Applies the given label to all cells in the output row. This allows
@@ -391,9 +402,10 @@ module Google
391
402
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.label("user-detail")
392
403
  #
393
404
  def label value
394
- add(RowFilter.label(value))
405
+ add RowFilter.label(value)
395
406
  end
396
407
 
408
+ ##
397
409
  # Adds a cell-per-row-offset filter instance to skip the first N cells.
398
410
  #
399
411
  # Skips the first N cells of each row, matching all subsequent cells.
@@ -409,9 +421,10 @@ module Google
409
421
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_row_offset(3)
410
422
  #
411
423
  def cells_per_row_offset offset
412
- add(RowFilter.cells_per_row_offset(offset))
424
+ add RowFilter.cells_per_row_offset(offset)
413
425
  end
414
426
 
427
+ ##
415
428
  # Adds a cells-per-row-limit filter instance.
416
429
  #
417
430
  # Matches only the first N cells of each row.
@@ -427,9 +440,10 @@ module Google
427
440
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_row(5)
428
441
  #
429
442
  def cells_per_row limit
430
- add(RowFilter.cells_per_row(limit))
443
+ add RowFilter.cells_per_row(limit)
431
444
  end
432
445
 
446
+ ##
433
447
  # Adds a cells-per-column filter instance.
434
448
  #
435
449
  # Matches only the most recent N cells within each column. For example,
@@ -448,9 +462,10 @@ module Google
448
462
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.cells_per_column(5)
449
463
  #
450
464
  def cells_per_column limit
451
- add(RowFilter.cells_per_column(limit))
465
+ add RowFilter.cells_per_column(limit)
452
466
  end
453
467
 
468
+ ##
454
469
  # Adds a timestamp-range filter instance.
455
470
  #
456
471
  # Matches only cells with timestamps within the given range.
@@ -472,9 +487,10 @@ module Google
472
487
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.timestamp_range(from: from, to: to)
473
488
  #
474
489
  def timestamp_range from: nil, to: nil
475
- add(RowFilter.timestamp_range(from: from, to: to))
490
+ add RowFilter.timestamp_range(from: from, to: to)
476
491
  end
477
492
 
493
+ ##
478
494
  # Adds a value-range filter instance.
479
495
  #
480
496
  # Matches only cells with values that fall within the given range.
@@ -483,26 +499,36 @@ module Google
483
499
  # option inclusive/exclusive options.
484
500
  #
485
501
  # * The value at which to start the range. If neither field is set, interpreted as an empty string, inclusive.
486
- # * The value at which to end the range. If neither field is set, interpreted as an infinite string, exclusive.
502
+ # * The value at which to end the range. If neither field is set, interpreted as an infinite string,
503
+ # exclusive.
487
504
  #
488
505
  # @param range [Google::Cloud::Bigtable::ValueRange]
489
506
  # @return [Google::Cloud::Bigtable::RowFilter::InterleaveFilter]
490
507
  # `self` instance of interleave filter.
491
508
  #
492
509
  # @example Start to end range
510
+ # require "google/cloud/bigtable"
511
+ #
512
+ # bigtable = Google::Cloud::Bigtable.new
513
+ # table = bigtable.table("my-instance", "my-table")
493
514
  #
494
- # range = Google::Cloud::Bigtable::ValueRange.from("abc").to('xyz')
515
+ # range = table.new_value_range.from("value-001").to("value-005")
495
516
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.value_range(range)
496
517
  #
497
518
  # @example Start exlusive to infinite end range
519
+ # require "google/cloud/bigtable"
520
+ #
521
+ # bigtable = Google::Cloud::Bigtable.new
522
+ # table = bigtable.table("my-instance", "my-table")
498
523
  #
499
- # range = Google::Cloud::Bigtable::ValueRange.from("abc", inclusive: false)
524
+ # range = table.new_value_range.from("value-001", inclusive: false)
500
525
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.value_range(range)
501
526
  #
502
527
  def value_range range
503
- add(RowFilter.value_range(range))
528
+ add RowFilter.value_range(range)
504
529
  end
505
530
 
531
+ ##
506
532
  # Adds a column-range filter instance.
507
533
  #
508
534
  # Matches only cells from columns within the given range.
@@ -512,16 +538,18 @@ module Google
512
538
  # `self` instance of interleave filter.
513
539
  #
514
540
  # @example
541
+ # require "google/cloud/bigtable"
515
542
  #
516
- # range = Google::Cloud::Bigtable::ColumnRange.new(cf).from("field0").to('field5')
543
+ # range = Google::Cloud::Bigtable::ColumnRange.new("cf").from("field0").to("field5")
517
544
  #
518
545
  # filter = Google::Cloud::Bigtable::RowFilter.interleave.column_range(range)
519
546
  #
520
547
  def column_range range
521
- add(RowFilter.column_range(range))
548
+ add RowFilter.column_range(range)
522
549
  end
523
550
 
524
- # Gets the number of filters in chain filters.
551
+ ##
552
+ # Returns the number of filters in the interleave.
525
553
  #
526
554
  # @return [Integer]
527
555
  #
@@ -531,15 +559,16 @@ module Google
531
559
  # filter.length # 2
532
560
  #
533
561
  def length
534
- @grpc.filters.length
562
+ @filters.length
535
563
  end
536
564
 
537
- # Gets a list of filters.
565
+ ##
566
+ # Returns a frozen copy of the filters array.
538
567
  #
539
- # @return [Array<Google::Bigtable::V2::RowFilter>]
568
+ # @return [Array<SimpleFilter|ChainFilter|InterleaveFilter|ConditionFilter>]
540
569
  #
541
570
  def filters
542
- @grpc.filters
571
+ @filters.dup.freeze
543
572
  end
544
573
 
545
574
  # @private
@@ -549,7 +578,9 @@ module Google
549
578
  # @return [Google::Bigtable::V2::RowFilter]
550
579
  #
551
580
  def to_grpc
552
- Google::Bigtable::V2::RowFilter.new(interleave: @grpc)
581
+ Google::Bigtable::V2::RowFilter.new(
582
+ interleave: Google::Bigtable::V2::RowFilter::Interleave.new(filters: @filters.map(&:to_grpc))
583
+ )
553
584
  end
554
585
 
555
586
  private
@@ -560,7 +591,7 @@ module Google
560
591
  # @param filter [SimpleFilter, ChainFilter, InterleaveFilter, ConditionFilter]
561
592
  #
562
593
  def add filter
563
- @grpc.filters << filter.to_grpc
594
+ @filters << filter
564
595
  self
565
596
  end
566
597
  end
@@ -19,6 +19,7 @@ module Google
19
19
  module Cloud
20
20
  module Bigtable
21
21
  module RowFilter
22
+ ##
22
23
  #
23
24
  # # SimpleFilter
24
25
  #
@@ -30,6 +31,7 @@ module Google
30
31
  @grpc = Google::Bigtable::V2::RowFilter.new
31
32
  end
32
33
 
34
+ ##
33
35
  # Outputs all cells directly to the output of the read rather than to any parent filter.
34
36
  #
35
37
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
@@ -39,6 +41,7 @@ module Google
39
41
  self
40
42
  end
41
43
 
44
+ ##
42
45
  # Matches all cells, regardless of input. Functionally equivalent to
43
46
  # leaving `filter` unset, but included for completeness.
44
47
  #
@@ -49,6 +52,7 @@ module Google
49
52
  self
50
53
  end
51
54
 
55
+ ##
52
56
  # Does not match any cells, regardless of input. Useful for temporarily
53
57
  # disabling just part of a filter.
54
58
  #
@@ -59,6 +63,7 @@ module Google
59
63
  self
60
64
  end
61
65
 
66
+ ##
62
67
  # Replaces each cell's value with an empty string.
63
68
  #
64
69
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
@@ -68,6 +73,7 @@ module Google
68
73
  self
69
74
  end
70
75
 
76
+ ##
71
77
  # Matches only cells from rows whose keys satisfy the given RE2 regex. In
72
78
  # other words, passes through the entire row when the key matches, and
73
79
  # otherwise produces an empty row.
@@ -87,6 +93,7 @@ module Google
87
93
  self
88
94
  end
89
95
 
96
+ ##
90
97
  # Matches all cells from a row with probability p, and matches no cells
91
98
  # from the row with probability 1-p.
92
99
  #
@@ -95,15 +102,13 @@ module Google
95
102
  #
96
103
  def sample probability
97
104
  if probability >= 1 || probability <= 0
98
- raise(
99
- RowFilterError,
100
- "Probability must be greather then 0 and less then 1.0"
101
- )
105
+ raise RowFilterError, "Probability must be greather then 0 and less then 1.0"
102
106
  end
103
107
  @grpc.row_sample_filter = probability
104
108
  self
105
109
  end
106
110
 
111
+ ##
107
112
  # Matches only cells from columns whose families satisfy the given RE2
108
113
  # regex. For technical reasons, the regex must not contain the `:`
109
114
  # character, even if it is not being used as a literal.
@@ -119,6 +124,7 @@ module Google
119
124
  self
120
125
  end
121
126
 
127
+ ##
122
128
  # Matches only cells from columns whose qualifiers satisfy the given RE2
123
129
  # regex.
124
130
  # Note that, since column qualifiers can contain arbitrary bytes, the `\C`
@@ -134,6 +140,7 @@ module Google
134
140
  self
135
141
  end
136
142
 
143
+ ##
137
144
  # Matches only cells with values that satisfy the given regular expression.
138
145
  # Note that, since cell values can contain arbitrary bytes, the `\C` escape
139
146
  # sequence must be used if a true wildcard is desired. The `.` character
@@ -148,6 +155,7 @@ module Google
148
155
  self
149
156
  end
150
157
 
158
+ ##
151
159
  # Applies the given label to all cells in the output row. This allows
152
160
  # the client to determine which results were produced from which part of
153
161
  # the filter.
@@ -169,6 +177,7 @@ module Google
169
177
  self
170
178
  end
171
179
 
180
+ ##
172
181
  # Skips the first N cells of each row, matching all subsequent cells.
173
182
  # If duplicate cells are present, as is possible when using an interleave,
174
183
  # each copy of the cell is counted separately.
@@ -181,6 +190,7 @@ module Google
181
190
  self
182
191
  end
183
192
 
193
+ ##
184
194
  # Matches only the first N cells of each row.
185
195
  # If duplicate cells are present, as is possible when using an Interleave,
186
196
  # each copy of the cell is counted separately.
@@ -193,6 +203,7 @@ module Google
193
203
  self
194
204
  end
195
205
 
206
+ ##
196
207
  # Matches only the most recent N cells within each column. For example,
197
208
  # if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
198
209
  # skip all earlier cells in `foo:bar`, and then begin matching again in
@@ -208,6 +219,7 @@ module Google
208
219
  self
209
220
  end
210
221
 
222
+ ##
211
223
  # Creates a timestamp-range filter instance.
212
224
  #
213
225
  # Matches only cells with timestamps within the given range.
@@ -225,32 +237,35 @@ module Google
225
237
  self
226
238
  end
227
239
 
240
+ ##
228
241
  # Matches only cells with values that fall within the given range.
229
242
  #
230
243
  # See {Google::Cloud::Bigtable::ValueRange#from} and { Google::Cloud::Bigtable::ValueRange#to} for range
231
244
  # option inclusive/exclusive options
232
245
  #
233
246
  # * 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.
247
+ # * The value at which to end the range. If neither field is set, interpreted as an infinite string,
248
+ # exclusive.
235
249
  #
236
250
  # @param range [Google::Cloud::Bigtable::ValueRange]
237
251
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
238
252
  #
239
253
  def value_range range
240
- unless range.instance_of?(Google::Cloud::Bigtable::ValueRange)
254
+ unless range.instance_of? Google::Cloud::Bigtable::ValueRange
241
255
  raise RowFilterError, "Range type mustbe ValueRange"
242
256
  end
243
257
  @grpc.value_range_filter = range.to_grpc
244
258
  self
245
259
  end
246
260
 
261
+ ##
247
262
  # Matches only cells from columns within the given range.
248
263
  #
249
264
  # @param range [Google::Cloud::Bigtable::ColumnRange]
250
265
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
251
266
  #
252
267
  def column_range range
253
- unless range.instance_of?(Google::Cloud::Bigtable::ColumnRange)
268
+ unless range.instance_of? Google::Cloud::Bigtable::ColumnRange
254
269
  raise RowFilterError, "Range type mustbe ColumnRange"
255
270
  end
256
271
  @grpc.column_range_filter = range.to_grpc