aerospike 2.29.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +13 -9
  4. data/lib/aerospike/batch_attr.rb +292 -0
  5. data/lib/aerospike/batch_delete.rb +48 -0
  6. data/lib/aerospike/batch_read.rb +97 -0
  7. data/lib/aerospike/batch_record.rb +83 -0
  8. data/lib/aerospike/batch_results.rb +38 -0
  9. data/lib/aerospike/batch_udf.rb +76 -0
  10. data/lib/aerospike/batch_write.rb +79 -0
  11. data/lib/aerospike/cdt/bit_operation.rb +4 -5
  12. data/lib/aerospike/cdt/map_operation.rb +24 -10
  13. data/lib/aerospike/cdt/map_policy.rb +6 -3
  14. data/lib/aerospike/cdt/map_return_type.rb +8 -0
  15. data/lib/aerospike/client.rb +39 -56
  16. data/lib/aerospike/cluster.rb +50 -46
  17. data/lib/aerospike/command/batch_index_command.rb +7 -11
  18. data/lib/aerospike/command/batch_index_node.rb +3 -4
  19. data/lib/aerospike/command/batch_operate_command.rb +151 -0
  20. data/lib/aerospike/command/batch_operate_node.rb +51 -0
  21. data/lib/aerospike/command/command.rb +231 -128
  22. data/lib/aerospike/exp/exp.rb +54 -27
  23. data/lib/aerospike/exp/exp_bit.rb +24 -24
  24. data/lib/aerospike/exp/exp_hll.rb +12 -12
  25. data/lib/aerospike/exp/exp_list.rb +101 -86
  26. data/lib/aerospike/exp/exp_map.rb +118 -110
  27. data/lib/aerospike/exp/operation.rb +2 -2
  28. data/lib/aerospike/info.rb +2 -4
  29. data/lib/aerospike/node.rb +20 -3
  30. data/lib/aerospike/operation.rb +38 -0
  31. data/lib/aerospike/policy/batch_delete_policy.rb +71 -0
  32. data/lib/aerospike/policy/batch_policy.rb +53 -4
  33. data/lib/aerospike/{command/batch_direct_node.rb → policy/batch_read_policy.rb} +17 -19
  34. data/lib/aerospike/policy/batch_udf_policy.rb +75 -0
  35. data/lib/aerospike/policy/batch_write_policy.rb +105 -0
  36. data/lib/aerospike/policy/policy.rb +3 -40
  37. data/lib/aerospike/query/query_command.rb +3 -205
  38. data/lib/aerospike/query/query_executor.rb +2 -2
  39. data/lib/aerospike/query/query_partition_command.rb +4 -230
  40. data/lib/aerospike/query/scan_executor.rb +2 -2
  41. data/lib/aerospike/query/scan_partition_command.rb +3 -3
  42. data/lib/aerospike/query/server_command.rb +2 -2
  43. data/lib/aerospike/query/statement.rb +5 -21
  44. data/lib/aerospike/task/execute_task.rb +2 -2
  45. data/lib/aerospike/utils/buffer.rb +15 -15
  46. data/lib/aerospike/version.rb +1 -1
  47. data/lib/aerospike.rb +13 -12
  48. metadata +16 -14
  49. data/lib/aerospike/command/batch_direct_command.rb +0 -105
  50. data/lib/aerospike/command/batch_direct_exists_command.rb +0 -51
  51. data/lib/aerospike/query/pred_exp/and_or.rb +0 -32
  52. data/lib/aerospike/query/pred_exp/geo_json_value.rb +0 -41
  53. data/lib/aerospike/query/pred_exp/integer_value.rb +0 -32
  54. data/lib/aerospike/query/pred_exp/op.rb +0 -27
  55. data/lib/aerospike/query/pred_exp/regex.rb +0 -32
  56. data/lib/aerospike/query/pred_exp/regex_flags.rb +0 -23
  57. data/lib/aerospike/query/pred_exp/string_value.rb +0 -29
  58. data/lib/aerospike/query/pred_exp.rb +0 -192
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Copyright 2014-2022 Aerospike, Inc.
2
+ # Copyright 2014-2023 Aerospike, Inc.
3
3
  #
4
4
  # Portions may be licensed to Aerospike, Inc. under one or more contributor
5
5
  # license agreements.
@@ -96,7 +96,7 @@ module Aerospike
96
96
  end
97
97
 
