google-cloud-bigtable 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c055b86b9d279e27fdb78ec71ddb8babd48661349c0404db696496c84fb3d8e1
4
- data.tar.gz: 4c3557a421b16d56680b9c9a39f1d5073a6886efe5198262df0ca02494a000be
3
+ metadata.gz: ceb71908240117b3c3e98f009a6be24f4ae9ca510523414b91720aab576f925a
4
+ data.tar.gz: 15c5a7c7617184eac62271c0ba4b2de71b4f9d643c25751dcef0de98dde7d67c
5
5
  SHA512:
6
- metadata.gz: da4f265ebb057cc6e291104edf56cfdf121efc9a75def53dbc9831aba3708049eb68a53c378c147c9f49277afa8cf46822ce01c4e11aa8fcefd907522408862c
7
- data.tar.gz: 79be648c3e85fe49e9a285fcdec140e16e015e510b8d5327a802c0e1d36b825d4c4ab2cb52f63c9d5e8b96ef3177c0f91648ea56e5aac5c045ffba90e0a1c101
6
+ metadata.gz: 00155edefe171f720de9af636a6a8be2844f889c1750af57a851de83c567e6fc746ce1dbf2f05515d73f0424acade2566874d096f867af1b8c1f5b99e132e81c
7
+ data.tar.gz: e8a2f9731e9d43897c213ace6810f3a4dcc86a9f5d71eefcf802143c34ca6a151b23e2649081779932c03244e4f3c1ca182f214f122e82b76cbc3a0404d3e54f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Release History
2
2
 
3
+ ### 2.3.0 / 2021-02-04
4
+
5
+ #### Features
6
+
7
+ * Add integer support to RowFilter#value and ValueRange
8
+ * Encode Integer arguments as 64-bit signed big-endian integer data
9
+
3
10
  ### 2.2.1 / 2021-01-13
4
11
 
5
12
  #### Documentation
@@ -77,6 +77,18 @@ module Google
77
77
 
78
78
  Google::Protobuf::Timestamp.new seconds: time.to_i, nanos: time.nsec
79
79
  end
80
+
81
+ ##
82
+ # Converts an Integer to 64-bit signed big-endian integer data.
83
+ # Returns a string argument unchanged.
84
+ #
85
+ # @param value [String, Integer]
86
+ # @return [String]
87
+ #
88
+ def integer_to_signed_be_64 value
89
+ return [value].pack "q>" if value.is_a? Integer
90
+ value
91
+ end
80
92
  end
81
93
  end
82
94
  end
@@ -15,6 +15,8 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
+ require "google/cloud/bigtable/convert"
19
+
18
20
  module Google
19
21
  module Cloud
20
22
  module Bigtable
@@ -84,8 +86,9 @@ module Google
84
86
  # @param qualifier [String] Column qualifier name.
85
87
  # The qualifier of the column into which new data should be written.
86
88
  # Can be any byte string, including an empty string.
87
- # @param value [String, Integer] Cell value data.
88
- # The value to be written into the specified cell.
89
+ # @param value [String, Integer] Cell value data. The value to be written
90
+ # into the specified cell. If the argument is an Integer, it will be
91
+ # encoded as a 64-bit signed big-endian integer.
89
92
  # @param timestamp [Integer] Timestamp value in microseconds.
90
93
  # The timestamp of the cell into which new data should be written.
91
94
  # Use -1 for current Bigtable server time.
@@ -112,7 +115,7 @@ module Google
112
115
  #
113
116
  def set_cell family, qualifier, value, timestamp: nil
114
117
  # If value is integer, covert it to a 64-bit signed big-endian integer.
