aerospike 2.12.0 → 2.17.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 +44 -0
- data/lib/aerospike.rb +17 -4
- data/lib/aerospike/aerospike_exception.rb +7 -1
- data/lib/aerospike/atomic/atomic.rb +1 -1
- data/lib/aerospike/bin.rb +1 -1
- data/lib/aerospike/cdt/bit_operation.rb +376 -0
- data/lib/aerospike/cdt/bit_overflow_action.rb +46 -0
- data/lib/aerospike/cdt/bit_policy.rb +36 -0
- data/lib/aerospike/cdt/bit_resize_flags.rb +44 -0
- data/lib/aerospike/cdt/bit_write_flags.rb +51 -0
- data/lib/aerospike/cdt/context.rb +113 -0
- data/lib/aerospike/cdt/hll_operation.rb +200 -0
- data/lib/aerospike/cdt/hll_policy.rb +34 -0
- data/lib/aerospike/cdt/hll_write_flags.rb +53 -0
- data/lib/aerospike/cdt/list_operation.rb +156 -97
- data/lib/aerospike/cdt/list_order.rb +7 -0
- data/lib/aerospike/cdt/list_sort_flags.rb +10 -2
- data/lib/aerospike/cdt/map_operation.rb +180 -93
- data/lib/aerospike/cdt/map_order.rb +4 -4
- 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 +33 -16
- data/lib/aerospike/cluster.rb +139 -17
- data/lib/aerospike/cluster/partition.rb +1 -1
- data/lib/aerospike/cluster/partition_parser.rb +169 -0
- data/lib/aerospike/cluster/rack_parser.rb +117 -0
- data/lib/aerospike/command/admin_command.rb +1 -1
- data/lib/aerospike/command/batch_direct_command.rb +2 -1
- data/lib/aerospike/command/batch_direct_exists_command.rb +1 -1
- data/lib/aerospike/command/batch_direct_node.rb +3 -3
- data/lib/aerospike/command/batch_index_command.rb +1 -0
- data/lib/aerospike/command/batch_index_node.rb +2 -2
- data/lib/aerospike/command/batch_item.rb +1 -1
- data/lib/aerospike/command/command.rb +90 -8
- data/lib/aerospike/command/delete_command.rb +5 -1
- data/lib/aerospike/command/execute_command.rb +1 -1
- data/lib/aerospike/command/exists_command.rb +5 -1
- data/lib/aerospike/command/field_type.rb +2 -1
- data/lib/aerospike/command/multi_command.rb +49 -2
- data/lib/aerospike/command/operate_command.rb +6 -1
- data/lib/aerospike/command/read_command.rb +39 -3
- data/lib/aerospike/command/read_header_command.rb +5 -1
- data/lib/aerospike/command/roles.rb +1 -1
- data/lib/aerospike/command/single_command.rb +9 -3
- data/lib/aerospike/command/touch_command.rb +39 -2
- data/lib/aerospike/command/unsupported_particle_type_validator.rb +1 -1
- data/lib/aerospike/command/write_command.rb +5 -1
- data/lib/aerospike/connection/create.rb +1 -1
- data/lib/aerospike/features.rb +6 -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 +1 -1
- data/lib/aerospike/language.rb +1 -1
- data/lib/aerospike/node.rb +21 -7
- data/lib/aerospike/node/rebalance.rb +50 -0
- data/lib/aerospike/node/refresh/info.rb +4 -1
- data/lib/aerospike/node/refresh/partitions.rb +6 -15
- data/lib/aerospike/node/refresh/racks.rb +47 -0
- data/lib/aerospike/node/refresh/reset.rb +1 -0
- data/lib/aerospike/node/verify/rebalance_generation.rb +43 -0
- data/lib/aerospike/node_validator.rb +4 -19
- data/lib/aerospike/operation.rb +8 -3
- 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 +16 -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 +19 -2
- data/lib/aerospike/policy/priority.rb +1 -1
- data/lib/aerospike/policy/query_policy.rb +8 -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/replica.rb +45 -0
- data/lib/aerospike/policy/scan_policy.rb +8 -1
- data/lib/aerospike/policy/write_policy.rb +1 -1
- data/lib/aerospike/query/filter.rb +1 -1
- data/lib/aerospike/query/query_command.rb +10 -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 +14 -1
- data/lib/aerospike/socket/base.rb +4 -3
- 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 +14 -4
- data/lib/aerospike/utils/packer.rb +1 -1
- data/lib/aerospike/utils/pool.rb +1 -1
- data/lib/aerospike/utils/unpacker.rb +3 -3
- data/lib/aerospike/value/particle_type.rb +2 -2
- data/lib/aerospike/value/value.rb +108 -6
- data/lib/aerospike/version.rb +1 -1
- metadata +19 -6
- data/lib/aerospike/cluster/partition_tokenizer_new.rb +0 -130
- data/lib/aerospike/cluster/partition_tokenizer_old.rb +0 -135
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014-
|
2
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -33,6 +33,10 @@ module Aerospike
|
|
33
33
|
self
|
34
34
|
end
|
35
35
|
|
36
|
+
def get_node
|
37
|
+
@cluster.read_node(@partition, @policy.replica, @sequence)
|
38
|
+
end
|
39
|
+
|
36
40
|
def write_buffer
|
37
41
|
set_exists(@policy, @key)
|
38
42
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2014-
|
1
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
2
2
|
#
|
3
3
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
4
4
|
# license agreements.
|
@@ -31,6 +31,7 @@ module Aerospike
|
|
31
31
|
TRAN_ID = 7 # user supplied transaction id, which is simply passed back
|
32
32
|
SCAN_OPTIONS = 8
|
33
33
|
SCAN_TIMEOUT = 9
|
34
|
+
RECORDS_PER_SECOND = 10
|
34
35
|
INDEX_NAME = 21
|
35
36
|
INDEX_RANGE = 22
|
36
37
|
INDEX_FILTER = 23
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2014-
|
1
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
2
2
|
#
|
3
3
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
4
4
|
# license agreements.
|
@@ -29,21 +29,57 @@ module Aerospike
|
|
29
29
|
@valid = true
|
30
30
|
@mutex = Mutex.new
|
31
31
|
|
32
|
+
@compressed_data_buffer = nil
|
33
|
+
@compressed_data_offset = nil
|
34
|
+
|
32
35
|
self
|
33
36
|
end
|
34
37
|
|
38
|
+
def get_node
|
39
|
+
@node
|
40
|
+
end
|
41
|
+
|
35
42
|
def parse_result
|
36
43
|
# Read socket into receive buffer one record at a time. Do not read entire receive size
|
37
44
|
# because the receive buffer would be too big.
|
38
45
|
status = true
|
39
46
|
|
40
47
|
while status
|
48
|
+
@data_offset = 0
|
49
|
+
@compressed_data_buffer = nil
|
50
|
+
|
41
51
|
# Read header.
|
42
52
|
read_bytes(8)
|
43
53
|
|
44
54
|
size = @data_buffer.read_int64(0)
|
45
55
|
receive_size = size & 0xFFFFFFFFFFFF
|
46
56
|
|
57
|
+
# inflate if compressed
|
58
|
+
compressed_sz = compressed_size
|
59
|
+
if compressed_sz
|
60
|
+
begin
|
61
|
+
# read compressed msg header
|
62
|
+
@conn.read(@data_buffer, 8)
|
63
|
+
|
64
|
+
# read compressed message
|
65
|
+
@conn.read(@data_buffer, compressed_sz - 8)
|
66
|
+
|
67
|
+
# inflate the results
|
68
|
+
# TODO: reuse the current buffer
|
69
|
+
uncompressed = Zlib::inflate(@data_buffer.buf)
|
70
|
+
receive_size = uncompressed.size - 8
|
71
|
+
|
72
|
+
@compressed_data_buffer = Buffer.new(-1, uncompressed)
|
73
|
+
@compressed_data_offset = 0
|
74
|
+
|
75
|
+
# waste the first 8 header bytes
|
76
|
+
@compressed_data_buffer.eat!(8)
|
77
|
+
rescue => e
|
78
|
+
Aerospike.logger.error("parse result error: #{e}")
|
79
|
+
raise e
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
47
83
|
if receive_size > 0
|
48
84
|
status = parse_group(receive_size)
|
49
85
|
else
|
@@ -153,7 +189,13 @@ module Aerospike
|
|
153
189
|
@data_buffer = Buffer.new(length)
|
154
190
|
end
|
155
191
|
|
156
|
-
|
192
|
+
if compressed?
|
193
|
+
@data_buffer.write_binary(@compressed_data_buffer.buf[@compressed_data_offset...@compressed_data_offset+length], 0)
|
194
|
+
@compressed_data_offset += length
|
195
|
+
else
|
196
|
+
@conn.read(@data_buffer, length)
|
197
|
+
end
|
198
|
+
|
157
199
|
@data_offset += length
|
158
200
|
end
|
159
201
|
|
@@ -172,6 +214,11 @@ module Aerospike
|
|
172
214
|
res
|
173
215
|
end
|
174
216
|
|
217
|
+
def compressed?
|
218
|
+
@compressed_data_buffer != nil
|
219
|
+
end
|
220
|
+
|
221
|
+
|
175
222
|
end # class
|
176
223
|
|
177
224
|
end # module
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014-
|
2
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -28,6 +28,11 @@ module Aerospike
|
|
28
28
|
@operations = operations
|
29
29
|
end
|
30
30
|
|
31
|
+
def get_node
|
32
|
+
@cluster.master_node(@partition)
|
33
|
+
end
|
34
|
+
|
35
|
+
|
31
36
|
def write_bins
|
32
37
|
@operations.select{|op| op.op_type == Aerospike::Operation::WRITE}.map(&:bin).compact
|
33
38
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2014-
|
3
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
4
4
|
#
|
5
5
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
6
6
|
# license agreements.
|
@@ -15,6 +15,8 @@
|
|
15
15
|
# License for the specific language governing permissions and limitations under
|
16
16
|
# the License.
|
17
17
|
|
18
|
+
require 'zlib'
|
19
|
+
|
18
20
|
require 'aerospike/record'
|
19
21
|
|
20
22
|
require 'aerospike/command/single_command'
|
@@ -39,6 +41,10 @@ module Aerospike
|
|
39
41
|
self
|
40
42
|
end
|
41
43
|
|
44
|
+
def get_node
|
45
|
+
@cluster.read_node(@partition, @policy.replica, @sequence)
|
46
|
+
end
|
47
|
+
|
42
48
|
def write_buffer
|
43
49
|
set_read(@policy, @key, @bin_names)
|
44
50
|
end
|
@@ -46,12 +52,40 @@ module Aerospike
|
|
46
52
|
def parse_result
|
47
53
|
# Read header.
|
48
54
|
begin
|
49
|
-
@conn.read(@data_buffer,
|
55
|
+
@conn.read(@data_buffer, 8)
|
50
56
|
rescue => e
|
51
57
|
Aerospike.logger.error("parse result error: #{e}")
|
52
58
|
raise e
|
53
59
|
end
|
54
60
|
|
61
|
+
# inflate if compressed
|
62
|
+
compressed_sz = compressed_size
|
63
|
+
if compressed_sz
|
64
|
+
begin
|
65
|
+
# waste 8 size bytes
|
66
|
+
@conn.read(@data_buffer, 8)
|
67
|
+
|
68
|
+
# read compressed message
|
69
|
+
@conn.read(@data_buffer, compressed_sz - 8)
|
70
|
+
|
71
|
+
# inflate the results
|
72
|
+
# TODO: reuse the current buffer
|
73
|
+
uncompressed = Zlib::inflate(@data_buffer.buf)
|
74
|
+
|
75
|
+
@data_buffer = Buffer.new(-1, uncompressed)
|
76
|
+
rescue => e
|
77
|
+
Aerospike.logger.error("parse result error: #{e}")
|
78
|
+
raise e
|
79
|
+
end
|
80
|
+
else
|
81
|
+
begin
|
82
|
+
bytes_read = @conn.read(@data_buffer, MSG_TOTAL_HEADER_SIZE - 8, 8)
|
83
|
+
rescue => e
|
84
|
+
Aerospike.logger.error("parse result error: #{e}")
|
85
|
+
raise e
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
55
89
|
# A number of these are commented out because we just don't care enough to read
|
56
90
|
# that section of the header. If we do care, uncomment and check!
|
57
91
|
sz = @data_buffer.read_int64(0)
|
@@ -64,7 +98,9 @@ module Aerospike
|
|
64
98
|
receive_size = (sz & 0xFFFFFFFFFFFF) - header_length
|
65
99
|
|
66
100
|
# Read remaining message bytes.
|
67
|
-
if
|
101
|
+
if compressed_sz
|
102
|
+
@data_buffer.eat!(MSG_TOTAL_HEADER_SIZE)
|
103
|
+
elsif receive_size > 0
|
68
104
|
size_buffer_sz(receive_size)
|
69
105
|
|
70
106
|
begin
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014-
|
2
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -33,6 +33,10 @@ module Aerospike
|
|
33
33
|
self
|
34
34
|
end
|
35
35
|
|
36
|
+
def get_node
|
37
|
+
@cluster.read_node(@partition, @policy.replica, @sequence)
|
38
|
+
end
|
39
|
+
|
36
40
|
def write_buffer
|
37
41
|
set_read_header(@policy, @key)
|
38
42
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2014-
|
1
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
2
2
|
#
|
3
3
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
4
4
|
# license agreements.
|
@@ -27,12 +27,18 @@ module Aerospike
|
|
27
27
|
@cluster = cluster
|
28
28
|
@key = key
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
@partition = Partition.new_by_key(key)
|
31
|
+
|
32
|
+
super()
|
32
33
|
end
|
33
34
|
|
34
35
|
protected
|
35
36
|
|
37
|
+
def get_node
|
38
|
+
# abstract method
|
39
|
+
raise Aerospike::Exceptions::InvalidNode
|
40
|
+
end
|
41
|
+
|
36
42
|
def empty_socket
|
37
43
|
# There should not be any more bytes.
|
38
44
|
# Empty the socket to be safe.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014-
|
2
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -30,13 +30,50 @@ module Aerospike
|
|
30
30
|
self
|
31
31
|
end
|
32
32
|
|
33
|
+
def get_node
|
34
|
+
@cluster.master_node(@partition)
|
35
|
+
end
|
36
|
+
|
33
37
|
def write_buffer
|
34
38
|
set_touch(@policy, @key)
|
35
39
|
end
|
36
40
|
|
37
41
|
def parse_result
|
38
42
|
# Read header.
|
39
|
-
|
43
|
+
begin
|
44
|
+
@conn.read(@data_buffer, 8)
|
45
|
+
rescue => e
|
46
|
+
Aerospike.logger.error("parse result error: #{e}")
|
47
|
+
raise e
|
48
|
+
end
|
49
|
+
|
50
|
+
# inflate if compressed
|
51
|
+
compressed_sz = compressed_size
|
52
|
+
if compressed_sz
|
53
|
+
begin
|
54
|
+
#waste 8 size bytes
|
55
|
+
@conn.read(@data_buffer, 8)
|
56
|
+
|
57
|
+
# read compressed message
|
58
|
+
@conn.read(@data_buffer, sz - 8)
|
59
|
+
|
60
|
+
# inflate the results
|
61
|
+
# TODO: reuse the current buffer
|
62
|
+
uncompressed = Zlib::inflate(@data_buffer.buf)
|
63
|
+
|
64
|
+
@data_buffer = Buffer.new(-1, uncompressed)
|
65
|
+
rescue => e
|
66
|
+
Aerospike.logger.error("parse result error: #{e}")
|
67
|
+
raise e
|
68
|
+
end
|
69
|
+
else
|
70
|
+
begin
|
71
|
+
bytes_read = @conn.read(@data_buffer, MSG_TOTAL_HEADER_SIZE - 8, 8)
|
72
|
+
rescue => e
|
73
|
+
Aerospike.logger.error("parse result error: #{e}")
|
74
|
+
raise e
|
75
|
+
end
|
76
|
+
end
|
40
77
|
|
41
78
|
result_code = @data_buffer.read(13).ord & 0xFF
|
42
79
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Copyright 2014-
|
2
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
3
3
|
#
|
4
4
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
5
5
|
# license agreements.
|
@@ -33,6 +33,10 @@ module Aerospike
|
|
33
33
|
self
|
34
34
|
end
|
35
35
|
|
36
|
+
def get_node
|
37
|
+
@cluster.master_node(@partition)
|
38
|
+
end
|
39
|
+
|
36
40
|
def write_bins
|
37
41
|
@bins
|
38
42
|
end
|
data/lib/aerospike/features.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2014-
|
3
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
4
4
|
#
|
5
5
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
6
6
|
# license agreements.
|
@@ -40,5 +40,10 @@ module Aerospike
|
|
40
40
|
# Server supports the new "peers" protocol for automatic node discovery
|
41
41
|
PEERS = :peers
|
42
42
|
|
43
|
+
# Server supports the "truncate-namespace" command
|
44
|
+
TRUNCATE_NAMESPACE = :"truncate-namespace"
|
45
|
+
|
46
|
+
# Server supports the "blob-bits" command
|
47
|
+
BLOB_BITS = :"blob-bits"
|
43
48
|
end
|
44
49
|
end
|
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
data/lib/aerospike/language.rb
CHANGED
data/lib/aerospike/node.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright 2014-
|
3
|
+
# Copyright 2014-2020 Aerospike, Inc.
|
4
4
|
#
|
5
5
|
# Portions may be licensed to Aerospike, Inc. under one or more contributor
|
6
6
|
# license agreements.
|
@@ -22,7 +22,7 @@ require 'aerospike/atomic/atomic'
|
|
22
22
|
module Aerospike
|
23
23
|
class Node
|
24
24
|
|
25
|
-
attr_reader :reference_count, :responded, :name, :features, :cluster_name, :partition_generation, :peers_generation, :failures, :cluster, :peers_count, :host
|
25
|
+
attr_reader :reference_count, :responded, :name, :features, :cluster_name, :partition_generation, :rebalance_generation, :peers_generation, :failures, :cluster, :peers_count, :host
|
26
26
|
|
27
27
|
PARTITIONS = 4096
|
28
28
|
FULL_HEALTH = 100
|
@@ -33,7 +33,6 @@ module Aerospike
|
|
33
33
|
@name = nv.name
|
34
34
|
@aliases = Atomic.new(nv.aliases)
|
35
35
|
@host = nv.host
|
36
|
-
@use_new_info = Atomic.new(nv.use_new_info)
|
37
36
|
@features = nv.features
|
38
37
|
@cluster_name = nv.cluster_name
|
39
38
|
|
@@ -47,14 +46,29 @@ module Aerospike
|
|
47
46
|
@peers_count = Atomic.new(0)
|
48
47
|
@peers_generation = ::Aerospike::Node::Generation.new
|
49
48
|
@partition_generation = ::Aerospike::Node::Generation.new
|
49
|
+
@rebalance_generation = ::Aerospike::Node::Rebalance.new
|
50
50
|
@reference_count = Atomic.new(0)
|
51
51
|
@responded = Atomic.new(false)
|
52
52
|
@active = Atomic.new(true)
|
53
53
|
@failures = Atomic.new(0)
|
54
54
|
|
55
|
+
@replica_index = Atomic.new(0)
|
56
|
+
@racks = Atomic.new(nil)
|
57
|
+
|
55
58
|
@connections = ::Aerospike::ConnectionPool.new(cluster, host)
|
56
59
|
end
|
57
60
|
|
61
|
+
def update_racks(parser)
|
62
|
+
new_racks = parser.update_racks
|
63
|
+
@racks.value = new_racks if new_racks
|
64
|
+
end
|
65
|
+
|
66
|
+
def has_rack(ns, rack_id)
|
67
|
+
racks = @racks.value
|
68
|
+
return false if !racks
|
69
|
+
racks[ns] == rack_id
|
70
|
+
end
|
71
|
+
|
58
72
|
# Get a connection to the node. If no cached connection is not available,
|
59
73
|
# a new connection will be created
|
60
74
|
def get_connection(timeout)
|
@@ -178,10 +192,6 @@ module Aerospike
|
|
178
192
|
end
|
179
193
|
alias eql? ==
|
180
194
|
|
181
|
-
def use_new_info?
|
182
|
-
@use_new_info.value
|
183
|
-
end
|
184
|
-
|
185
195
|
def hash
|
186
196
|
@name.hash
|
187
197
|
end
|
@@ -202,6 +212,10 @@ module Aerospike
|
|
202
212
|
Node::Refresh::Partitions.(self, peers)
|
203
213
|
end
|
204
214
|
|
215
|
+
def refresh_racks()
|
216
|
+
Node::Refresh::Racks.(self)
|
217
|
+
end
|
218
|
+
|
205
219
|
def refresh_peers(peers)
|
206
220
|
Node::Refresh::Peers.(self, peers)
|
207
221
|
end
|