aerospike 3.0.0 → 4.0.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 +21 -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_return_type.rb +8 -0
- data/lib/aerospike/client.rb +37 -51
- data/lib/aerospike/cluster.rb +50 -46
- data/lib/aerospike/command/batch_index_command.rb +6 -10
- 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 +101 -87
- data/lib/aerospike/command/single_command.rb +1 -1
- data/lib/aerospike/exp/exp.rb +39 -41
- 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 -92
- data/lib/aerospike/exp/exp_map.rb +118 -121
- data/lib/aerospike/exp/operation.rb +2 -2
- data/lib/aerospike/info.rb +2 -4
- data/lib/aerospike/node.rb +7 -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/server_command.rb +1 -0
- data/lib/aerospike/query/statement.rb +5 -21
- 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
@@ -1,192 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Aerospike
|
4
|
-
class PredExp
|
5
|
-
AND = 1
|
6
|
-
OR = 2
|
7
|
-
NOT = 3
|
8
|
-
INTEGER_VALUE = 10
|
9
|
-
STRING_VALUE = 11
|
10
|
-
GEOJSON_VALUE = 12
|
11
|
-
INTEGER_BIN = 100
|
12
|
-
STRING_BIN = 101
|
13
|
-
GEOJSON_BIN = 102
|
14
|
-
LIST_BIN = 103
|
15
|
-
MAP_BIN = 104
|
16
|
-
INTEGER_VAR = 120
|
17
|
-
STRING_VAR = 121
|
18
|
-
GEOJSON_VAR = 122
|
19
|
-
RECSIZE = 150
|
20
|
-
LAST_UPDATE = 151
|
21
|
-
VOID_TIME = 152
|
22
|
-
INTEGER_EQUAL = 200
|
23
|
-
INTEGER_UNEQUAL = 201
|
24
|
-
INTEGER_GREATER = 202
|
25
|
-
INTEGER_GREATEREQ = 203
|
26
|
-
INTEGER_LESS = 204
|
27
|
-
INTEGER_LESSEQ = 205
|
28
|
-
STRING_EQUAL = 210
|
29
|
-
STRING_UNEQUAL = 211
|
30
|
-
STRING_REGEX = 212
|
31
|
-
GEOJSON_WITHIN = 220
|
32
|
-
GEOJSON_CONTAINS = 221
|
33
|
-
LIST_ITERATE_OR = 250
|
34
|
-
MAPKEY_ITERATE_OR = 251
|
35
|
-
MAPVAL_ITERATE_OR = 252
|
36
|
-
LIST_ITERATE_AND = 253
|
37
|
-
MAPKEY_ITERATE_AND = 254
|
38
|
-
MAPVAL_ITERATE_AND = 255
|
39
|
-
|
40
|
-
def self.and(nexp)
|
41
|
-
AndOr.new(AND, nexp)
|
42
|
-
end
|
43
|
-
|
44
|
-
def self.or(nexp)
|
45
|
-
AndOr.new(OR, nexp)
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.not
|
49
|
-
Op.new(NOT)
|
50
|
-
end
|
51
|
-
|
52
|
-
def self.integer_value(value)
|
53
|
-
IntegerValue.new(value, INTEGER_VALUE)
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.string_value(value)
|
57
|
-
StringValue.new(value, STRING_VALUE)
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.geojson_value(value)
|
61
|
-
raise(ArgumentError, "value must be a GeoJSON object!") unless value.is_a?(Aerospike::GeoJSON)
|
62
|
-
GeoJsonValue.new(value.to_s, GEOJSON_VALUE)
|
63
|
-
end
|
64
|
-
|
65
|
-
def self.integer_bin(name)
|
66
|
-
StringValue.new(name, INTEGER_BIN)
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.string_bin(name)
|
70
|
-
StringValue.new(name, STRING_BIN)
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.geojson_bin(name)
|
74
|
-
StringValue.new(name, GEOJSON_BIN)
|
75
|
-
end
|
76
|
-
|
77
|
-
def self.list_bin(name)
|
78
|
-
StringValue.new(name, LIST_BIN)
|
79
|
-
end
|
80
|
-
|
81
|
-
def self.map_bin(name)
|
82
|
-
StringValue.new(name, MAP_BIN)
|
83
|
-
end
|
84
|
-
|
85
|
-
def self.integer_var(name)
|
86
|
-
StringValue.new(name, INTEGER_VAR)
|
87
|
-
end
|
88
|
-
|
89
|
-
def self.string_var(name)
|
90
|
-
StringValue.new(name, STRING_VAR)
|
91
|
-
end
|
92
|
-
|
93
|
-
def self.geojson_var(name)
|
94
|
-
StringValue.new(name, GEOJSON_VAR)
|
95
|
-
end
|
96
|
-
|
97
|
-
def self.record_size
|
98
|
-
Op.new(RECSIZE)
|
99
|
-
end
|
100
|
-
|
101
|
-
def self.last_update
|
102
|
-
Op.new(LAST_UPDATE)
|
103
|
-
end
|
104
|
-
|
105
|
-
def self.void_time
|
106
|
-
Op.new(VOID_TIME)
|
107
|
-
end
|
108
|
-
|
109
|
-
def self.integer_equal
|
110
|
-
Op.new(INTEGER_EQUAL)
|
111
|
-
end
|
112
|
-
|
113
|
-
def self.integer_unequal
|
114
|
-
Op.new(INTEGER_UNEQUAL)
|
115
|
-
end
|
116
|
-
|
117
|
-
def self.integer_greater
|
118
|
-
Op.new(INTEGER_GREATER)
|
119
|
-
end
|
120
|
-
|
121
|
-
def self.integer_greater_eq
|
122
|
-
Op.new(INTEGER_GREATEREQ)
|
123
|
-
end
|
124
|
-
|
125
|
-
def self.integer_less
|
126
|
-
Op.new(INTEGER_LESS)
|
127
|
-
end
|
128
|
-
|
129
|
-
def self.integer_less_eq
|
130
|
-
Op.new(INTEGER_LESSEQ)
|
131
|
-
end
|
132
|
-
|
133
|
-
def self.string_equal
|
134
|
-
Op.new(STRING_EQUAL)
|
135
|
-
end
|
136
|
-
|
137
|
-
def self.string_unequal
|
138
|
-
Op.new(STRING_UNEQUAL)
|
139
|
-
end
|
140
|
-
|
141
|
-
def self.string_regex(flags)
|
142
|
-
Regex.new(STRING_REGEX, flags)
|
143
|
-
end
|
144
|
-
|
145
|
-
def self.geojson_within
|
146
|
-
Op.new(GEOJSON_WITHIN)
|
147
|
-
end
|
148
|
-
|
149
|
-
def self.geojson_contains
|
150
|
-
Op.new(GEOJSON_CONTAINS)
|
151
|
-
end
|
152
|
-
|
153
|
-
def self.list_iterate_or(var_name)
|
154
|
-
StringValue.new(var_name, LIST_ITERATE_OR)
|
155
|
-
end
|
156
|
-
|
157
|
-
def self.list_iterate_and(var_name)
|
158
|
-
StringValue.new(var_name, LIST_ITERATE_AND)
|
159
|
-
end
|
160
|
-
|
161
|
-
def self.mapkey_iterate_or(var_name)
|
162
|
-
StringValue.new(var_name, MAPKEY_ITERATE_OR)
|
163
|
-
end
|
164
|
-
|
165
|
-
def self.mapkey_iterate_and(var_name)
|
166
|
-
StringValue.new(var_name, MAPKEY_ITERATE_AND)
|
167
|
-
end
|
168
|
-
|
169
|
-
def self.mapval_iterate_or(var_name)
|
170
|
-
StringValue.new(var_name, MAPVAL_ITERATE_OR)
|
171
|
-
end
|
172
|
-
|
173
|
-
def self.mapval_iterate_and(var_name)
|
174
|
-
StringValue.new(var_name, MAPVAL_ITERATE_AND)
|
175
|
-
end
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
def self.estimate_size(predexp)
|
180
|
-
return 0 unless predexp
|
181
|
-
predexp.map(&:estimate_size).inject { |sum, size| sum + size }
|
182
|
-
end
|
183
|
-
|
184
|
-
def self.write(predexp, buffer, offset)
|
185
|
-
predexp.each do |p|
|
186
|
-
offset = p.write(buffer, offset)
|
187
|
-
end
|
188
|
-
|
189
|
-
offset
|
190
|
-
end
|
191
|
-
end
|
192
|
-
end
|