98
98
  # Create expression that returns if the primary key is stored in the record meta data
99
- # as a boolean expression. This would occur when {@link Policy#send_key}
99
+ # as a boolean expression. This would occur when {Policy#send_key}
100
100
  # is true on record write. This expression usually evaluates quickly because record
101
101
  # meta data is cached in memory.
102
102
  #
@@ -210,11 +210,11 @@ module Aerospike
210
210
  # # Bin "a" exists in record
211
211
  # Exp.bin_exists("a")
212
212
  def self.bin_exists(name)
213
- return Exp.ne(Exp.bin_type(name), Exp.int_val(0))
213
+ Exp.ne(Exp.bin_type(name), Exp.int_val(0))
214
214
  end
215
215
 
216
216
  # Create expression that returns bin's integer particle type::
217
- # See {@link ParticleType}.
217
+ # See {ParticleType}.
218
218
  #
219
219
  # ==== Examples
220
220
  # # Bin "a" particle type is a list
@@ -223,6 +223,20 @@ module Aerospike
223
223
  CmdStr.new(BIN_TYPE, name)
224
224
  end
225
225
 
226
+ # Create expression that returns the record size. This expression usually evaluates
227
+ # quickly because record meta data is cached in memory.
228
+ # Requires server version 7.0+. This expression replaces {#deviceSize()} and
229
+ # {#memorySize()} since those older expressions are equivalent on server version 7.0+.
230
+ #
231
+ # {@code
232
+ # // Record size >= 100 KB
233
+ # Exp.ge(Exp.record_size(), Exp.val(100 * 1024))
234
+ # }
235
+ def self.record_size
236
+ Cmd.new(RECORD_SIZE)
237
+ end
238
+
239
+
226
240
  #--------------------------------------------------
227
241
  # Misc
228
242
  #--------------------------------------------------
@@ -333,7 +347,7 @@ module Aerospike
333
347
  # Exp.regex_compare("prefix.*suffix", RegexFlags.ICASE | RegexFlags.NEWLINE, Exp.str_bin("a"))
334
348
  #
335
349
  # @param regex regular expression string
336
- # @param flags regular expression bit flags. See {@link Exp::RegexFlags}
350
+ # @param flags regular expression bit flags. See {Exp::RegexFlags}
337
351
  # @param bin string bin or string value expression
338
352
  def self.regex_compare(regex, flags, bin)
339
353
  Regex.new(bin, regex, flags)
@@ -410,6 +424,16 @@ module Aerospike
410
424
  Nil.new
411
425
  end
412
426
 
427
+ # Create Infinity value.
428
+ def self.infinity_val
429
+ Infinity.new
430
+ end
431
+
432
+ # Create Wildcard value.
433
+ def self.wildcard_val
434
+ Wildcard.new
435
+ end
436
+
413
437
  #--------------------------------------------------
414
438
  # Boolean Operator
415
439
  #--------------------------------------------------
@@ -859,7 +883,7 @@ module Aerospike
859
883
  #
860
884
  # ==== Examples
861
885
  # Args Format: <def1>, <def2>, ..., <exp>
862
- # def: {@link Exp#def(String, Exp)}
886
+ # def: {Exp#def(String, Exp)}
863
887
  # exp: Scoped expression
864
888
  #
865
889
  # ==== Examples
@@ -873,7 +897,7 @@ module Aerospike
873
897
  Let.new(exps)
874
898
  end
875
899
 
876
- # Assign variable to a {@link Exp#let(Exp...)} expression that can be accessed later.
900
+ # Assign variable to a {Exp#let(Exp...)} expression that can be accessed later.
877
901
  # Requires server version 5.6.0+.
878
902
  #
879
903
  # ==== Examples
@@ -906,8 +930,8 @@ module Aerospike
906
930
  #--------------------------------------------------
907
931
 
908
932
  # Create unknown value. Used to intentionally fail an expression.
909
- # The failure can be ignored with {@link Exp::WriteFlags#EVAL_NO_FAIL}
910
- # or {@link Exp::ReadFlags#EVAL_NO_FAIL}.
933
+ # The failure can be ignored with {Exp::WriteFlags#EVAL_NO_FAIL}
934
+ # or {Exp::ReadFlags#EVAL_NO_FAIL}.
911
935
  # Requires server version 5.6.0+.
912
936
  #
913
937
  # ==== Examples