115
- value = [value].pack "q>" if value.is_a? Integer
118
+ value = Convert.integer_to_signed_be_64 value
116
119
  options = {
117
120
  family_name: family,
118
121
  column_qualifier: qualifier,
@@ -15,6 +15,8 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
+ require "google/cloud/bigtable/convert"
19
+
18
20
  module Google
19
21
  module Cloud
20
22
  module Bigtable
@@ -147,10 +149,13 @@ module Google
147
149
  # will not match the new line character `\n`, which may be present in a
148
150
  # binary value.
149
151
  #
150
- # @param regex [String] Regex to match cell value.
152
+ # @param regex [String, Integer] Regex to match cell value, or an Integer
153
+ # value to be encoded as a 64-bit signed big-endian integer.
151
154
  # @return [Google::Cloud::Bigtable::RowFilter::SimpleFilter]
152
155
  #
153
156
  def value regex
157
+ # If regex is integer, covert it to a 64-bit signed big-endian integer.
158
+ regex = Convert.integer_to_signed_be_64 regex
154
159
  @grpc.value_regex_filter = regex
155
160
  self
156
161
  end
@@ -15,6 +15,8 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
+ require "google/cloud/bigtable/convert"
19
+
18
20
  module Google
19
21
  module Cloud
20
22
  module Bigtable
@@ -65,7 +67,9 @@ module Google
65
67
  ##
66
68
  # Sets the row range with the lower bound.
67
69
  #
68
- # @param value [String] The value. Required.
70
+ # @param value [String, Integer] The value. Required. If the argument
71
+ # is an Integer, it will be encoded as a 64-bit signed big-endian
72
+ # integer.
69
73
  # @param inclusive [Boolean] Whether the value is an inclusive or
70
74
  # exclusive lower bound. Default is `true`, an inclusive lower bound.
71
75
  # @return [Google::Cloud::Bigtable::ValueRange]
@@ -87,6 +91,8 @@ module Google
87
91
  # range = table.new_value_range.from("value-001", inclusive: false)
88
92
  #
89
93
  def from value, inclusive: true
94
+ # If value is integer, covert it to a 64-bit signed big-endian integer.
95
+ value = Convert.integer_to_signed_be_64 value
90
96
  if inclusive
91
97
  @grpc.start_value_closed = value
92
98
  else
@@ -98,7 +104,9 @@ module Google
98
104
  ##
99
105
  # Sets the value range with upper bound.
100
106
  #
101
- # @param value [String] value. Required
107
+ # @param value [String, Integer] value. Required. If the argument
108
+ # is an Integer, it will be encoded as a 64-bit signed big-endian
109
+ # integer.
102
110
  # @param inclusive [Boolean] Whether the value is an inclusive or
103
111
  # exclusive lower bound. Default is `false`, an exclusive lower bound.
104
112
  # @return [Google::Cloud::Bigtable::ValueRange]
@@ -120,6 +128,8 @@ module Google
120
128
  # range = table.new_value_range.to("value-010")
121
129
  #
122
130
  def to value, inclusive: false
131
+ # If value is integer, covert it to a 64-bit signed big-endian integer.
132
+ value = Convert.integer_to_signed_be_64 value
123
133
  if inclusive
124
134
  @grpc.end_value_closed = value
125
135
  else
@@ -131,8 +141,12 @@ module Google
131
141
  ##
132
142
  # Sets the value range with inclusive lower and upper bounds.
133
143
  #
134
- # @param from_value [String] Inclusive from value. Required
135
- # @param to_value [String] Inclusive to value. Required
144
+ # @param from_value [String, Integer] Inclusive from value. Required.
145
+ # If the argument is an Integer, it will be encoded as a 64-bit
146
+ # signed big-endian integer.
147
+ # @param to_value [String, Integer] Inclusive to value. Required.
148
+ # If the argument is an Integer, it will be encoded as a 64-bit
149
+ # signed big-endian integer.
136
150
  # @return [Google::Cloud::Bigtable::ValueRange]
137
151
  # Range with inclusive from and to values.
138
152
  #
@@ -151,8 +165,12 @@ module Google
151
165
  ##
152
166
  # Set value range with an inclusive lower bound and an exclusive upper bound.
153
167
  #
154
- # @param from_value [String] Inclusive from value
155
- # @param to_value [String] Exclusive to value
168
+ # @param from_value [String, Integer] Inclusive from value. Required.
169
+ # If the argument is an Integer, it will be encoded as a 64-bit
170
+ # signed big-endian integer.
171
+ # @param to_value [String, Integer] Exclusive to value. Required.
172
+ # If the argument is an Integer, it will be encoded as a 64-bit
173
+ # signed big-endian integer.
156
174
  # @return [Google::Cloud::Bigtable::ValueRange]
157
175
  # Range with an inclusive from value and an exclusive to value.
158
176
  #
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigtable
19
- VERSION = "2.2.1".freeze
19
+ VERSION = "2.3.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-bigtable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-13 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-bigtable-admin-v2
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  - !ruby/object:Gem::Version
249
249
  version: '0'
250
250
  requirements: []
251
- rubygems_version: 3.1.4
251
+ rubygems_version: 3.2.6
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: API Client library for Cloud Bigtable API