google-cloud-bigtable 0.7.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +4 -26
- data/CHANGELOG.md +55 -0
- data/OVERVIEW.md +388 -19
- data/lib/google-cloud-bigtable.rb +0 -1
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +1 -1
- data/lib/google/bigtable/v2/bigtable_pb.rb +3 -0
- data/lib/google/bigtable/v2/bigtable_services_pb.rb +1 -1
- data/lib/google/cloud/bigtable/admin.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/credentials.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_instance_admin.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_table_admin.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/instance.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/table.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/iam_policy.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/options.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/policy.rb +7 -6
- data/lib/google/cloud/bigtable/admin/v2/doc/google/longrunning/operations.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/any.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/duration.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/empty.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/field_mask.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/timestamp.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/rpc/status.rb +7 -55
- data/lib/google/cloud/bigtable/admin/v2/doc/google/type/expr.rb +1 -1
- data/lib/google/cloud/bigtable/app_profile.rb +13 -13
- data/lib/google/cloud/bigtable/app_profile/list.rb +7 -7
- data/lib/google/cloud/bigtable/chunk_processor.rb +1 -1
- data/lib/google/cloud/bigtable/cluster.rb +7 -7
- data/lib/google/cloud/bigtable/cluster/list.rb +2 -2
- data/lib/google/cloud/bigtable/column_family.rb +3 -9
- data/lib/google/cloud/bigtable/column_family_map.rb +8 -8
- data/lib/google/cloud/bigtable/column_range.rb +6 -6
- data/lib/google/cloud/bigtable/gc_rule.rb +8 -8
- data/lib/google/cloud/bigtable/instance.rb +78 -71
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +8 -6
- data/lib/google/cloud/bigtable/instance/job.rb +2 -2
- data/lib/google/cloud/bigtable/instance/list.rb +4 -4
- data/lib/google/cloud/bigtable/longrunning_job.rb +1 -1
- data/lib/google/cloud/bigtable/mutation_entry.rb +17 -16
- data/lib/google/cloud/bigtable/mutation_operations.rb +13 -49
- data/lib/google/cloud/bigtable/policy.rb +1 -1
- data/lib/google/cloud/bigtable/project.rb +28 -59
- data/lib/google/cloud/bigtable/read_modify_write_rule.rb +6 -6
- data/lib/google/cloud/bigtable/read_operations.rb +15 -19
- data/lib/google/cloud/bigtable/routing_policy.rb +3 -2
- data/lib/google/cloud/bigtable/row.rb +14 -14
- data/lib/google/cloud/bigtable/row_filter.rb +31 -15
- data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +49 -26
- data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +4 -1
- data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +44 -24
- data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +3 -3
- data/lib/google/cloud/bigtable/rows_mutator.rb +1 -5
- data/lib/google/cloud/bigtable/rows_reader.rb +5 -4
- data/lib/google/cloud/bigtable/sample_row_key.rb +1 -1
- data/lib/google/cloud/bigtable/service.rb +94 -14
- data/lib/google/cloud/bigtable/table.rb +130 -27
- data/lib/google/cloud/bigtable/table/cluster_state.rb +10 -5
- data/lib/google/cloud/bigtable/table/list.rb +2 -2
- data/lib/google/cloud/bigtable/v2.rb +2 -2
- data/lib/google/cloud/bigtable/v2/bigtable_client.rb +13 -13
- data/lib/google/cloud/bigtable/v2/credentials.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/bigtable.rb +17 -14
- data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/data.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/protobuf/any.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/protobuf/wrappers.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/rpc/status.rb +7 -55
- data/lib/google/cloud/bigtable/value_range.rb +14 -13
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +42 -2
|
@@ -36,7 +36,7 @@ module Google
|
|
|
36
36
|
#
|
|
37
37
|
class ReadModifyWriteRule
|
|
38
38
|
# @private
|
|
39
|
-
#
|
|
39
|
+
# Creates an instance of ReadModifyWriteRule
|
|
40
40
|
#
|
|
41
41
|
# @param family [String]
|
|
42
42
|
# The name of the family to which the read/modify/write should be applied.
|
|
@@ -50,7 +50,7 @@ module Google
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
##
|
|
53
|
-
#
|
|
53
|
+
# Creates an instance of an append-value rule.
|
|
54
54
|
#
|
|
55
55
|
# @param family [String]
|
|
56
56
|
# The name of the family to which the read/modify/write should be applied.
|
|
@@ -73,7 +73,7 @@ module Google
|
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
##
|
|
76
|
-
#
|
|
76
|
+
# Creates an instance of an increment-amount rule.
|
|
77
77
|
#
|
|
78
78
|
# @param family [String]
|
|
79
79
|
# The name of the family to which the read/modify/write should be applied.
|
|
@@ -86,7 +86,7 @@ module Google
|
|
|
86
86
|
# as a 64-bit big-endian signed integer), or the entire request will fail.
|
|
87
87
|
# @return [Google::Cloud::Bigtable::ReadModifyWriteRule]
|
|
88
88
|
#
|
|
89
|
-
# @example
|
|
89
|
+
# @example
|
|
90
90
|
# rule = Google::Cloud::Bigtable::ReadModifyWriteRule.increment(
|
|
91
91
|
# "cf", "field01", 1
|
|
92
92
|
# )
|
|
@@ -98,7 +98,7 @@ module Google
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
##
|
|
101
|
-
#
|
|
101
|
+
# Sets the append value.
|
|
102
102
|
#
|
|
103
103
|
# @param value [String]
|
|
104
104
|
# @return [Google::Cloud::Bigtable::ReadModifyWriteRule]
|
|
@@ -109,7 +109,7 @@ module Google
|
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
##
|
|
112
|
-
#
|
|
112
|
+
# Sets the increment amount.
|
|
113
113
|
#
|
|
114
114
|
# @param amount [Integer]
|
|
115
115
|
# @return [Google::Cloud::Bigtable::ReadModifyWriteRule]
|
|
@@ -60,7 +60,7 @@ module Google
|
|
|
60
60
|
def sample_row_keys
|
|
61
61
|
return enum_for :sample_row_keys unless block_given?
|
|
62
62
|
|
|
63
|
-
response =
|
|
63
|
+
response = service.sample_row_keys path, app_profile_id: @app_profile_id
|
|
64
64
|
response.each do |grpc|
|
|
65
65
|
yield SampleRowKey.from_grpc grpc
|
|
66
66
|
end
|
|
@@ -86,7 +86,7 @@ module Google
|
|
|
86
86
|
# The default (zero) is to return all results.
|
|
87
87
|
# @return [Array<Google::Cloud::Bigtable::Row> | :yields: row]
|
|
88
88
|
# Array of row or yield block for each processed row.
|
|
89
|
-
# @example Read with limit
|
|
89
|
+
# @example Read with limit.
|
|
90
90
|
# require "google/cloud/bigtable"
|
|
91
91
|
#
|
|
92
92
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -96,7 +96,7 @@ module Google
|
|
|
96
96
|
# puts row
|
|
97
97
|
# end
|
|
98
98
|
#
|
|
99
|
-
# @example Read using row keys
|
|
99
|
+
# @example Read using row keys.
|
|
100
100
|
# require "google/cloud/bigtable"
|
|
101
101
|
#
|
|
102
102
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -106,7 +106,7 @@ module Google
|
|
|
106
106
|
# puts row
|
|
107
107
|
# end
|
|
108
108
|
#
|
|
109
|
-
# @example Read using row ranges
|
|
109
|
+
# @example Read using row ranges.
|
|
110
110
|
# require "google/cloud/bigtable"
|
|
111
111
|
#
|
|
112
112
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -118,8 +118,7 @@ module Google
|
|
|
118
118
|
# puts row
|
|
119
119
|
# end
|
|
120
120
|
#
|
|
121
|
-
# @example Read using filter
|
|
122
|
-
#
|
|
121
|
+
# @example Read using filter.
|
|
123
122
|
# require "google/cloud/bigtable"
|
|
124
123
|
#
|
|
125
124
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -133,8 +132,7 @@ module Google
|
|
|
133
132
|
# puts row
|
|
134
133
|
# end
|
|
135
134
|
#
|
|
136
|
-
# @example Read using filter with limit
|
|
137
|
-
#
|
|
135
|
+
# @example Read using filter with limit.
|
|
138
136
|
# require "google/cloud/bigtable"
|
|
139
137
|
#
|
|
140
138
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -169,13 +167,12 @@ module Google
|
|
|
169
167
|
##
|
|
170
168
|
# Reads a single row by row key.
|
|
171
169
|
#
|
|
172
|
-
# @param key [String] Row key. Required
|
|
170
|
+
# @param key [String] Row key. Required.
|
|
173
171
|
# @param filter [Google::Cloud::Bigtable::RowFilter]
|
|
174
172
|
# The filter to apply to the contents of the specified row. Optional.
|
|
175
173
|
# @return [Google::Cloud::Bigtable::Row]
|
|
176
174
|
#
|
|
177
|
-
# @example
|
|
178
|
-
#
|
|
175
|
+
# @example
|
|
179
176
|
# require "google/cloud/bigtable"
|
|
180
177
|
#
|
|
181
178
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -183,8 +180,7 @@ module Google
|
|
|
183
180
|
#
|
|
184
181
|
# row = table.read_row("user-1")
|
|
185
182
|
#
|
|
186
|
-
# @example Read row
|
|
187
|
-
#
|
|
183
|
+
# @example Read row with filter.
|
|
188
184
|
# require "google/cloud/bigtable"
|
|
189
185
|
#
|
|
190
186
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -216,7 +212,7 @@ module Google
|
|
|
216
212
|
# # OR
|
|
217
213
|
# range = table.new_value_range.from("abc").to("xyz")
|
|
218
214
|
#
|
|
219
|
-
# @example With exclusive from range
|
|
215
|
+
# @example With exclusive from range.
|
|
220
216
|
# require "google/cloud/bigtable"
|
|
221
217
|
#
|
|
222
218
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -229,9 +225,9 @@ module Google
|
|
|
229
225
|
end
|
|
230
226
|
|
|
231
227
|
##
|
|
232
|
-
#
|
|
228
|
+
# Gets a new instance of ColumnRange.
|
|
233
229
|
#
|
|
234
|
-
# @param family [String] Column family name
|
|
230
|
+
# @param family [String] Column family name.
|
|
235
231
|
# @return [Google::Cloud::Bigtable::ColumnRange]
|
|
236
232
|
#
|
|
237
233
|
# @example
|
|
@@ -247,7 +243,7 @@ module Google
|
|
|
247
243
|
# # OR
|
|
248
244
|
# range = table.new_column_range("test-family").from("key-1").to("key-5")
|
|
249
245
|
#
|
|
250
|
-
# @example With exclusive from range
|
|
246
|
+
# @example With exclusive from range.
|
|
251
247
|
# require "google/cloud/bigtable"
|
|
252
248
|
#
|
|
253
249
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -260,7 +256,7 @@ module Google
|
|
|
260
256
|
end
|
|
261
257
|
|
|
262
258
|
##
|
|
263
|
-
#
|
|
259
|
+
# Gets a new instance of RowRange.
|
|
264
260
|
#
|
|
265
261
|
# @return [Google::Cloud::Bigtable::RowRange]
|
|
266
262
|
#
|
|
@@ -277,7 +273,7 @@ module Google
|
|
|
277
273
|
# # OR
|
|
278
274
|
# range = table.new_row_range.from("key-1").to("key-5")
|
|
279
275
|
#
|
|
280
|
-
# @example With exclusive from range
|
|
276
|
+
# @example With exclusive from range.
|
|
281
277
|
# require "google/cloud/bigtable"
|
|
282
278
|
#
|
|
283
279
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -33,7 +33,7 @@ module Google
|
|
|
33
33
|
# availability. Value contains `cluster_id` and optional field
|
|
34
34
|
# `allow_transactional_writes`.
|
|
35
35
|
#
|
|
36
|
-
# @example Create an app profile with a single cluster routing policy
|
|
36
|
+
# @example Create an app profile with a single cluster routing policy.
|
|
37
37
|
# require "google/cloud/bigtable"
|
|
38
38
|
#
|
|
39
39
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -52,7 +52,7 @@ module Google
|
|
|
52
52
|
# )
|
|
53
53
|
# puts app_profile.routing_policy
|
|
54
54
|
#
|
|
55
|
-
# @example Create an app profile with multi-cluster routing policy
|
|
55
|
+
# @example Create an app profile with multi-cluster routing policy.
|
|
56
56
|
# require "google/cloud/bigtable"
|
|
57
57
|
#
|
|
58
58
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -139,6 +139,7 @@ module Google
|
|
|
139
139
|
# allowed by this app profile. It is unsafe to send these requests to
|
|
140
140
|
# the same table/row/column in multiple clusters.
|
|
141
141
|
# Default value is false.
|
|
142
|
+
#
|
|
142
143
|
class SingleClusterRouting < RoutingPolicy
|
|
143
144
|
attr_reader :cluster_id, :allow_transactional_writes
|
|
144
145
|
|
|
@@ -35,11 +35,11 @@ module Google
|
|
|
35
35
|
##
|
|
36
36
|
# Creates a row cell instance.
|
|
37
37
|
#
|
|
38
|
-
# @param family [String] Column family name
|
|
39
|
-
# @param qualifier [String] Column cell qualifier name
|
|
40
|
-
# @param timestamp [Integer] Timestamp in microseconds
|
|
41
|
-
# @param value [String] Cell value
|
|
42
|
-
# @param labels [Array<String>] List of label array
|
|
38
|
+
# @param family [String] Column family name.
|
|
39
|
+
# @param qualifier [String] Column cell qualifier name.
|
|
40
|
+
# @param timestamp [Integer] Timestamp in microseconds.
|
|
41
|
+
# @param value [String] Cell value.
|
|
42
|
+
# @param labels [Array<String>] List of label array.
|
|
43
43
|
#
|
|
44
44
|
def initialize family, qualifier, timestamp, value, labels = []
|
|
45
45
|
@family = family
|
|
@@ -52,9 +52,9 @@ module Google
|
|
|
52
52
|
##
|
|
53
53
|
# Converts timestamp to Time instance.
|
|
54
54
|
#
|
|
55
|
-
# @param granularity [Symbol] Optional
|
|
56
|
-
# Valid granularity types are `:micros`,
|
|
57
|
-
# Default
|
|
55
|
+
# @param granularity [Symbol] Optional.
|
|
56
|
+
# Valid granularity types are `:micros`, `:millis`.
|
|
57
|
+
# Default is `:millis`.
|
|
58
58
|
# @return [Time | nil]
|
|
59
59
|
#
|
|
60
60
|
def to_time granularity = nil
|
|
@@ -74,7 +74,7 @@ module Google
|
|
|
74
74
|
|
|
75
75
|
# @private
|
|
76
76
|
#
|
|
77
|
-
# Cell object comparator
|
|
77
|
+
# Cell object comparator.
|
|
78
78
|
#
|
|
79
79
|
# @return [Boolean]
|
|
80
80
|
#
|
|
@@ -88,19 +88,19 @@ module Google
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
##
|
|
91
|
-
# @return [String] Row key
|
|
91
|
+
# @return [String] Row key.
|
|
92
92
|
#
|
|
93
93
|
attr_accessor :key
|
|
94
94
|
|
|
95
95
|
##
|
|
96
|
-
# @return [Hash{String => Array<Google::Cloud::Bigtable::Row::Cell>}] Row cells
|
|
96
|
+
# @return [Hash{String => Array<Google::Cloud::Bigtable::Row::Cell>}] Row cells.
|
|
97
97
|
#
|
|
98
98
|
attr_accessor :cells
|
|
99
99
|
|
|
100
100
|
##
|
|
101
101
|
# Creates a flat row object.
|
|
102
102
|
#
|
|
103
|
-
# @param key [String] Row key name
|
|
103
|
+
# @param key [String] Row key name.
|
|
104
104
|
#
|
|
105
105
|
def initialize key = nil
|
|
106
106
|
@key = key
|
|
@@ -108,7 +108,7 @@ module Google
|
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
##
|
|
111
|
-
# List of column families names
|
|
111
|
+
# List of column families names.
|
|
112
112
|
#
|
|
113
113
|
# @return [Array<String>]
|
|
114
114
|
#
|
|
@@ -118,7 +118,7 @@ module Google
|
|
|
118
118
|
|
|
119
119
|
# @private
|
|
120
120
|
#
|
|
121
|
-
# FlatRow object comparator
|
|
121
|
+
# FlatRow object comparator.
|
|
122
122
|
#
|
|
123
123
|
# @return [Boolean]
|
|
124
124
|
#
|
|
@@ -121,6 +121,7 @@ module Google
|
|
|
121
121
|
# while the other does not.
|
|
122
122
|
#
|
|
123
123
|
# @example
|
|
124
|
+
# require "google/cloud/bigtable"
|
|
124
125
|
#
|
|
125
126
|
# # Pass filter
|
|
126
127
|
# Google::Cloud::Bigtable::RowFilter.pass
|
|
@@ -151,7 +152,7 @@ module Google
|
|
|
151
152
|
#
|
|
152
153
|
# A chain RowFilter that sends rows through several RowFilters in sequence.
|
|
153
154
|
#
|
|
154
|
-
# See {Google::Cloud::Bigtable::RowFilter::ChainFilter}
|
|
155
|
+
# See {Google::Cloud::Bigtable::RowFilter::ChainFilter}.
|
|
155
156
|
#
|
|
156
157
|
# The elements of "filters" are chained together to process the input row:
|
|
157
158
|
# in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
|
|
@@ -160,6 +161,7 @@ module Google
|
|
|
160
161
|
# @return [Google::Cloud::Bigtable::RowFilter::ChainFilter]
|
|
161
162
|
#
|
|
162
163
|
# @example Create chain filter with simple filter.
|
|
164
|
+
# require "google/cloud/bigtable"
|
|
163
165
|
#
|
|
164
166
|
# chain = Google::Cloud::Bigtable::RowFilter.chain
|
|
165
167
|
#
|
|
@@ -171,6 +173,7 @@ module Google
|
|
|
171
173
|
# chain.key("user-*").strip_value
|
|
172
174
|
#
|
|
173
175
|
# @example Create complex chain filter.
|
|
176
|
+
# require "google/cloud/bigtable"
|
|
174
177
|
#
|
|
175
178
|
# chain = Google::Cloud::Bigtable::RowFilter.chain
|
|
176
179
|
#
|
|
@@ -219,6 +222,7 @@ module Google
|
|
|
219
222
|
# @return [Google::Cloud::Bigtable::RowFilter::InterleaveFilter]
|
|
220
223
|
#
|
|
221
224
|
# @example Create an interleave filter with simple filter.
|
|
225
|
+
# require "google/cloud/bigtable"
|
|
222
226
|
#
|
|
223
227
|
# interleave = Google::Cloud::Bigtable::RowFilter.interleave
|
|
224
228
|
#
|
|
@@ -230,6 +234,7 @@ module Google
|
|
|
230
234
|
# interleave.key("user-*").sink
|
|
231
235
|
#
|
|
232
236
|
# @example Create complex interleave filter.
|
|
237
|
+
# require "google/cloud/bigtable"
|
|
233
238
|
#
|
|
234
239
|
# interleave = Google::Cloud::Bigtable::RowFilter.interleave
|
|
235
240
|
#
|
|
@@ -254,12 +259,13 @@ module Google
|
|
|
254
259
|
# results. Additionally, condition filters have poor performance, especially
|
|
255
260
|
# when filters are set for the false condition.
|
|
256
261
|
#
|
|
257
|
-
# Cannot be used within the `predicate_filter`, `true_filter`, or `false_filter
|
|
262
|
+
# Cannot be used within the `predicate_filter`, `true_filter`, or `false_filter`.
|
|
258
263
|
#
|
|
259
264
|
# @param predicate [SimpleFilter, ChainFilter, InterleaveFilter, ConditionFilter]
|
|
260
265
|
# @return [Google::Cloud::Bigtable::RowFilter::ConditionFilter]
|
|
261
266
|
#
|
|
262
267
|
# @example
|
|
268
|
+
# require "google/cloud/bigtable"
|
|
263
269
|
#
|
|
264
270
|
# predicate = Google::Cloud::Bigtable::RowFilter.key("user-*")
|
|
265
271
|
# condition = Google::Cloud::Bigtable::RowFilter.condition(predicate)
|
|
@@ -283,6 +289,7 @@ module Google
|
|
|
283
289
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
284
290
|
#
|
|
285
291
|
# @example
|
|
292
|
+
# require "google/cloud/bigtable"
|
|
286
293
|
#
|
|
287
294
|
# filter = Google::Cloud::Bigtable::RowFilter.pass
|
|
288
295
|
#
|
|
@@ -299,6 +306,7 @@ module Google
|
|
|
299
306
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
300
307
|
#
|
|
301
308
|
# @example
|
|
309
|
+
# require "google/cloud/bigtable"
|
|
302
310
|
#
|
|
303
311
|
# filter = Google::Cloud::Bigtable::RowFilter.block
|
|
304
312
|
#
|
|
@@ -310,11 +318,12 @@ module Google
|
|
|
310
318
|
# Creates a sink filter instance.
|
|
311
319
|
#
|
|
312
320
|
# Outputs all cells directly to the output of the read rather than to any
|
|
313
|
-
# parent filter
|
|
321
|
+
# parent filter.
|
|
314
322
|
#
|
|
315
323
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
316
324
|
#
|
|
317
325
|
# @example
|
|
326
|
+
# require "google/cloud/bigtable"
|
|
318
327
|
#
|
|
319
328
|
# filter = Google::Cloud::Bigtable::RowFilter.sink
|
|
320
329
|
#
|
|
@@ -330,6 +339,7 @@ module Google
|
|
|
330
339
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
331
340
|
#
|
|
332
341
|
# @example
|
|
342
|
+
# require "google/cloud/bigtable"
|
|
333
343
|
#
|
|
334
344
|
# filter = Google::Cloud::Bigtable::RowFilter.strip_value
|
|
335
345
|
#
|
|
@@ -348,13 +358,13 @@ module Google
|
|
|
348
358
|
# will not match the new line character `\n`, which may be present in a
|
|
349
359
|
# binary key.
|
|
350
360
|
#
|
|
351
|
-
#
|
|
352
|
-
# @see https://github.com/google/re2/wiki/Syntax
|
|
361
|
+
# @see https://github.com/google/re2/wiki/Syntax Regex syntax
|
|
353
362
|
#
|
|
354
363
|
# @param regex [String] Regex to match row keys.
|
|
355
364
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
356
365
|
#
|
|
357
366
|
# @example
|
|
367
|
+
# require "google/cloud/bigtable"
|
|
358
368
|
#
|
|
359
369
|
# filter = Google::Cloud::Bigtable::RowFilter.key("user-.*")
|
|
360
370
|
#
|
|
@@ -368,11 +378,12 @@ module Google
|
|
|
368
378
|
# Matches all cells from a row with probability p, and matches no cells
|
|
369
379
|
# from the row with probability 1-p.
|
|
370
380
|
#
|
|
371
|
-
# @param probability [Float] Probability value
|
|
372
|
-
# Probability must be
|
|
381
|
+
# @param probability [Float] Probability value.
|
|
382
|
+
# Probability must be greater than 0 and less than 1.0.
|
|
373
383
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
374
384
|
#
|
|
375
385
|
# @example
|
|
386
|
+
# require "google/cloud/bigtable"
|
|
376
387
|
#
|
|
377
388
|
# filter = Google::Cloud::Bigtable::RowFilter.sample(0.5)
|
|
378
389
|
#
|
|
@@ -390,13 +401,13 @@ module Google
|
|
|
390
401
|
# `\n`, it is sufficient to use `.` as a full wildcard when matching
|
|
391
402
|
# column family names.
|
|
392
403
|
#
|
|
393
|
-
#
|
|
394
|
-
# @see https://github.com/google/re2/wiki/Syntax
|
|
404
|
+
# @see https://github.com/google/re2/wiki/Syntax Regex syntax
|
|
395
405
|
#
|
|
396
406
|
# @param regex [String] Regex to match family name.
|
|
397
407
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
398
408
|
#
|
|
399
409
|
# @example
|
|
410
|
+
# require "google/cloud/bigtable"
|
|
400
411
|
#
|
|
401
412
|
# filter = Google::Cloud::Bigtable::RowFilter.family("cf-.*")
|
|
402
413
|
#
|
|
@@ -414,13 +425,13 @@ module Google
|
|
|
414
425
|
# character will not match the new line character `\n`, which may be
|
|
415
426
|
# present in a binary qualifier.
|
|
416
427
|
#
|
|
417
|
-
#
|
|
418
|
-
# @see https://github.com/google/re2/wiki/Syntax
|
|
428
|
+
# @see https://github.com/google/re2/wiki/Syntax Regex syntax
|
|
419
429
|
#
|
|
420
430
|
# @param regex [String] Regex to match column qualifier name.
|
|
421
431
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
422
432
|
#
|
|
423
433
|
# @example
|
|
434
|
+
# require "google/cloud/bigtable"
|
|
424
435
|
#
|
|
425
436
|
# filter = Google::Cloud::Bigtable::RowFilter.qualifier("user-name.*")
|
|
426
437
|
#
|
|
@@ -437,13 +448,13 @@ module Google
|
|
|
437
448
|
# will not match the new line character `\n`, which may be present in a
|
|
438
449
|
# binary value.
|
|
439
450
|
#
|
|
440
|
-
#
|
|
441
|
-
# @see https://github.com/google/re2/wiki/Syntax
|
|
451
|
+
# @see https://github.com/google/re2/wiki/Syntax Regex syntax
|
|
442
452
|
#
|
|
443
453
|
# @param regex [String] Regex to match cell value.
|
|
444
454
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
445
455
|
#
|
|
446
456
|
# @example
|
|
457
|
+
# require "google/cloud/bigtable"
|
|
447
458
|
#
|
|
448
459
|
# filter = Google::Cloud::Bigtable::RowFilter.value("abc.*")
|
|
449
460
|
#
|
|
@@ -472,6 +483,7 @@ module Google
|
|
|
472
483
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
473
484
|
#
|
|
474
485
|
# @example
|
|
486
|
+
# require "google/cloud/bigtable"
|
|
475
487
|
#
|
|
476
488
|
# filter = Google::Cloud::Bigtable::RowFilter.label("user-detail")
|
|
477
489
|
#
|
|
@@ -490,6 +502,7 @@ module Google
|
|
|
490
502
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
491
503
|
#
|
|
492
504
|
# @example
|
|
505
|
+
# require "google/cloud/bigtable"
|
|
493
506
|
#
|
|
494
507
|
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row_offset(3)
|
|
495
508
|
#
|
|
@@ -508,6 +521,7 @@ module Google
|
|
|
508
521
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
509
522
|
#
|
|
510
523
|
# @example
|
|
524
|
+
# require "google/cloud/bigtable"
|
|
511
525
|
#
|
|
512
526
|
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_row(5)
|
|
513
527
|
#
|
|
@@ -526,6 +540,7 @@ module Google
|
|
|
526
540
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
527
541
|
#
|
|
528
542
|
# @example
|
|
543
|
+
# require "google/cloud/bigtable"
|
|
529
544
|
#
|
|
530
545
|
# filter = Google::Cloud::Bigtable::RowFilter.cells_per_column(5)
|
|
531
546
|
#
|
|
@@ -544,6 +559,7 @@ module Google
|
|
|
544
559
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
545
560
|
#
|
|
546
561
|
# @example
|
|
562
|
+
# require "google/cloud/bigtable"
|
|
547
563
|
#
|
|
548
564
|
# timestamp_micros = (Time.now.to_f * 1000000).round(-3)
|
|
549
565
|
# from = timestamp_micros - 300000000
|
|
@@ -577,7 +593,7 @@ module Google
|
|
|
577
593
|
# @param range [Google::Cloud::Bigtable::ValueRange]
|
|
578
594
|
# @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
|
|
579
595
|
#
|
|
580
|
-
# @example Start to end range
|
|
596
|
+
# @example Start to end range.
|
|
581
597
|
# require "google/cloud/bigtable"
|
|
582
598
|
#
|
|
583
599
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -586,7 +602,7 @@ module Google
|
|
|
586
602
|
# range = table.new_value_range.from("value-001", inclusive: false)
|
|
587
603
|
# filter = Google::Cloud::Bigtable::RowFilter.value_range(range)
|
|
588
604
|
#
|
|
589
|
-
# @example Start
|
|
605
|
+
# @example Start exclusive to infinite end range.
|
|
590
606
|
# require "google/cloud/bigtable"
|
|
591
607
|
#
|
|
592
608
|
# bigtable = Google::Cloud::Bigtable.new
|