aerospike 2.5.0 → 2.5.1

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
- SHA1:
3
- metadata.gz: d49c7d62bc7171c98eac791bf1ff48bc19eed19e
4
- data.tar.gz: 10b103d7857eff070e3a4dbf23d03df2a4f73009
2
+ SHA256:
3
+ metadata.gz: ccefb4dd82c2d6d15f9f0eac08d32acceacf2da1d93c8ca3a462f4c7e4e10e95
4
+ data.tar.gz: f133ccde7da4ea553d933a30c367ecf2a354c2e85ecce0b141c2071f94702237
5
5
  SHA512:
6
- metadata.gz: 45ecde047634d1a23464184a27abaa701f742c9a6b4a29797e66d351fd1b080e3d205c797865e85dd9f70c1c239412de5214b4adfbdacaa6f5ac17048ee25a78
7
- data.tar.gz: a19481a42cba1e64845a7bc98812c9ef73ff22d835a76fa3b0e815904de0574a080ae9dbcf09adbd57ca78606ac6e1743d3f56498a702e788b244f2cc6134932
6
+ metadata.gz: e9baa1554bad7b3f3f8625940ee2e62f08b7185a662401757b8b172d7b9734427245fd8a18fc2aaeb7e4a90c15f3fa3f2346bfc53cce41efe03c15794b63a01c
7
+ data.tar.gz: 52be62b23c582cdcc7fd12c5961c7ed82847a57b90bf8aea88a56580c7e05c1c416a0a51f7b8e170afde63763560a6acfa4200b95917ee5bc6542ae028954aec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ v2.5.1 / 2018-01-25
2
+ ===================
3
+
4
+ * **Bug Fixes**
5
+ * Some secondary index queries fail with parameter error on Aerospike Server v3.15.1.x [#57](https://github.com/aerospike/aerospike-client-ruby/issues/57)
6
+
7
+ * **Updates**
8
+ * Added Ruby 2.5 to test matrix
9
+ * Updated documentation for Client#truncate command [CLIENT-985]
10
+
1
11
  v2.5.0 / 2017-10-10
2
12
  ===================
3
13
 
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  An Aerospike library for Ruby.
9
9
 
10
- This library is compatible with Ruby 2.2+ and supports Linux, Mac OS X and various other BSDs. Rubinius is supported, but not JRuby.
10
+ This library is compatible with Ruby 2.2+ and supports Linux, Mac OS X and various other BSDs.
11
11
 
12
12
  - [Usage](#Usage)
13
13
  - [Prerequisites](#Prerequisites)
@@ -208,7 +208,9 @@ module Aerospike
208
208
  # Removes records in the specified namespace/set efficiently.
209
209
  #
210
210
  # This method is orders of magnitude faster than deleting records one at a
211
- # time. Works with Aerospike Server versions >= 3.12.
211
+ # time. It requires Aerospike Server version 3.12 or later. See
212
+ # https://www.aerospike.com/docs/reference/info#truncate for further
213
+ # information.
212
214
  #
213
215
  # This asynchronous server call may return before the truncate is complete.
214
216
  # The user can still write new records after the server call returns
@@ -53,7 +53,7 @@ module Aerospike
53
53
  fieldCount+=1
54
54
  end
55
55
 
56
- if @statement.filters && @statement.filters.length > 0
56
+ if !is_scan?
57
57
  col_type = @statement.filters[0].collection_type
58
58
  if col_type > 0
59
59
  @data_offset += FIELD_HEADER_SIZE + 1
@@ -69,6 +69,17 @@ module Aerospike
69
69
  end
70
70
  @data_offset += filterSize
71
71
  fieldCount+=1
72
+
73
+ if @statement.bin_names && @statement.bin_names.length > 0
74
+ @data_offset += FIELD_HEADER_SIZE
75
+ binNameSize+=1 # num bin names
76
+
77
+ @statement.bin_names.each do |bin_name|
78
+ binNameSize += bin_name.bytesize + 1
79
+ end
80
+ @data_offset += binNameSize
81
+ fieldCount+=1
82
+ end
72
83
  else
73
84
  # Calling query with no filters is more efficiently handled by a primary index scan.
74
85
  # Estimate scan options size.
@@ -76,17 +87,6 @@ module Aerospike
76
87
  fieldCount+=1
77
88
  end
78
89
 
79
- if @statement.bin_names && @statement.bin_names.length > 0
80
- @data_offset += FIELD_HEADER_SIZE
81
- binNameSize+=1 # num bin names
82
-
83
- @statement.bin_names.each do |bin_name|
84
- binNameSize += bin_name.bytesize + 1 #OPERATION_HEADER_SIZE
85
- end
86
- @data_offset += binNameSize
87
- fieldCount+=1
88
- end
89
-
90
90
  @statement.set_task_id
91
91
 
92
92
  @data_offset += 8 + FIELD_HEADER_SIZE
@@ -117,7 +117,7 @@ module Aerospike
117
117
  size_buffer
118
118
 
119
119
  readAttr = @policy.include_bin_data ? INFO1_READ : INFO1_READ | INFO1_NOBINDATA
120
- operation_count = (@statement.filters.to_a.length == 0 && @statement.bin_names.to_a.length == 0) ? @statement.bin_names.length : 0
120
+ operation_count = (is_scan? && !@statement.bin_names.nil?) ? @statement.bin_names.length : 0
121
121
 
122
122
  write_header(@policy, readAttr, 0, fieldCount, operation_count)
123
123
 
@@ -133,7 +133,7 @@ module Aerospike
133
133
  write_field_string(@statement.set_name, Aerospike::FieldType::TABLE)
134
134
  end
135
135
 
136
- if @statement.filters && @statement.filters.length > 0
136
+ if !is_scan?
137
137
  col_type = @statement.filters[0].collection_type
138
138
  if col_type > 0
139
139
  write_field_header(1, Aerospike::FieldType::INDEX_TYPE)
@@ -172,18 +172,6 @@ module Aerospike
172
172
  @data_offset+=1
173
173
  end
174
174
 
175
- if @statement.bin_names && @statement.bin_names.length > 0
176
- write_field_header(binNameSize, Aerospike::FieldType::QUERY_BINLIST)
177
- @data_buffer.write_byte(@statement.bin_names.length, @data_offset)
178
- @data_offset+=1
179
-
180
- @statement.bin_names.each do |bin_name|
181
- len = @data_buffer.write_binary(bin_name, @data_offset + 1)
182
- @data_buffer.write_byte(len, @data_offset)
183
- @data_offset += len + 1
184
- end
185
- end
186
-
187
175
  write_field_header(8, Aerospike::FieldType::TRAN_ID)
188
176
  @data_buffer.write_int64(@statement.task_id, @data_offset)
189
177
  @data_offset += 8
@@ -203,11 +191,21 @@ module Aerospike
203
191
  write_field_bytes(functionArgBuffer, Aerospike::FieldType::UDF_ARGLIST)
204
192
  end
205
193
 
194
+ if is_scan? && !@statement.bin_names.nil?
195
+ @statement.bin_names.each do |bin_name|
196
+ write_operation_for_bin_name(bin_name, Aerospike::Operation::READ)
197
+ end
198
+ end
199
+
206
200
  end_cmd
207
201
 
208
202
  return nil
209
203
  end
210
204
 
205
+ def is_scan?
206
+ @statement.filters.nil? || @statement.filters.empty?
207
+ end
208
+
211
209
  end # class
212
210
 
213
211
  end # module
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Aerospike
3
- VERSION = "2.5.0"
3
+ VERSION = "2.5.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aerospike
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Khosrow Afroozeh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-10 00:00:00.000000000 Z
12
+ date: 2018-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.5.1
157
+ rubygems_version: 2.7.3
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: An Aerospike driver for Ruby.