@@ -1010,6 +1034,7 @@ module Aerospike
1010
1034
  KEY_EXISTS = 71
1011
1035
  IS_TOMBSTONE = 72
1012
1036
  MEMORY_SIZE = 73
1037
+ RECORD_SIZE = 74
1013
1038
  KEY = 80
1014
1039
  BIN = 81
1015
1040
  BIN_TYPE = 82
@@ -1051,10 +1076,7 @@ module Aerospike
1051
1076
 
1052
1077
  # For internal use only.
1053
1078
  class Module < Exp
1054
- attr_reader :bin
1055
- attr_reader :bytes
1056
- attr_reader :ret_type
1057
- attr_reader :module
1079
+ attr_reader :bin, :bytes, :ret_type, :module
1058
1080
 
1059
1081
  def initialize(bin, bytes, ret_type, modul)
1060
1082
  @bin = bin
@@ -1075,8 +1097,7 @@ module Aerospike
1075
1097
  end
1076
1098
 
1077
1099
  class Bin < Exp
1078
- attr_reader :name
1079
- attr_reader :type
1100
+ attr_reader :name, :type
1080
1101
 
1081
1102
  def initialize(name, type)
1082
1103
  @name = name
@@ -1092,9 +1113,7 @@ module Aerospike
1092
1113
  end
1093
1114
 
1094
1115
  class Regex < Exp
1095
- attr_reader :bin
1096
- attr_reader :regex
1097
- attr_reader :flags
1116
+ attr_reader :bin, :regex, :flags
1098
1117
 
1099
1118
  def initialize(bin, regex, flags)
1100
1119
  @bin = bin
@@ -1120,7 +1139,7 @@ module Aerospike
1120
1139
 
1121
1140
  def pack(packer)
1122
1141
  # Let wire format: LET <defname1>, <defexp1>, <defname2>, <defexp2>, ..., <scope exp>
1123
- count = (@exps.length - 1) * 2 + 2
1142
+ count = ((@exps.length - 1) * 2) + 2
1124
1143
  packer.write_array_header(count)
1125
1144
  packer.write(LET)
1126
1145
 
@@ -1131,8 +1150,7 @@ module Aerospike
1131
1150
  end
1132
1151
 
1133
1152
  class Def < Exp
1134
- attr_reader :name
1135
- attr_reader :exp
1153
+ attr_reader :name, :exp
1136
1154
 
1137
1155
  def initialize(name, exp)
1138
1156
  @name = name
@@ -1146,8 +1164,7 @@ module Aerospike
1146
1164
  end
1147
1165
 
1148
1166
  class CmdExp < Exp
1149
- attr_reader :exps
1150
- attr_reader :cmd
1167
+ attr_reader :exps, :cmd
1151
1168
 
1152
1169
  def initialize(cmd, *exps)
1153
1170
  @exps = exps
@@ -1164,8 +1181,7 @@ module Aerospike
1164
1181
  end
1165
1182
 
1166
1183
  class CmdInt < Exp
1167
- attr_reader :cmd
1168
- attr_reader :val
1184
+ attr_reader :cmd, :val
1169
1185
 
1170
1186
  def initialize(cmd, val)
1171
1187
  @cmd = cmd
@@ -1180,8 +1196,7 @@ module Aerospike
1180
1196
  end
1181
1197
 
1182
1198
  class CmdStr < Exp
1183
- attr_reader :str
1184
- attr_reader :cmd
1199
+ attr_reader :str, :cmd
1185
1200
 
1186
1201
  def initialize(cmd, str)
1187
1202
  @str = str
@@ -1314,6 +1329,18 @@ module Aerospike
1314
1329
  end
1315
1330
  end
1316
1331
 
1332
+ class Infinity < Exp
1333
+ def pack(packer)
1334
+ InfinityValue.new.pack(packer)
1335
+ end
1336
+ end
1337
+
1338
+ class Wildcard < Exp
1339
+ def pack(packer)
1340
+ WildcardValue.new.pack(packer)
1341
+ end
1342
+ end
1343
+
1317
1344
  class ExpBytes < Exp
1318
1345
  attr_reader :bytes
1319
1346
 
@@ -15,7 +15,7 @@
15
15
  # the License.
16
16
 
17
17
  module Aerospike
18
- # Bit expression generator. See {@link Exp}.
18
+ # Bit expression generator. See {Exp}.
19
19
  #
