aerospike 2.29.0 → 4.0.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/CHANGELOG.md +30 -0
- data/README.md +13 -9
- data/lib/aerospike/batch_attr.rb +292 -0
- data/lib/aerospike/batch_delete.rb +48 -0
- data/lib/aerospike/batch_read.rb +97 -0
- data/lib/aerospike/batch_record.rb +83 -0
- data/lib/aerospike/batch_results.rb +38 -0
- data/lib/aerospike/batch_udf.rb +76 -0
- data/lib/aerospike/batch_write.rb +79 -0
- data/lib/aerospike/cdt/bit_operation.rb +4 -5
- data/lib/aerospike/cdt/map_operation.rb +24 -10
- data/lib/aerospike/cdt/map_policy.rb +6 -3
- data/lib/aerospike/cdt/map_return_type.rb +8 -0
- data/lib/aerospike/client.rb +39 -56
- data/lib/aerospike/cluster.rb +50 -46
- data/lib/aerospike/command/batch_index_command.rb +7 -11
- data/lib/aerospike/command/batch_index_node.rb +3 -4
- data/lib/aerospike/command/batch_operate_command.rb +151 -0
- data/lib/aerospike/command/batch_operate_node.rb +51 -0
- data/lib/aerospike/command/command.rb +231 -128
- data/lib/aerospike/exp/exp.rb +54 -27
- data/lib/aerospike/exp/exp_bit.rb +24 -24
- data/lib/aerospike/exp/exp_hll.rb +12 -12
- data/lib/aerospike/exp/exp_list.rb +101 -86
- data/lib/aerospike/exp/exp_map.rb +118 -110
- data/lib/aerospike/exp/operation.rb +2 -2
- data/lib/aerospike/info.rb +2 -4
- data/lib/aerospike/node.rb +20 -3
- data/lib/aerospike/operation.rb +38 -0
- data/lib/aerospike/policy/batch_delete_policy.rb +71 -0
- data/lib/aerospike/policy/batch_policy.rb +53 -4
- data/lib/aerospike/{command/batch_direct_node.rb → policy/batch_read_policy.rb} +17 -19
- data/lib/aerospike/policy/batch_udf_policy.rb +75 -0
- data/lib/aerospike/policy/batch_write_policy.rb +105 -0
- data/lib/aerospike/policy/policy.rb +3 -40
- data/lib/aerospike/query/query_command.rb +3 -205
- data/lib/aerospike/query/query_executor.rb +2 -2
- data/lib/aerospike/query/query_partition_command.rb +4 -230
- data/lib/aerospike/query/scan_executor.rb +2 -2
- data/lib/aerospike/query/scan_partition_command.rb +3 -3
- data/lib/aerospike/query/server_command.rb +2 -2
- data/lib/aerospike/query/statement.rb +5 -21
- data/lib/aerospike/task/execute_task.rb +2 -2
- data/lib/aerospike/utils/buffer.rb +15 -15
- data/lib/aerospike/version.rb +1 -1
- data/lib/aerospike.rb +13 -12
- metadata +16 -14
- data/lib/aerospike/command/batch_direct_command.rb +0 -105
- data/lib/aerospike/command/batch_direct_exists_command.rb +0 -51
- data/lib/aerospike/query/pred_exp/and_or.rb +0 -32
- data/lib/aerospike/query/pred_exp/geo_json_value.rb +0 -41
- data/lib/aerospike/query/pred_exp/integer_value.rb +0 -32
- data/lib/aerospike/query/pred_exp/op.rb +0 -27
- data/lib/aerospike/query/pred_exp/regex.rb +0 -32
- data/lib/aerospike/query/pred_exp/regex_flags.rb +0 -23
- data/lib/aerospike/query/pred_exp/string_value.rb +0 -29
- data/lib/aerospike/query/pred_exp.rb +0 -192
@@ -21,243 +21,17 @@ module Aerospike
|
|
21
21
|
private
|
22
22
|
|
23
23
|
class QueryPartitionCommand < QueryCommand #:nodoc:
|
24
|
-
def initialize(node, tracker, policy, statement, recordset, node_partitions)
|
25
|
-
super(node, policy, statement, recordset, @node_partitions)
|
24
|
+
def initialize(cluster, node, tracker, policy, statement, recordset, node_partitions)
|
25
|
+
super(cluster, node, policy, statement, recordset, @node_partitions)
|
26
26
|
@node_partitions = node_partitions
|
27
27
|
@tracker = tracker
|
28
28
|
end
|
29
29
|
|
30
30
|
def write_buffer
|
31
|
-
|
32
|
-
|
33
|
-
filter_size = 0
|
34
|
-
bin_name_size = 0
|
35
|
-
|
36
|
-
begin_cmd
|
37
|
-
|
38
|
-
if @statement.namespace
|
39
|
-
@data_offset += @statement.namespace.bytesize + FIELD_HEADER_SIZE
|
40
|
-
field_count += 1
|
41
|
-
end
|
42
|
-
|
43
|
-
if @statement.set_name
|
44
|
-
@data_offset += @statement.set_name.bytesize + FIELD_HEADER_SIZE
|
45
|
-
field_count += 1
|
46
|
-
end
|
47
|
-
|
48
|
-
# Estimate recordsPerSecond field size. This field is used in new servers and not used
|
49
|
-
# (but harmless to add) in old servers.
|
50
|
-
if @policy.records_per_second > 0
|
51
|
-
@data_offset += 4 + FIELD_HEADER_SIZE
|
52
|
-
field_count += 1
|
53
|
-
end
|
54
|
-
|
55
|
-
# Estimate socket timeout field size. This field is used in new servers and not used
|
56
|
-
# (but harmless to add) in old servers.
|
57
|
-
@data_offset += 4 + FIELD_HEADER_SIZE
|
58
|
-
field_count += 1
|
59
|
-
|
60
|
-
# Estimate task_id field.
|
61
|
-
@data_offset += 8 + FIELD_HEADER_SIZE
|
62
|
-
field_count += 1
|
63
|
-
|
64
|
-
filter = @statement.filters[0]
|
65
|
-
bin_names = @statement.bin_names
|
66
|
-
packed_ctx = nil
|
67
|
-
|
68
|
-
if filter
|
69
|
-
col_type = filter.collection_type
|
70
|
-
|
71
|
-
# Estimate INDEX_TYPE field.
|
72
|
-
if col_type > 0
|
73
|
-
@data_offset += FIELD_HEADER_SIZE + 1
|
74
|
-
field_count += 1
|
75
|
-
end
|
76
|
-
|
77
|
-
# Estimate INDEX_RANGE field.
|
78
|
-
@data_offset += FIELD_HEADER_SIZE
|
79
|
-
filter_size += 1 # num filters
|
80
|
-
filter_size += filter.estimate_size
|
81
|
-
|
82
|
-
@data_offset += filter_size
|
83
|
-
field_count += 1
|
84
|
-
|
85
|
-
packed_ctx = filter.packed_ctx
|
86
|
-
if packed_ctx
|
87
|
-
@data_offset += FIELD_HEADER_SIZE + packed_ctx.length
|
88
|
-
field_count += 1
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
@statement.set_task_id
|
93
|
-
predexp = @policy.predexp || @statement.predexp
|
94
|
-
|
95
|
-
if predexp
|
96
|
-
@data_offset += FIELD_HEADER_SIZE
|
97
|
-
pred_size = Aerospike::PredExp.estimate_size(predexp)
|
98
|
-
@data_offset += pred_size
|
99
|
-
field_count += 1
|
100
|
-
end
|
101
|
-
|
102
|
-
unless @policy.filter_exp.nil?
|
103
|
-
exp_size = estimate_expression_size(@policy.filter_exp)
|
104
|
-
field_count += 1 if exp_size > 0
|
105
|
-
end
|
106
|
-
|
107
|
-
# Estimate aggregation/background function size.
|
108
|
-
if @statement.function_name
|
109
|
-
@data_offset += FIELD_HEADER_SIZE + 1 # udf type
|
110
|
-
@data_offset += @statement.package_name.bytesize + FIELD_HEADER_SIZE
|
111
|
-
@data_offset += @statement.function_name.bytesize + FIELD_HEADER_SIZE
|
112
|
-
|
113
|
-
function_arg_buffer = ""
|
114
|
-
if @statement.function_args && @statement.function_args.length > 0
|
115
|
-
function_arg_buffer = Value.of(@statement.function_args).to_bytes
|
116
|
-
end
|
117
|
-
@data_offset += FIELD_HEADER_SIZE + function_arg_buffer.bytesize
|
118
|
-
field_count += 4
|
119
|
-
end
|
120
|
-
|
121
|
-
max_records = 0
|
122
|
-
parts_full_size = 0
|
123
|
-
parts_partial_digest_size = 0
|
124
|
-
parts_partial_bval_size = 0
|
125
|
-
|
126
|
-
unless @node_partitions.nil?
|
127
|
-
parts_full_size = @node_partitions.parts_full.length * 2
|
128
|
-
parts_partial_digest_size = @node_partitions.parts_partial.length * 20
|
129
|
-
|
130
|
-
unless filter.nil?
|
131
|
-
parts_partial_bval_size = @node_partitions.parts_partial.length * 8
|
132
|
-
end
|
133
|
-
max_records = @node_partitions.record_max
|
134
|
-
end
|
135
|
-
|
136
|
-
if parts_full_size > 0
|
137
|
-
@data_offset += parts_full_size + FIELD_HEADER_SIZE
|
138
|
-
field_count += 1
|
139
|
-
end
|
140
|
-
|
141
|
-
if parts_partial_digest_size > 0
|
142
|
-
@data_offset += parts_partial_digest_size + FIELD_HEADER_SIZE
|
143
|
-
field_count += 1
|
144
|
-
end
|
145
|
-
|
146
|
-
if parts_partial_bval_size > 0
|
147
|
-
@data_offset += parts_partial_bval_size + FIELD_HEADER_SIZE
|
148
|
-
field_count += 1
|
149
|
-
end
|
150
|
-
|
151
|
-
# Estimate max records field size. This field is used in new servers and not used
|
152
|
-
# (but harmless to add) in old servers.
|
153
|
-
if max_records > 0
|
154
|
-
@data_offset += 8 + FIELD_HEADER_SIZE
|
155
|
-
field_count += 1
|
156
|
-
end
|
157
|
-
|
158
|
-
operation_count = 0
|
159
|
-
unless bin_names.empty?
|
160
|
-
# Estimate size for selected bin names (query bin names already handled for old servers).
|
161
|
-
bin_names.each do |bin_name|
|
162
|
-
estimate_operation_size_for_bin_name(bin_name)
|
163
|
-
end
|
164
|
-
operation_count = bin_names.length
|
165
|
-
end
|
166
|
-
|
167
|
-
projected_offset = @data_offset
|
168
|
-
|
169
|
-
size_buffer
|
170
|
-
|
171
|
-
read_attr = INFO1_READ
|
172
|
-
read_attr |= INFO1_NOBINDATA if !@policy.include_bin_data
|
173
|
-
read_attr |= INFO1_SHORT_QUERY if @policy.short_query
|
174
|
-
|
175
|
-
infoAttr = INFO3_PARTITION_DONE
|
176
|
-
|
177
|
-
write_header(@policy, read_attr, 0, field_count, operation_count)
|
178
|
-
|
179
|
-
write_field_string(@statement.namespace, FieldType::NAMESPACE) if @statement.namespace
|
180
|
-
write_field_string(@statement.set_name, FieldType::TABLE) if @statement.set_name
|
181
|
-
|
182
|
-
# Write records per second.
|
183
|
-
write_field_int(@policy.records_per_second, FieldType::RECORDS_PER_SECOND) if @policy.records_per_second > 0
|
184
|
-
|
185
|
-
write_filter_exp(@policy.filter_exp, exp_size)
|
186
|
-
|
187
|
-
# Write socket idle timeout.
|
188
|
-
write_field_int(@policy.socket_timeout, FieldType::SOCKET_TIMEOUT)
|
189
|
-
|
190
|
-
# Write task_id field
|
191
|
-
write_field_int64(@statement.task_id, FieldType::TRAN_ID)
|
192
|
-
|
193
|
-
unless predexp.nil?
|
194
|
-
write_field_header(pred_size, Aerospike::FieldType::PREDEXP)
|
195
|
-
@data_offset = Aerospike::PredExp.write(
|
196
|
-
predexp, @data_buffer, @data_offset
|
197
|
-
)
|
198
|
-
end
|
199
|
-
|
200
|
-
if filter
|
201
|
-
type = filter.collection_type
|
202
|
-
|
203
|
-
if type > 0
|
204
|
-
write_field_header(1, FieldType::INDEX_TYPE)
|
205
|
-
@data_offset += @data_buffer.write_byte(type, @data_offset)
|
206
|
-
end
|
207
|
-
|
208
|
-
write_field_header(filter_size, FieldType::INDEX_RANGE)
|
209
|
-
@data_offset += @data_buffer.write_byte(1, @data_offset)
|
210
|
-
@data_offset = filter.write(@data_buffer, @data_offset)
|
211
|
-
|
212
|
-
if packed_ctx
|
213
|
-
write_field_header(packed_ctx.length, FieldType::INDEX_CONTEXT)
|
214
|
-
@data_offset += @data_buffer.write_binary(packed_ctx, @data_offset)
|
215
|
-
end
|
216
|
-
end
|
217
|
-
|
218
|
-
if @statement.function_name
|
219
|
-
write_field_header(1, FieldType::UDF_OP)
|
220
|
-
@data_offset += @data_buffer.write_byte(1, @data_offset)
|
221
|
-
write_field_string(@statement.package_name, FieldType::UDF_PACKAGE_NAME)
|
222
|
-
write_field_string(@statement.function_name, FieldType::UDF_FUNCTION)
|
223
|
-
write_field_string(function_arg_buffer, FieldType::UDF_ARGLIST)
|
224
|
-
end
|
225
|
-
|
226
|
-
if parts_full_size > 0
|
227
|
-
write_field_header(parts_full_size, FieldType::PID_ARRAY)
|
228
|
-
@node_partitions.parts_full.each do |part|
|
229
|
-
@data_offset += @data_buffer.write_uint16_little_endian(part.id, @data_offset)
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
if parts_partial_digest_size > 0
|
234
|
-
write_field_header(parts_partial_digest_size, FieldType::DIGEST_ARRAY)
|
235
|
-
@node_partitions.parts_partial.each do |part|
|
236
|
-
@data_offset += @data_buffer.write_binary(part.digest, @data_offset)
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
|
-
if parts_partial_bval_size > 0
|
241
|
-
write_field_header(parts_partial_bval_size, FieldType::BVAL_ARRAY)
|
242
|
-
@node_partitions.parts_partial.each do |part|
|
243
|
-
@data_offset += @data_buffer.write_uint64_little_endian(part.bval, @data_offset)
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
if max_records > 0
|
248
|
-
write_field(max_records, FieldType::MAX_RECORDS)
|
249
|
-
end
|
250
|
-
|
251
|
-
unless bin_names.empty?
|
252
|
-
bin_names.each do |bin_name|
|
253
|
-
write_operation_for_bin_name(bin_name, Operation::READ)
|
254
|
-
end
|
255
|
-
end
|
31
|
+
set_query(@cluster, @policy, @statement, false, @node_partitions)
|
32
|
+
end
|
256
33
|
|
257
|
-
end_cmd
|
258
34
|
|
259
|
-
nil
|
260
|
-
end
|
261
35
|
|
262
36
|
def should_retry(e)
|
263
37
|
# !! converts nil to false
|
@@ -34,7 +34,7 @@ module Aerospike
|
|
34
34
|
list.each do |node_partition|
|
35
35
|
threads << Thread.new do
|
36
36
|
Thread.current.abort_on_exception = true
|
37
|
-
command = ScanPartitionCommand.new(policy, tracker, node_partition, namespace, set_name, bin_names, recordset)
|
37
|
+
command = ScanPartitionCommand.new(cluster, policy, tracker, node_partition, namespace, set_name, bin_names, recordset)
|
38
38
|
begin
|
39
39
|
command.execute
|
40
40
|
rescue => e
|
@@ -48,7 +48,7 @@ module Aerospike
|
|
48
48
|
else
|
49
49
|
# Use a single thread for all nodes for all node
|
50
50
|
list.each do |node_partition|
|
51
|
-
command = ScanPartitionCommand.new(policy, tracker, node_partition, namespace, set_name, bin_names, recordset)
|
51
|
+
command = ScanPartitionCommand.new(cluster, policy, tracker, node_partition, namespace, set_name, bin_names, recordset)
|
52
52
|
begin
|
53
53
|
command.execute
|
54
54
|
rescue => e
|
@@ -23,9 +23,9 @@ module Aerospike
|
|
23
23
|
|
24
24
|
class ScanPartitionCommand < StreamCommand #:nodoc:
|
25
25
|
|
26
|
-
def initialize(policy, tracker, node_partitions, namespace, set_name, bin_names, recordset)
|
26
|
+
def initialize(cluster, policy, tracker, node_partitions, namespace, set_name, bin_names, recordset)
|
27
27
|
super(node_partitions.node)
|
28
|
-
|
28
|
+
@cluster = cluster
|
29
29
|
@policy = policy
|
30
30
|
@namespace = namespace
|
31
31
|
@set_name = set_name
|
@@ -36,7 +36,7 @@ module Aerospike
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def write_buffer
|
39
|
-
set_scan(@policy, @namespace, @set_name, @bin_names, @node_partitions)
|
39
|
+
set_scan(@cluster, @policy, @namespace, @set_name, @bin_names, @node_partitions)
|
40
40
|
end
|
41
41
|
|
42
42
|
def should_retry(e)
|
@@ -33,10 +33,10 @@ module Aerospike
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def write_buffer
|
36
|
-
set_query(@policy, @statement,
|
36
|
+
set_query(@cluster, @policy, @statement, true, nil)
|
37
37
|
end
|
38
38
|
|
39
|
-
def parse_row
|
39
|
+
def parse_row(result_code)
|
40
40
|
field_count = @data_buffer.read_int16(18)
|
41
41
|
result_code = @data_buffer.read(5).ord & 0xFF
|
42
42
|
skip_key(field_count)
|
@@ -21,9 +21,7 @@ module Aerospike
|
|
21
21
|
# index name, filters, and operations.
|
22
22
|
class Statement
|
23
23
|
|
24
|
-
attr_accessor :namespace, :set_name, :index_name, :bin_names, :task_id
|
25
|
-
attr_accessor :filters, :package_name, :function_name, :function_args, :operations
|
26
|
-
attr_accessor :predexp, :return_data, :records_per_second
|
24
|
+
attr_accessor :namespace, :set_name, :index_name, :bin_names, :task_id, :filters, :package_name, :function_name, :function_args, :operations, :return_data, :records_per_second
|
27
25
|
|
28
26
|
def initialize(namespace, set_name, bin_names=[])
|
29
27
|
# Namespace determines query Namespace
|
@@ -46,16 +44,6 @@ module Aerospike
|
|
46
44
|
# aggregation function.
|
47
45
|
@filters = []
|
48
46
|
|
49
|
-
# Predicate expressions in postfix notation. If the expression is evaluated to false,
|
50
|
-
# the record will be ommited in the results.
|
51
|
-
#
|
52
|
-
# This method is redundant because PredExp can now be set in the base Policy for
|
53
|
-
# any transaction (including queries).
|
54
|
-
#
|
55
|
-
# NOTE : Policy.predexp takes precedence to this value. This value will be
|
56
|
-
# deprecated in the future.
|
57
|
-
@predexp = nil
|
58
|
-
|
59
47
|
@package_name = nil
|
60
48
|
@function_name = nil
|
61
49
|
@function_args = nil
|
@@ -83,27 +71,23 @@ module Aerospike
|
|
83
71
|
end
|
84
72
|
|
85
73
|
def is_scan?
|
86
|
-
|
74
|
+
filters.nil? || filters.empty?
|
87
75
|
end
|
88
76
|
|
89
77
|
def set_task_id
|
90
|
-
while @task_id == 0
|
91
|
-
@task_id = rand(RAND_MAX)
|
92
|
-
end
|
78
|
+
@task_id = rand(RAND_MAX) while @task_id == 0
|
93
79
|
end
|
94
80
|
|
95
81
|
def reset_task_id
|
96
82
|
@task_id = rand(RAND_MAX)
|
97
|
-
while @task_id == 0
|
98
|
-
@task_id = rand(RAND_MAX)
|
99
|
-
end
|
83
|
+
@task_id = rand(RAND_MAX) while @task_id == 0
|
100
84
|
end
|
101
85
|
|
102
86
|
|
103
87
|
|
104
88
|
private
|
105
89
|
|
106
|
-
RAND_MAX = 2**63 - 1
|
90
|
+
RAND_MAX = (2**63) - 1
|
107
91
|
|
108
92
|
end # class
|
109
93
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2013-
|
1
|
+
# Copyright 2013-2023 Aerospike, Inc.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -47,7 +47,7 @@ module Aerospike
|
|
47
47
|
end
|
48
48
|
|
49
49
|
conn = node.get_connection(0)
|
50
|
-
responseMap,
|
50
|
+
responseMap, = Info.request(conn, command)
|
51
51
|
node.put_connection(conn)
|
52
52
|
|
53
53
|
response = responseMap[command]
|
@@ -25,7 +25,7 @@ module Aerospike
|
|
25
25
|
# Buffer class to ease the work around
|
26
26
|
class Buffer #:nodoc:
|
27
27
|
@@buf_pool = Pool.new
|
28
|
-
@@buf_pool.create_proc =
|
28
|
+
@@buf_pool.create_proc = proc { Buffer.new }
|
29
29
|
|
30
30
|
attr_accessor :buf
|
31
31
|
|
@@ -43,7 +43,7 @@ module Aerospike
|
|
43
43
|
MAX_BUFFER_SIZE = 10 * 1024 * 1024
|
44
44
|
|
45
45
|
def initialize(size = DEFAULT_BUFFER_SIZE, buf = nil)
|
46
|
-
@buf =
|
46
|
+
@buf = buf || format("%0#{size}d", 0)
|
47
47
|
@buf.force_encoding("binary")
|
48
48
|
@slice_end = @buf.bytesize
|
49
49
|
end
|
@@ -60,7 +60,7 @@ module Aerospike
|
|
60
60
|
@buf.bytesize
|
61
61
|
end
|
62
62
|
|
63
|
-
|
63
|
+
alias length size
|
64
64
|
|
65
65
|
def eat!(n)
|
66
66
|
@buf.replace(@buf[n..-1])
|
@@ -74,7 +74,7 @@ module Aerospike
|
|
74
74
|
end
|
75
75
|
|
76
76
|
if @buf.bytesize < length
|
77
|
-
@buf.concat("%0#{length - @buf.bytesize}d"
|
77
|
+
@buf.concat(format("%0#{length - @buf.bytesize}d", 0))
|
78
78
|
end
|
79
79
|
@slice_end = length
|
80
80
|
end
|
@@ -144,37 +144,37 @@ module Aerospike
|
|
144
144
|
|
145
145
|
def read_int16(offset)
|
146
146
|
vals = @buf[offset..offset + 1]
|
147
|
-
vals.
|
147
|
+
vals.unpack1(INT16)
|
148
148
|
end
|
149
149
|
|
150
150
|
def read_uint16(offset)
|
151
151
|
vals = @buf[offset..offset + 1]
|
152
|
-
vals.
|
152
|
+
vals.unpack1(UINT16)
|
153
153
|
end
|
154
154
|
|
155
155
|
def read_int32(offset)
|
156
156
|
vals = @buf[offset..offset + 3]
|
157
|
-
vals.
|
157
|
+
vals.unpack1(INT32)
|
158
158
|
end
|
159
159
|
|
160
160
|
def read_uint32(offset)
|
161
161
|
vals = @buf[offset..offset + 3]
|
162
|
-
vals.
|
162
|
+
vals.unpack1(UINT32)
|
163
163
|
end
|
164
164
|
|
165
165
|
def read_int64(offset)
|
166
166
|
vals = @buf[offset..offset + 7]
|
167
|
-
vals.
|
167
|
+
vals.unpack1(INT64)
|
168
168
|
end
|
169
169
|
|
170
170
|
def read_uint64_little_endian(offset)
|
171
171
|
vals = @buf[offset..offset + 7]
|
172
|
-
vals.
|
172
|
+
vals.unpack1(UINT64LE)
|
173
173
|
end
|
174
174
|
|
175
175
|
def read_uint64(offset)
|
176
176
|
vals = @buf[offset..offset + 7]
|
177
|
-
vals.
|
177
|
+
vals.unpack1(UINT64)
|
178
178
|
end
|
179
179
|
|
180
180
|
def read_var_int64(offset, len)
|
@@ -190,7 +190,7 @@ module Aerospike
|
|
190
190
|
|
191
191
|
def read_double(offset)
|
192
192
|
vals = @buf[offset..offset + 7]
|
193
|
-
vals.
|
193
|
+
vals.unpack1(DOUBLE)
|
194
194
|
end
|
195
195
|
|
196
196
|
def read_bool(offset, length)
|
@@ -219,13 +219,13 @@ module Aerospike
|
|
219
219
|
@buf.bytes[start...finish].each do |c|
|
220
220
|
if counter >= start
|
221
221
|
print "%02x " % c
|
222
|
-
ascii << (c.between?(32, 126) ? c :
|
223
|
-
print " " if ascii.length == (width / 2 + 1)
|
222
|
+
ascii << (c.between?(32, 126) ? c : '.')
|
223
|
+
print " " if ascii.length == ((width / 2) + 1)
|
224
224
|
if ascii.length > width
|
225
225
|
ascii << "|"
|
226
226
|
puts ascii
|
227
227
|
ascii = "|"
|
228
|
-
print "%08x "
|
228
|
+
print format("%08x ", (counter + 1))
|
229
229
|
end
|
230
230
|
end
|
231
231
|
counter += 1
|
data/lib/aerospike/version.rb
CHANGED
data/lib/aerospike.rb
CHANGED
@@ -43,8 +43,8 @@ require "aerospike/version"
|
|
43
43
|
require "aerospike/value/particle_type"
|
44
44
|
require "aerospike/value/value"
|
45
45
|
require "aerospike/command/single_command"
|
46
|
-
require "aerospike/command/batch_direct_node"
|
47
46
|
require "aerospike/command/batch_index_node"
|
47
|
+
require "aerospike/command/batch_operate_node"
|
48
48
|
require "aerospike/command/field_type"
|
49
49
|
require "aerospike/command/command"
|
50
50
|
require "aerospike/command/execute_command"
|
@@ -53,9 +53,8 @@ require "aerospike/command/batch_item"
|
|
53
53
|
require "aerospike/command/operate_command"
|
54
54
|
require "aerospike/command/exists_command"
|
55
55
|
require "aerospike/command/multi_command"
|
56
|
-
require "aerospike/command/batch_direct_command"
|
57
|
-
require "aerospike/command/batch_direct_exists_command"
|
58
56
|
require "aerospike/command/batch_index_command"
|
57
|
+
require "aerospike/command/batch_operate_command"
|
59
58
|
require "aerospike/command/batch_index_exists_command"
|
60
59
|
require "aerospike/command/read_header_command"
|
61
60
|
require "aerospike/command/touch_command"
|
@@ -97,6 +96,10 @@ require "aerospike/policy/record_exists_action"
|
|
97
96
|
require "aerospike/policy/generation_policy"
|
98
97
|
require "aerospike/policy/policy"
|
99
98
|
require "aerospike/policy/batch_policy"
|
99
|
+
require "aerospike/policy/batch_delete_policy"
|
100
|
+
require "aerospike/policy/batch_read_policy"
|
101
|
+
require "aerospike/policy/batch_udf_policy"
|
102
|
+
require "aerospike/policy/batch_write_policy"
|
100
103
|
require "aerospike/policy/write_policy"
|
101
104
|
require "aerospike/policy/scan_policy"
|
102
105
|
require "aerospike/policy/query_policy"
|
@@ -105,6 +108,13 @@ require "aerospike/policy/commit_level"
|
|
105
108
|
require "aerospike/policy/admin_policy"
|
106
109
|
require "aerospike/policy/auth_mode"
|
107
110
|
|
111
|
+
require "aerospike/batch_record"
|
112
|
+
require "aerospike/batch_attr"
|
113
|
+
require "aerospike/batch_read"
|
114
|
+
require "aerospike/batch_write"
|
115
|
+
require "aerospike/batch_delete"
|
116
|
+
require "aerospike/batch_udf"
|
117
|
+
|
108
118
|
require "aerospike/socket/base"
|
109
119
|
require "aerospike/socket/ssl"
|
110
120
|
require "aerospike/socket/tcp"
|
@@ -160,7 +170,6 @@ require "aerospike/query/stream_command"
|
|
160
170
|
require "aerospike/query/query_command"
|
161
171
|
require "aerospike/query/scan_command"
|
162
172
|
require "aerospike/query/statement"
|
163
|
-
require "aerospike/query/pred_exp"
|
164
173
|
require "aerospike/query/partition_tracker"
|
165
174
|
require "aerospike/query/partition_status"
|
166
175
|
require "aerospike/query/partition_filter"
|
@@ -178,14 +187,6 @@ require "aerospike/exp/exp_bit"
|
|
178
187
|
require "aerospike/exp/exp_hll"
|
179
188
|
require "aerospike/exp/operation"
|
180
189
|
|
181
|
-
require "aerospike/query/pred_exp/and_or"
|
182
|
-
require "aerospike/query/pred_exp/geo_json_value"
|
183
|
-
require "aerospike/query/pred_exp/integer_value"
|
184
|
-
require "aerospike/query/pred_exp/op"
|
185
|
-
require "aerospike/query/pred_exp/regex"
|
186
|
-
require "aerospike/query/pred_exp/regex_flags"
|
187
|
-
require "aerospike/query/pred_exp/string_value"
|
188
|
-
|
189
190
|
module Aerospike
|
190
191
|
extend Loggable
|
191
192
|
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:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Khosrow Afroozeh
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-08-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: msgpack
|
@@ -56,6 +56,13 @@ files:
|
|
56
56
|
- lib/aerospike.rb
|
57
57
|
- lib/aerospike/aerospike_exception.rb
|
58
58
|
- lib/aerospike/atomic/atomic.rb
|
59
|
+
- lib/aerospike/batch_attr.rb
|
60
|
+
- lib/aerospike/batch_delete.rb
|
61
|
+
- lib/aerospike/batch_read.rb
|
62
|
+
- lib/aerospike/batch_record.rb
|
63
|
+
- lib/aerospike/batch_results.rb
|
64
|
+
- lib/aerospike/batch_udf.rb
|
65
|
+
- lib/aerospike/batch_write.rb
|
59
66
|
- lib/aerospike/bin.rb
|
60
67
|
- lib/aerospike/cdt/bit_operation.rb
|
61
68
|
- lib/aerospike/cdt/bit_overflow_action.rb
|
@@ -87,13 +94,12 @@ files:
|
|
87
94
|
- lib/aerospike/cluster/partition_parser.rb
|
88
95
|
- lib/aerospike/cluster/rack_parser.rb
|
89
96
|
- lib/aerospike/command/admin_command.rb
|
90
|
-
- lib/aerospike/command/batch_direct_command.rb
|
91
|
-
- lib/aerospike/command/batch_direct_exists_command.rb
|
92
|
-
- lib/aerospike/command/batch_direct_node.rb
|
93
97
|
- lib/aerospike/command/batch_index_command.rb
|
94
98
|
- lib/aerospike/command/batch_index_exists_command.rb
|
95
99
|
- lib/aerospike/command/batch_index_node.rb
|
96
100
|
- lib/aerospike/command/batch_item.rb
|
101
|
+
- lib/aerospike/command/batch_operate_command.rb
|
102
|
+
- lib/aerospike/command/batch_operate_node.rb
|
97
103
|
- lib/aerospike/command/command.rb
|
98
104
|
- lib/aerospike/command/delete_command.rb
|
99
105
|
- lib/aerospike/command/execute_command.rb
|
@@ -148,7 +154,11 @@ files:
|
|
148
154
|
- lib/aerospike/peers/parse.rb
|
149
155
|
- lib/aerospike/policy/admin_policy.rb
|
150
156
|
- lib/aerospike/policy/auth_mode.rb
|
157
|
+
- lib/aerospike/policy/batch_delete_policy.rb
|
151
158
|
- lib/aerospike/policy/batch_policy.rb
|
159
|
+
- lib/aerospike/policy/batch_read_policy.rb
|
160
|
+
- lib/aerospike/policy/batch_udf_policy.rb
|
161
|
+
- lib/aerospike/policy/batch_write_policy.rb
|
152
162
|
- lib/aerospike/policy/client_policy.rb
|
153
163
|
- lib/aerospike/policy/commit_level.rb
|
154
164
|
- lib/aerospike/policy/consistency_level.rb
|
@@ -168,14 +178,6 @@ files:
|
|
168
178
|
- lib/aerospike/query/partition_filter.rb
|
169
179
|
- lib/aerospike/query/partition_status.rb
|
170
180
|
- lib/aerospike/query/partition_tracker.rb
|
171
|
-
- lib/aerospike/query/pred_exp.rb
|
172
|
-
- lib/aerospike/query/pred_exp/and_or.rb
|
173
|
-
- lib/aerospike/query/pred_exp/geo_json_value.rb
|
174
|
-
- lib/aerospike/query/pred_exp/integer_value.rb
|
175
|
-
- lib/aerospike/query/pred_exp/op.rb
|
176
|
-
- lib/aerospike/query/pred_exp/regex.rb
|
177
|
-
- lib/aerospike/query/pred_exp/regex_flags.rb
|
178
|
-
- lib/aerospike/query/pred_exp/string_value.rb
|
179
181
|
- lib/aerospike/query/query_command.rb
|
180
182
|
- lib/aerospike/query/query_executor.rb
|
181
183
|
- lib/aerospike/query/query_partition_command.rb
|
@@ -230,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
232
|
- !ruby/object:Gem::Version
|
231
233
|
version: '0'
|
232
234
|
requirements: []
|
233
|
-
rubygems_version: 3.
|
235
|
+
rubygems_version: 3.5.11
|
234
236
|
signing_key:
|
235
237
|
specification_version: 4
|
236
238
|
summary: An Aerospike driver for Ruby.
|