aerospike 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +1 -2
- data/lib/aerospike.rb +1 -1
- data/lib/aerospike/aerospike_exception.rb +1 -1
- data/lib/aerospike/atomic/atomic.rb +1 -1
- data/lib/aerospike/bin.rb +1 -1
- data/lib/aerospike/cdt/list_operation.rb +1 -1
- data/lib/aerospike/cdt/map_operation.rb +1 -1
- data/lib/aerospike/cdt/map_order.rb +1 -1
- data/lib/aerospike/cdt/map_policy.rb +1 -1
- data/lib/aerospike/cdt/map_return_type.rb +1 -1
- data/lib/aerospike/cdt/map_write_mode.rb +1 -1
- data/lib/aerospike/client.rb +31 -10
- data/lib/aerospike/cluster/cluster.rb +2 -2
- data/lib/aerospike/cluster/connection.rb +1 -1
- data/lib/aerospike/cluster/node.rb +1 -1
- data/lib/aerospike/cluster/node_validator.rb +1 -1
- data/lib/aerospike/cluster/partition.rb +1 -1
- data/lib/aerospike/cluster/partition_tokenizer_new.rb +1 -1
- data/lib/aerospike/cluster/partition_tokenizer_old.rb +1 -1
- data/lib/aerospike/command/admin_command.rb +1 -1
- data/lib/aerospike/command/batch_command.rb +1 -1
- data/lib/aerospike/command/batch_command_exists.rb +1 -1
- data/lib/aerospike/command/batch_command_get.rb +1 -1
- data/lib/aerospike/command/batch_item.rb +1 -1
- data/lib/aerospike/command/batch_node.rb +1 -1
- data/lib/aerospike/command/command.rb +9 -1
- data/lib/aerospike/command/delete_command.rb +1 -1
- data/lib/aerospike/command/execute_command.rb +1 -1
- data/lib/aerospike/command/exists_command.rb +1 -1
- data/lib/aerospike/command/field_type.rb +2 -1
- data/lib/aerospike/command/operate_command.rb +1 -1
- data/lib/aerospike/command/read_command.rb +1 -1
- data/lib/aerospike/command/read_header_command.rb +1 -1
- data/lib/aerospike/command/roles.rb +1 -1
- data/lib/aerospike/command/single_command.rb +1 -1
- data/lib/aerospike/command/touch_command.rb +1 -1
- data/lib/aerospike/command/unsupported_particle_type_validator.rb +1 -1
- data/lib/aerospike/command/write_command.rb +1 -1
- data/lib/aerospike/geo_json.rb +1 -1
- data/lib/aerospike/host.rb +1 -1
- data/lib/aerospike/info.rb +1 -1
- data/lib/aerospike/key.rb +2 -2
- data/lib/aerospike/language.rb +1 -1
- data/lib/aerospike/ldt/large.rb +1 -1
- data/lib/aerospike/ldt/large_list.rb +1 -1
- data/lib/aerospike/ldt/large_map.rb +1 -1
- data/lib/aerospike/ldt/large_set.rb +1 -1
- data/lib/aerospike/ldt/large_stack.rb +1 -1
- data/lib/aerospike/operation.rb +1 -1
- data/lib/aerospike/policy/admin_policy.rb +1 -1
- data/lib/aerospike/policy/batch_policy.rb +1 -1
- data/lib/aerospike/policy/client_policy.rb +1 -1
- data/lib/aerospike/policy/commit_level.rb +1 -1
- data/lib/aerospike/policy/consistency_level.rb +1 -1
- data/lib/aerospike/policy/generation_policy.rb +1 -1
- data/lib/aerospike/policy/operate_policy.rb +1 -1
- data/lib/aerospike/policy/policy.rb +1 -1
- data/lib/aerospike/policy/priority.rb +1 -1
- data/lib/aerospike/policy/query_policy.rb +1 -1
- data/lib/aerospike/policy/record_bin_multiplicity.rb +1 -1
- data/lib/aerospike/policy/record_exists_action.rb +1 -1
- data/lib/aerospike/policy/scan_policy.rb +7 -4
- data/lib/aerospike/policy/write_policy.rb +1 -1
- data/lib/aerospike/query/filter.rb +1 -1
- data/lib/aerospike/query/query_command.rb +1 -1
- data/lib/aerospike/query/recordset.rb +1 -1
- data/lib/aerospike/query/scan_command.rb +1 -1
- data/lib/aerospike/query/statement.rb +1 -1
- data/lib/aerospike/query/stream_command.rb +1 -1
- data/lib/aerospike/record.rb +1 -1
- data/lib/aerospike/result_code.rb +1 -1
- data/lib/aerospike/task/execute_task.rb +1 -1
- data/lib/aerospike/task/index_task.rb +1 -1
- data/lib/aerospike/task/task.rb +1 -1
- data/lib/aerospike/task/udf_register_task.rb +1 -1
- data/lib/aerospike/task/udf_remove_task.rb +1 -1
- data/lib/aerospike/ttl.rb +1 -1
- data/lib/aerospike/udf.rb +1 -1
- data/lib/aerospike/user_role.rb +1 -1
- data/lib/aerospike/utils/buffer.rb +1 -1
- data/lib/aerospike/utils/packer.rb +1 -1
- data/lib/aerospike/utils/pool.rb +1 -1
- data/lib/aerospike/utils/unpacker.rb +1 -1
- data/lib/aerospike/value/particle_type.rb +1 -1
- data/lib/aerospike/value/value.rb +1 -1
- data/lib/aerospike/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0d72ca366a1dfef80e3703e8ff0ca7577d99b2c
|
4
|
+
data.tar.gz: f18c8e3563d2b70041fa0d187af3917e35839ed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 650892d7b9ed21af36a832ba0312763fe24a7cdf0acc7234729b19481c6b7f9b9218b4adb7ac6f63501e7e1c3cf40efe877bfa7ab6a3f9a5f1b23eb53227674d
|
7
|
+
data.tar.gz: 1502c11fb3eba7ed1ffe38fda35554808a53a831ddc2898b0f1fbbe3d088f76cbed5625bfcaafb7c38d0099c82adefb35376796e5aa09bbd2fb79ad421664e11
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
v2.4.0 / 2017-04-06
|
2
|
+
===================
|
3
|
+
|
4
|
+
* **New Features**
|
5
|
+
* Support ns/set truncate command [#47](https://github.com/aerospike/aerospike-client-ruby/issues/47)
|
6
|
+
* Support configurable scan socket write timeout [#46](https://github.com/aerospike/aerospike-client-ruby/issues/46)
|
7
|
+
|
8
|
+
* **Bug Fixes**
|
9
|
+
* Fix "Digest::Base cannot be directly inherited in Ruby" [#45](https://github.com/aerospike/aerospike-client-ruby/issues/45)
|
10
|
+
|
11
|
+
* **Updates**
|
12
|
+
* Ruby 2.0 has been removed from the client's test matrix as [official support for Ruby 2.0 has ended in Feb 2016](https://www.ruby-lang.org/en/news/2016/02/24/support-plan-of-ruby-2-0-0-and-2-1/). Nothing has changed in the client that would break compatibility with Ruby 2.0 yet. But compatibility is not guaranteed for future client releases. [#52](https://github.com/aerospike/aerospike-client-ruby/pull/52)
|
13
|
+
|
1
14
|
v2.3.0 / 2017-01-04
|
2
15
|
===================
|
3
16
|
|
data/README.md
CHANGED
@@ -7,8 +7,7 @@
|
|
7
7
|
|
8
8
|
An Aerospike library for Ruby.
|
9
9
|
|
10
|
-
This library is compatible with Ruby 2.
|
11
|
-
|
10
|
+
This library is compatible with Ruby 2.1+ and supports Linux, Mac OS X and various other BSDs. Rubinius is supported, but not JRuby.
|
12
11
|
|
13
12
|
- [Usage](#Usage)
|
14
13
|
- [Prerequisites](#Prerequisites)
|
data/lib/aerospike.rb
CHANGED
data/lib/aerospike/bin.rb
CHANGED
data/lib/aerospike/client.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014-
|
2
|
+
# Copyright 2014-2017 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -204,6 +204,31 @@ module Aerospike
|
|
204
204
|
command.existed
|
205
205
|
end
|
206
206
|
|
207
|
+
##
|
208
|
+
# Removes records in the specified namespace/set efficiently.
|
209
|
+
#
|
210
|
+
# This method is orders of magnitude faster than deleting records one at a
|
211
|
+
# time. Works with Aerospike Server versions >= 3.12.
|
212
|
+
#
|
213
|
+
# This asynchronous server call may return before the truncate is complete.
|
214
|
+
# The user can still write new records after the server call returns
|
215
|
+
# because new records will have last update times greater than the truncate
|
216
|
+
# cut-off (set at the time of the truncate call.)
|
217
|
+
#
|
218
|
+
# If no policy options are provided, +@default_info_policy+ will be used.
|
219
|
+
|
220
|
+
def truncate(namespace, set_name = nil, before_last_update = nil, options = {})
|
221
|
+
policy = create_policy(options, WritePolicy)
|
222
|
+
str_cmd = "truncate:namespace=#{namespace}"
|
223
|
+
str_cmd << ";set=#{set_name}" unless set_name.to_s.strip.empty?
|
224
|
+
str_cmd << ";lut=#{(before_last_update.to_f * 1_000_000_000.0).round}" if before_last_update
|
225
|
+
|
226
|
+
# Send index command to one node. That node will distribute the command to other nodes.
|
227
|
+
response = send_info_command(policy, str_cmd).upcase
|
228
|
+
return if response == 'OK'
|
229
|
+
raise Aerospike::Exceptions::Aerospike.new(Aerospike::ResultCode::SERVER_ERROR, "Truncate failed: #{response}")
|
230
|
+
end
|
231
|
+
|
207
232
|
#-------------------------------------------------------
|
208
233
|
# Touch Operations
|
209
234
|
#-------------------------------------------------------
|
@@ -572,10 +597,7 @@ module Aerospike
|
|
572
597
|
str_cmd << ";priority=normal"
|
573
598
|
|
574
599
|
# Send index command to one node. That node will distribute the command to other nodes.
|
575
|
-
|
576
|
-
_, response = response_map.first
|
577
|
-
response = response.to_s.upcase
|
578
|
-
|
600
|
+
response = send_info_command(policy, str_cmd).upcase
|
579
601
|
if response == 'OK'
|
580
602
|
# Return task that could optionally be polled for completion.
|
581
603
|
return IndexTask.new(@cluster, namespace, index_name)
|
@@ -598,10 +620,7 @@ module Aerospike
|
|
598
620
|
str_cmd << ";indexname=#{index_name}"
|
599
621
|
|
600
622
|
# Send index command to one node. That node will distribute the command to other nodes.
|
601
|
-
|
602
|
-
_, response = response_map.first
|
603
|
-
response = response.to_s.upcase
|
604
|
-
|
623
|
+
response = send_info_command(policy, str_cmd).upcase
|
605
624
|
return if response == 'OK'
|
606
625
|
|
607
626
|
# Index did not previously exist. Return without error.
|
@@ -817,7 +836,9 @@ module Aerospike
|
|
817
836
|
|
818
837
|
def send_info_command(policy, command)
|
819
838
|
policy ||= default_policy
|
820
|
-
|
839
|
+
Aerospike.logger.debug { "Sending info command: #{command}" }
|
840
|
+
_, response = @cluster.request_info(policy, command).first
|
841
|
+
response.to_s
|
821
842
|
end
|
822
843
|
|
823
844
|
def hash_to_bins(hash)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014 Aerospike, Inc.
|
2
|
+
# Copyright 2014-2017 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -381,7 +381,7 @@ module Aerospike
|
|
381
381
|
else
|
382
382
|
begin
|
383
383
|
nv = NodeValidator.new(self, aliass, @connection_timeout, @cluster_name)
|
384
|
-
rescue
|
384
|
+
rescue => e
|
385
385
|
Aerospike.logger.error("Seed #{seed.to_s} failed: #{e}")
|
386
386
|
next
|
387
387
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014-
|
2
|
+
# Copyright 2014-2017 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -337,6 +337,10 @@ module Aerospike
|
|
337
337
|
@data_offset += 2 + FIELD_HEADER_SIZE
|
338
338
|
field_count += 1
|
339
339
|
|
340
|
+
# Estimate scan timeout size.
|
341
|
+
@data_offset += 4 + FIELD_HEADER_SIZE
|
342
|
+
field_count += 1
|
343
|
+
|
340
344
|
if bin_names
|
341
345
|
bin_names.each do |bin_name|
|
342
346
|
estimate_operation_size_for_bin_name(bin_name)
|
@@ -378,6 +382,10 @@ module Aerospike
|
|
378
382
|
@data_buffer.write_byte(policy.scan_percent.to_i.ord, @data_offset)
|
379
383
|
@data_offset += 1
|
380
384
|
|
385
|
+
write_field_header(4, Aerospike::FieldType::SCAN_TIMEOUT)
|
386
|
+
@data_buffer.write_uint32(policy.socket_timeout.to_i, @data_offset)
|
387
|
+
@data_offset += 4
|
388
|
+
|
381
389
|
if bin_names
|
382
390
|
bin_names.each do |bin_name|
|
383
391
|
write_operation_for_bin_name(bin_name, Aerospike::Operation::READ)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014 Aerospike, Inc.
|
2
|
+
# Copyright 2014-2017 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License")
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -28,6 +28,7 @@ module Aerospike
|
|
28
28
|
DIGEST_RIPE_ARRAY = 6
|
29
29
|
TRAN_ID = 7 # user supplied transaction id, which is simply passed back
|
30
30
|
SCAN_OPTIONS = 8
|
31
|
+
SCAN_TIMEOUT = 9
|
31
32
|
INDEX_NAME = 21
|
32
33
|
INDEX_RANGE = 22
|
33
34
|
INDEX_FILTER = 23
|
data/lib/aerospike/geo_json.rb
CHANGED
data/lib/aerospike/host.rb
CHANGED
data/lib/aerospike/info.rb
CHANGED
data/lib/aerospike/key.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014 Aerospike, Inc.
|
2
|
+
# Copyright 2014-2017 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -28,7 +28,7 @@ module Aerospike
|
|
28
28
|
if RUBY_PLATFORM == 'java'
|
29
29
|
OpenSSL::Digest::RIPEMD160.new
|
30
30
|
else
|
31
|
-
Digest
|
31
|
+
Digest(:RMD160).new
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
data/lib/aerospike/language.rb
CHANGED
data/lib/aerospike/ldt/large.rb
CHANGED
data/lib/aerospike/operation.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014 Aerospike, Inc.
|
2
|
+
# Copyright 2014-2017 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -20,8 +20,11 @@ module Aerospike
|
|
20
20
|
# Container object for scan policy command.
|
21
21
|
class ScanPolicy < BatchPolicy
|
22
22
|
|
23
|
-
attr_accessor :scan_percent
|
24
|
-
|
23
|
+
attr_accessor :scan_percent
|
24
|
+
attr_accessor :concurrent_nodes
|
25
|
+
attr_accessor :include_bin_data
|
26
|
+
attr_accessor :fail_on_cluster_change
|
27
|
+
attr_accessor :socket_timeout
|
25
28
|
|
26
29
|
def initialize(opt={})
|
27
30
|
super(opt)
|
@@ -30,7 +33,7 @@ module Aerospike
|
|
30
33
|
@concurrent_nodes = opt[:concurrent_nodes].nil? ? true : concurrent_nodes
|
31
34
|
@include_bin_data = opt[:include_bin_data].nil? ? true : include_bin_data
|
32
35
|
@fail_on_cluster_change = opt[:fail_on_cluster_change].nil? ? true : fail_on_cluster_change
|
33
|
-
|
36
|
+
@socket_timeout = opt[:socket_timeout] || 10000
|
34
37
|
@max_retries = 0
|
35
38
|
|
36
39
|
self
|
data/lib/aerospike/record.rb
CHANGED
data/lib/aerospike/task/task.rb
CHANGED
data/lib/aerospike/ttl.rb
CHANGED
data/lib/aerospike/udf.rb
CHANGED
data/lib/aerospike/user_role.rb
CHANGED
data/lib/aerospike/utils/pool.rb
CHANGED
data/lib/aerospike/version.rb
CHANGED
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.
|
4
|
+
version: 2.4.0
|
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-
|
12
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: msgpack
|