20
20
  # The bin expression argument in these methods can be a reference to a bin or the
21
21
  # result of another expression. Expressions that modify bin values are only used
@@ -42,7 +42,7 @@ module Aerospike
42
42
  # Exp.val(2))
43
43
  def self.resize(byte_size, resize_flags, bin, policy: CDT::BitPolicy::DEFAULT)
44
44
  bytes = Exp.pack(nil, RESIZE, byte_size, policy.flags, resize_flags)
45
- self.add_write(bin, bytes)
45
+ add_write(bin, bytes)
46
46
  end
47
47
 
48
48
  # Create expression that inserts value bytes into byte[] bin at byte_offset and returns byte[].
@@ -60,7 +60,7 @@ module Aerospike
60
60
  # Exp.val(2))
61
61
  def self.insert(byte_offset, value, bin, policy: CDT::BitPolicy::DEFAULT)
62
62
  bytes = Exp.pack(nil, INSERT, byte_offset, value, policy.flags)
63
- self.add_write(bin, bytes)
63
+ add_write(bin, bytes)
64
64
  end
65
65
 
66
66
  # Create expression that removes bytes from byte[] bin at byte_offset for byte_size and returns byte[].
@@ -78,7 +78,7 @@ module Aerospike
78
78
  # Exp.val(2))
79
79
  def self.remove(byte_offset, byte_size, bin, policy: CDT::BitPolicy::DEFAULT)
80
80
  bytes = Exp.pack(nil, REMOVE, byte_offset, byte_size, policy.flags)
81
- self.add_write(bin, bytes)
81
+ add_write(bin, bytes)
82
82
  end
83
83
 
84
84
  # Create expression that sets value on byte[] bin at bit_offset for bit_size and returns byte[].
@@ -97,7 +97,7 @@ module Aerospike
97
97
  # Exp.val(2))
98
98
  def self.set(bit_offset, bit_size, value, bin, policy: CDT::BitPolicy::DEFAULT)
99
99
  bytes = Exp.pack(nil, SET, bit_offset, bit_size, value, policy.flags)
100
- self.add_write(bin, bytes)
100
+ add_write(bin, bytes)
101
101
  end
102
102
 
103
103
  # Create expression that performs bitwise "or" on value and byte[] bin at bit_offset for bit_size
@@ -111,7 +111,7 @@ module Aerospike
111
111
  #
112
112
  def self.or(bit_offset, bit_size, value, bin, policy: CDT::BitPolicy::DEFAULT)
113
113
  bytes = Exp.pack(nil, OR, bit_offset, bit_size, value, policy.flags)
114
- self.add_write(bin, bytes)
114
+ add_write(bin, bytes)
115
115
  end
116
116
 
117
117
  # Create expression that performs bitwise "xor" on value and byte[] bin at bit_offset for bit_size
@@ -125,7 +125,7 @@ module Aerospike
125
125
  #
126
126
  def self.xor(bit_offset, bit_size, value, bin, policy: CDT::BitPolicy::DEFAULT)
127
127
  bytes = Exp.pack(nil, XOR, bit_offset, bit_size, value, policy.flags)
128
- self.add_write(bin, bytes)
128
+ add_write(bin, bytes)
129
129
  end
130
130
 
131
131
  # Create expression that performs bitwise "and" on value and byte[] bin at bit_offset for bit_size
@@ -139,7 +139,7 @@ module Aerospike
139
139
  #
140
140
  def self.and(bit_offset, bit_size, value, bin, policy: CDT::BitPolicy::DEFAULT)
141
141
  bytes = Exp.pack(nil, AND, bit_offset, bit_size, value, policy.flags)
142
- self.add_write(bin, bytes)
142
+ add_write(bin, bytes)
143
143
  end
144
144
 
145
145
  # Create expression that negates byte[] bin starting at bit_offset for bit_size and returns byte[].
@@ -151,7 +151,7 @@ module Aerospike
151
151
  #
152
152
  def self.not(bit_offset, bit_size, bin, policy: CDT::BitPolicy::DEFAULT)
153
153
  bytes = Exp.pack(nil, NOT, bit_offset, bit_size, policy.flags)
154
- self.add_write(bin, bytes)
154
+ add_write(bin, bytes)
155
155
  end
156
156
 
157
157
  # Create expression that shifts left byte[] bin starting at bit_offset for bit_size and returns byte[].
@@ -164,7 +164,7 @@ module Aerospike
164
164
  #
165
165
  def self.lshift(bit_offset, bit_size, shift, bin, policy: CDT::BitPolicy::DEFAULT)
166
166
  bytes = Exp.pack(nil, LSHIFT, bit_offset, bit_size, shift, policy.flags)
167
- self.add_write(bin, bytes)
167
+ add_write(bin, bytes)
168
168
  end
169
169
 
170
170
  # Create expression that shifts right byte[] bin starting at bit_offset for bit_size and returns byte[].
@@ -177,12 +177,12 @@ module Aerospike
177
177
  #
178
178
  def self.rshift(bit_offset, bit_size, shift, bin, policy: CDT::BitPolicy::DEFAULT)
179
179
  bytes = Exp.pack(nil, RSHIFT, bit_offset, bit_size, shift, policy.flags)
180
- self.add_write(bin, bytes)
180
+ add_write(bin, bytes)
181
181
  end
182
182
 
183
183
  # Create expression that adds value to byte[] bin starting at bit_offset for bit_size and returns byte[].
184
184
  # BitSize must be <= 64. Signed indicates if bits should be treated as a signed number.
185
- # If add overflows/underflows, {@link BitOverflowAction} is used.
185
+ # If add overflows/underflows, {BitOverflowAction} is used.
186
186
  #
187
187
  # bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]
188
188
  # bit_offset = 24
@@ -192,13 +192,13 @@ module Aerospike
192
192
  # bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b10000101]
193
193
  #
194
194
  def self.add(bit_offset, bit_size, value, signed, bit_overflow_action, bin, policy: CDT::BitPolicy::DEFAULT)
195
- bytes = self.pack_math(ADD, policy, bit_offset, bit_size, value, signed, bit_overflow_action)
196
- self.add_write(bin, bytes)
195
+ bytes = pack_math(ADD, policy, bit_offset, bit_size, value, signed, bit_overflow_action)
196
+ add_write(bin, bytes)
197
197
  end
198
198
 
199
199
  # Create expression that subtracts value from byte[] bin starting at bit_offset for bit_size and returns byte[].
200
200
  # BitSize must be <= 64. Signed indicates if bits should be treated as a signed number.
201
- # If add overflows/underflows, {@link BitOverflowAction} is used.
201
+ # If add overflows/underflows, {BitOverflowAction} is used.
202
202
  #
203
203
  # bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101]
204
204
  # bit_offset = 24
@@ -208,8 +208,8 @@ module Aerospike
208
208
  # bin result = [0b00000001, 0b01000010, 0b00000011, 0b0000011, 0b10000101]
209
209
  #
210
210
  def self.subtract(bit_offset, bit_size, value, signed, bit_overflow_action, bin, policy: CDT::BitPolicy::DEFAULT)
211
- bytes = self.pack_math(SUBTRACT, policy, bit_offset, bit_size, value, signed, bit_overflow_action)
212
- self.add_write(bin, bytes)
211
+ bytes = pack_math(SUBTRACT, policy, bit_offset, bit_size, value, signed, bit_overflow_action)
212
+ add_write(bin, bytes)
213
213
  end
214
214
 
215
215
  # Create expression that sets value to byte[] bin starting at bit_offset for bit_size and returns byte[].
@@ -223,7 +223,7 @@ module Aerospike
223
223
  #
224
224
  def self.set_int(bit_offset, bit_size, value, bin, policy: CDT::BitPolicy::DEFAULT)
225
225
  bytes = Exp.pack(nil, SET_INT, bit_offset, bit_size, value, policy.flags)
226
- self.add_write(bin, bytes)
226
+ add_write(bin, bytes)
227
227
  end
228
228
 
229
229
  # Create expression that returns bits from byte[] bin starting at bit_offset for bit_size.
@@ -240,7 +240,7 @@ module Aerospike
240
240
  # Exp.val(new byte[] {(byte)0b10000000}))
241
241
  def self.get(bit_offset, bit_size, bin)
242
242
  bytes = Exp.pack(nil, GET, bit_offset, bit_size)
243
- self.add_read(bin, bytes, Exp::Type::BLOB)
243
+ add_read(bin, bytes, Exp::Type::BLOB)
244
244
  end
245
245
 
246
246
  # Create expression that returns integer count of set bits from byte[] bin starting at
@@ -256,7 +256,7 @@ module Aerospike
256
256
  # Exp.le(BitExp.count(Exp.val(0), Exp.val(5), Exp.blobBin("a")), Exp.val(2))
257
257
  def self.count(bit_offset, bit_size, bin)
258
258
  bytes = Exp.pack(nil, COUNT, bit_offset, bit_size)
259
- self.add_read(bin, bytes, Exp::Type::INT)
259
+ add_read(bin, bytes, Exp::Type::INT)
260
260
  end
261
261
 
262
262
  # Create expression that returns integer bit offset of the first specified value bit in byte[] bin
@@ -278,7 +278,7 @@ module Aerospike
278
278
  # @param bin bin or blob value expression
279
279
  def self.lscan(bit_offset, bit_size, value, bin)
280
280
  bytes = Exp.pack(nil, LSCAN, bit_offset, bit_size, value)
281
- self.add_read(bin, bytes, Exp::Type::INT)
281
+ add_read(bin, bytes, Exp::Type::INT)
282
282
  end
283
283
 
284
284
  # Create expression that returns integer bit offset of the last specified value bit in byte[] bin
@@ -301,7 +301,7 @@ module Aerospike
301
301
  # @param bin bin or blob value expression
302
302
  def self.rscan(bit_offset, bit_size, value, bin)
303
303
  bytes = Exp.pack(nil, RSCAN, bit_offset, bit_size, value)
304
- self.add_read(bin, bytes, Exp::Type::INT)
304
+ add_read(bin, bytes, Exp::Type::INT)
305
305
  end
306
306
 
307
307
  # Create expression that returns integer from byte[] bin starting at bit_offset for bit_size.
@@ -317,8 +317,8 @@ module Aerospike
317
317
  # # getInt(a) == 16899
318
318
  # Exp.eq(BitExp.getInt(Exp.val(8), Exp.val(16), false, Exp.blobBin("a")), Exp.val(16899))
319
319
  def self.get_int(bit_offset, bit_size, signed, bin)
320
- bytes = self.pack_get_int(bit_offset, bit_size, signed)
321
- self.add_read(bin, bytes, Exp::Type::INT)
320
+ bytes = pack_get_int(bit_offset, bit_size, signed)
321
+ add_read(bin, bytes, Exp::Type::INT)
322
322
  end
323
323
 
324
324
  private
@@ -15,7 +15,7 @@
15
15
  # the License.
16
16
 
17
17
  module Aerospike
18
- # HyperLogLog (HLL) expression generator. See {@link Exp}.
18
+ # HyperLogLog (HLL) expression generator. See {Exp}.
19
19
  #
20
20
  # The bin expression argument in these methods can be a reference to a bin or the
21
21
  # result of another expression. Expressions that modify bin values are only used
@@ -25,14 +25,14 @@ module Aerospike
25
25
 
26
26
  # Create expression that creates a new HLL or resets an existing HLL with minhash bits.
27
27
  #
28
- # @param policy write policy, use {@link HLLPolicy#Default} for default
28
+ # @param policy write policy, use {HLLPolicy#Default} for default
29
29
  # @param index_bit_count number of index bits. Must be between 4 and 16 inclusive.
30
30
  # @param min_hash_bit_count number of min hash bits. Must be between 4 and 51 inclusive.
31
31
  # Also, index_bit_count + min_hash_bit_count must be <= 64. Optional.
32
32
  # @param bin HLL bin or value expression
33
33
  def self.init(index_bit_count, bin, min_hash_bit_count: Exp.int_val(-1), policy: CDT::HLLPolicy::DEFAULT)
34
34
  bytes = Exp.pack(nil, INIT, index_bit_count, min_hash_bit_count, policy.flags)
35
- self.add_write(bin, bytes)
35
+ add_write(bin, bytes)
36
36
  end
37
37
 
38
38
  # Create expression that adds values to a HLL set and returns HLL set. If HLL bin does not
@@ -45,7 +45,7 @@ module Aerospike
45
45
  # HLLExp.add(HLLPolicy.Default, Exp.val(list), Exp.val(10), Exp.val(20), Exp.hllBin("a"))),
46
46
  # Exp.val(7))
47
47
  #
48
- # @param policy write policy, use {@link HLLPolicy#Default} for default
48
+ # @param policy write policy, use {HLLPolicy#Default} for default
49
49
  # @param list list bin or value expression of values to be added
50
50
  # @param index_bit_count number of index bits expression. Must be between 4 and 16 inclusive.
51
51
  # @param min_hash_bit_count number of min hash bits expression. Must be between 4 and 51 inclusive.
@@ -53,7 +53,7 @@ module Aerospike
53
53
  # @param bin HLL bin or value expression
54
54
  def self.add(list, bin, policy: CDT::HLLPolicy::DEFAULT, index_bit_count: Exp.val(-1), min_hash_bit_count: Exp.val(-1))
55
55
  bytes = Exp.pack(nil, ADD, list, index_bit_count, min_hash_bit_count, policy.flags)
56
- self.add_write(bin, bytes)
56
+ add_write(bin, bytes)
57
57
  end
58
58
 
59
59
  # Create expression that returns estimated number of elements in the HLL bin.
@@ -63,7 +63,7 @@ module Aerospike
63
63
  # Exp.gt(HLLExp.getCount(Exp.hllBin("a")), Exp.val(7))
64
64
  def self.get_count(bin)
65
65
  bytes = Exp.pack(nil, COUNT)
66
- self.add_read(bin, bytes, Exp::Type::INT)
66
+ add_read(bin, bytes, Exp::Type::INT)
67
67
  end
68
68
 
69
69
  # Create expression that returns a HLL object that is the union of all specified HLL objects
@@ -77,7 +77,7 @@ module Aerospike
77
77
  # HLLExp.getUnion(Exp.val(list), Exp.hllBin("b"))
78
78
  def self.get_union(list, bin)
79
79
  bytes = Exp.pack(nil, UNION, list)
80
- self.add_read(bin, bytes, Exp::Type::HLL)
80
+ add_read(bin, bytes, Exp::Type::HLL)
81
81
  end
82
82
 
83
83
  # Create expression that returns estimated number of elements that would be contained by
@@ -91,7 +91,7 @@ module Aerospike
91
91
  # HLLExp.getUnionCount(Exp.val(list), Exp.hllBin("b"))
92
92
  def self.get_union_count(list, bin)
93
93
  bytes = Exp.pack(nil, UNION_COUNT, list)
94
- self.add_read(bin, bytes, Exp::Type::INT)
94
+ add_read(bin, bytes, Exp::Type::INT)
95
95
  end
96
96
 
97
97
  # Create expression that returns estimated number of elements that would be contained by
@@ -105,7 +105,7 @@ module Aerospike
105
105
  # HLLExp.getIntersectCount(Exp.val(list), Exp.hllBin("b"))
106
106
  def self.get_intersect_count(list, bin)
107
107
  bytes = Exp.pack(nil, INTERSECT_COUNT, list)
108
- self.add_read(bin, bytes, Exp::Type::INT)
108
+ add_read(bin, bytes, Exp::Type::INT)
109
109
  end
110
110
 
111
111
  # Create expression that returns estimated similarity of these HLL objects as a
@@ -116,7 +116,7 @@ module Aerospike
116
116
  # Exp.ge(HLLExp.getSimilarity(Exp.hllBin("a"), Exp.hllBin("b")), Exp.val(0.75))
117
117
  def self.get_similarity(list, bin)
118
118
  bytes = Exp.pack(nil, SIMILARITY, list)
119
- self.add_read(bin, bytes, Exp::Type::FLOAT)
119
+ add_read(bin, bytes, Exp::Type::FLOAT)
120
120
  end
121
121
 
122
122
  # Create expression that returns index_bit_count and min_hash_bit_count used to create HLL bin
@@ -130,7 +130,7 @@ module Aerospike
130
130
  # Exp.val(10))
131
131
  def self.describe(bin)
132
132
  bytes = Exp.pack(nil, DESCRIBE)
133
- self.add_read(bin, bytes, Exp::Type::LIST)
133
+ add_read(bin, bytes, Exp::Type::LIST)
134
134
  end
135
135
 
136
136
  # Create expression that returns one if HLL bin may contain all items in the list.
@@ -142,7 +142,7 @@ module Aerospike
142
142
  # Exp.eq(HLLExp.mayContain(Exp.val(list), Exp.hllBin("a")), Exp.val(1))
143
143
  def self.may_contain(list, bin)
144
144
  bytes = Exp.pack(nil, MAY_CONTAIN, list)
145
- self.add_read(bin, bytes, Exp::Type::INT)
145
+ add_read(bin, bytes, Exp::Type::INT)
146
146
  end
147
147
 
148
148
  private