All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
aerospike_llist.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2017 Aerospike, Inc.
3  *
4  * Portions may be licensed to Aerospike, Inc. under one or more contributor
5  * license agreements.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8  * use this file except in compliance with the License. You may obtain a copy of
9  * the License at http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 #pragma once
18 
19 /**
20  * Functionality related to Large List Data Type
21  */
22 
23 #include <aerospike/aerospike.h>
24 #include <aerospike/as_error.h>
25 #include <aerospike/as_ldt.h>
27 #include <aerospike/as_policy.h>
28 #include <aerospike/as_status.h>
29 #include <aerospike/as_key.h>
30 #include <aerospike/as_val.h>
31 #include <aerospike/as_boolean.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /******************************************************************************
38  * FUNCTIONS
39  *****************************************************************************/
40 
41 /**
42  * Add a value into the llist.
43  *
44  * ~~~~~~~~~~{.c}
45  * as_key key;
46  * as_key_init(&key, "myns", "myset", "mykey");
47  *
48  * as_ldt llist;
49  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
50  *
51  * as_integer ival;
52  * as_integer_init(&ival, 123);
53  *
54  * if ( aerospike_llist_add(&as, &err, NULL, &key, &llist, (as_val *) &ival) != AEROSPIKE_OK ) {
55  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
56  * }
57  * ~~~~~~~~~~
58  *
59  * @deprecated LDT functionality has been deprecated.
60  *
61  * @param as The aerospike instance to use for this operation.
62  * @param err The as_error to be populated if an error occurs.
63  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
64  * @param key The key of the record.
65  * @param ldt The ldt bin to insert values to.
66  * @param val The value to insert into the llist.
67  *
68  * @return AEROSPIKE_OK if successful. Otherwise an error.
69  *
70  * @ingroup ldt_operations
71  */
73  aerospike * as, as_error * err, const as_policy_apply * policy,
74  const as_key * key, const as_ldt * ldt, const as_val * val);
75 
76 /**
77  * Add / update a value into the llist. Existing value will be overwritten.
78  *
79  * ~~~~~~~~~~{.c}
80  * as_key key;
81  * as_key_init(&key, "myns", "myset", "mykey");
82  *
83  * as_ldt llist;
84  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
85  *
86  * as_integer ival;
87  * as_integer_init(&ival, 123);
88  *
89  * if ( aerospike_llist_update(&as, &err, NULL, &key, &llist, (as_val *) &ival) != AEROSPIKE_OK ) {
90  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
91  * }
92  * ~~~~~~~~~~
93  *
94  * @deprecated LDT functionality has been deprecated.
95  *
96  * @param as The aerospike instance to use for this operation.
97  * @param err The as_error to be populated if an error occurs.
98  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
99  * @param key The key of the record.
100  * @param ldt The ldt bin to insert values to.
101  * @param val The value to update/insert into the llist.
102  *
103  * @return AEROSPIKE_OK if successful. Otherwise an error.
104  *
105  * @ingroup ldt_operations
106  */
108  aerospike * as, as_error * err, const as_policy_apply * policy,
109  const as_key * key, const as_ldt * ldt, const as_val * val);
110 
111 
112 
113 /**
114  * Add a list of values into the llist.
115  *
116  * ~~~~~~~~~~{.c}
117  * as_key key;
118  * as_key_init(&key, "myns", "myset", "mykey");
119  *
120  * as_ldt llist;
121  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
122  *
123  *
124  * as_arraylist vals;
125  * as_arraylist_inita(&vals, 2);
126  * as_string s;
127  * as_string_init(s,"a string",false);
128  * as_arraylist_append_string(&vals, s);
129  * as_arraylist_append_int64(&vals, 35);
130  *
131  * if ( aerospike_llist_add_all(&as, &err, NULL, &key, &llist, (as_list *)vals) != AEROSPIKE_OK ) {
132  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
133  * }
134  *
135  * ~~~~~~~~~~
136  *
137  * @deprecated LDT functionality has been deprecated.
138  *
139  * @param as The aerospike instance to use for this operation.
140  * @param err The as_error to be populated if an error occurs.
141  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
142  * @param key The key of the record.
143  * @param ldt The ldt bin to insert values to.
144  * @param vals The list of values to insert into the llist.
145  *
146  * @return AEROSPIKE_OK if successful. Otherwise an error.
147  *
148  * @ingroup ldt_operations
149  */
151  aerospike * as, as_error * err, const as_policy_apply * policy,
152  const as_key * key, const as_ldt * ldt, const as_list * vals);
153 
154 /**
155  * Add / update a list of values into the llist.
156  * If the value in input list already exists it will be overwritten.
157  *
158  * ~~~~~~~~~~{.c}
159  * as_key key;
160  * as_key_init(&key, "myns", "myset", "mykey");
161  *
162  * as_ldt llist;
163  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
164  *
165  *
166  * as_arraylist vals;
167  * as_arraylist_inita(&vals, 2);
168  * as_string s;
169  * as_string_init(s,"a string",false);
170  * as_arraylist_append_string(&vals, s);
171  * as_arraylist_append_int64(&vals, 35);
172  *
173  * if ( aerospike_llist_update_all(&as, &err, NULL, &key, &llist, (as_list *)vals) != AEROSPIKE_OK ) {
174  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
175  * }
176  *
177  * ~~~~~~~~~~
178  *
179  * @deprecated LDT functionality has been deprecated.
180  *
181  * @param as The aerospike instance to use for this operation.
182  * @param err The as_error to be populated if an error occurs.
183  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
184  * @param key The key of the record.
185  * @param ldt The ldt bin to insert values to.
186  * @param vals The list of values to update/insert into the llist.
187  *
188  * @return AEROSPIKE_OK if successful. Otherwise an error.
189  *
190  * @ingroup ldt_operations
191  */
193  aerospike * as, as_error * err, const as_policy_apply * policy,
194  const as_key * key, const as_ldt * ldt, const as_list * vals);
195 
196 /**
197  * Search for a value in the llist.
198  *
199  * ~~~~~~~~~~{.c}
200  * as_key key;
201  * as_key_init(&key, "myns", "myset", "mykey");
202  *
203  * as_ldt llist;
204  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
205  *
206  * as_integer search_val;
207  * as_integer_init(&search_val, 42);
208  *
209  * as_list *result_list = NULL;
210  *
211  * if ( aerospike_llist_find(&as, &err, NULL, &key, &llist, &search_val, &result_list ) != AEROSPIKE_OK ) {
212  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
213  * }
214  * else {
215  * // do logic because element exists
216  * }
217  * ~~~~~~~~~~
218  *
219  * @deprecated LDT functionality has been deprecated.
220  *
221  * @param as The aerospike instance to use for this operation.
222  * @param err The as_error to be populated if an error occurs.
223  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
224  * @param key The key of the record.
225  * @param ldt The llist bin to lookup from. If not an llist bin, will return error.
226  * @param search_val The search value
227  * @param elements The returned list of values
228  *
229  * @return AEROSPIKE_OK if successful. Otherwise an error.
230  *
231  * @ingroup ldt_operations
232  */
234  aerospike * as, as_error * err, const as_policy_apply * policy,
235  const as_key * key, const as_ldt * ldt, const as_val * search_val,
236  as_list ** elements );
237 
238 /**
239  * Select values from the beginning of list up to a maximum count.
240  * Supported by server versions >= 3.5.8.
241  *
242  * ~~~~~~~~~~{.c}
243  * as_key key;
244  * as_key_init(&key, "myns", "myset", "mykey");
245  *
246  * as_ldt llist;
247  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
248  *
249  * as_list *result_list = NULL;
250  *
251  * if ( aerospike_llist_find_first(&as, &err, NULL, &key, &llist, 5, &result_list ) != AEROSPIKE_OK ) {
252  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
253  * }
254  * else {
255  * // process the returned elements
256  * as_arraylist_destroy(result_list);
257  * }
258  * ~~~~~~~~~~
259  *
260  * @deprecated LDT functionality has been deprecated.
261  *
262  * @param as The aerospike instance to use for this operation.
263  * @param err The as_error to be populated if an error occurs.
264  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
265  * @param key The key of the record.
266  * @param ldt The llist bin to lookup from. If not an llist bin, will return error.
267  * @param count Maximum number of values to return.
268  * @param elements The returned list of values.
269  *
270  * @return AEROSPIKE_OK if successful. Otherwise an error.
271  *
272  * @ingroup ldt_operations
273  */
275  aerospike * as, as_error * err, const as_policy_apply * policy,
276  const as_key * key, const as_ldt * ldt, uint32_t count, as_list ** elements);
277 
278 /**
279  * Select values from the beginning of list up to a maximum count after applying lua filter.
280  * Supported by server versions >= 3.5.8.
281  *
282  * ~~~~~~~~~~{.c}
283  * as_key key;
284  * as_key_init(&key, "myns", "myset", "mykey");
285  *
286  * as_ldt llist;
287  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
288  *
289  * as_list *result_list = NULL;
290  *
291  * if ( aerospike_llist_find_first_filter(&as, &err, NULL, &key, &llist, 5, "search_filter", NULL, &result_list ) != AEROSPIKE_OK ) {
292  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
293  * }
294  * else {
295  * // process the returned elements
296  * as_arraylist_destroy(result_list);
297  * }
298  * ~~~~~~~~~~
299  *
300  * @deprecated LDT functionality has been deprecated.
301  *
302  * @param as The aerospike instance to use for this operation.
303  * @param err The as_error to be populated if an error occurs.
304  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
305  * @param key The key of the record.
306  * @param ldt The llist bin to lookup from. If not an llist bin, will return error.
307  * @param count Maximum number of values to return.
308  * @param filter The name of the User-Defined-Function to use as a search filter.
309  * @param filter_args The list of parameters passed in to the User-Defined-Function filter.
310  * @param elements The returned list of values.
311  *
312  * @return AEROSPIKE_OK if successful. Otherwise an error.
313  *
314  * @ingroup ldt_operations
315  */
317  aerospike * as, as_error * err, const as_policy_apply * policy,
318  const as_key * key, const as_ldt * ldt, uint32_t count,
319  const as_udf_function_name filter, const as_list *filter_args, as_list ** elements);
320 
321 /**
322  * Select values from the end of list up to a maximum count.
323  * Supported by server versions >= 3.5.8.
324  *
325  * ~~~~~~~~~~{.c}
326  * as_key key;
327  * as_key_init(&key, "myns", "myset", "mykey");
328  *
329  * as_ldt llist;
330  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
331  *
332  * as_list *result_list = NULL;
333  *
334  * if ( aerospike_llist_find_last(&as, &err, NULL, &key, &llist, 5, &result_list ) != AEROSPIKE_OK ) {
335  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
336  * }
337  * else {
338  * // process the returned elements
339  * as_arraylist_destroy(result_list);
340  * }
341  * ~~~~~~~~~~
342  *
343  * @deprecated LDT functionality has been deprecated.
344  *
345  * @param as The aerospike instance to use for this operation.
346  * @param err The as_error to be populated if an error occurs.
347  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
348  * @param key The key of the record.
349  * @param ldt The llist bin to lookup from. If not an llist bin, will return error.
350  * @param count Maximum number of values to return.
351  * @param elements The returned list of values.
352  *
353  * @return AEROSPIKE_OK if successful. Otherwise an error.
354  *
355  * @ingroup ldt_operations
356  */
358  aerospike * as, as_error * err, const as_policy_apply * policy,
359  const as_key * key, const as_ldt * ldt, uint32_t count, as_list ** elements);
360 
361 /**
362  * Select values from the end of list up to a maximum count after applying lua filter.
363  * Supported by server versions >= 3.5.8.
364  *
365  * ~~~~~~~~~~{.c}
366  * as_key key;
367  * as_key_init(&key, "myns", "myset", "mykey");
368  *
369  * as_ldt llist;
370  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
371  *
372  * as_list *result_list = NULL;
373  *
374  * if ( aerospike_llist_find_last_filter(&as, &err, NULL, &key, &llist, 5, "search_filter", NULL, &result_list ) != AEROSPIKE_OK ) {
375  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
376  * }
377  * else {
378  * // process the returned elements
379  * as_arraylist_destroy(result_list);
380  * }
381  * ~~~~~~~~~~
382  *
383  * @deprecated LDT functionality has been deprecated.
384  *
385  * @param as The aerospike instance to use for this operation.
386  * @param err The as_error to be populated if an error occurs.
387  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
388  * @param key The key of the record.
389  * @param ldt The llist bin to lookup from. If not an llist bin, will return error.
390  * @param count Maximum number of values to return.
391  * @param filter The name of the User-Defined-Function to use as a search filter.
392  * @param filter_args The list of parameters passed in to the User-Defined-Function filter.
393  * @param elements The returned list of values.
394  *
395  * @return AEROSPIKE_OK if successful. Otherwise an error.
396  *
397  * @ingroup ldt_operations
398  */
400  aerospike * as, as_error * err, const as_policy_apply * policy,
401  const as_key * key, const as_ldt * ldt, uint32_t count,
402  const as_udf_function_name filter, const as_list *filter_args, as_list ** elements);
403 
404 /**
405  * Select values from the begin key up to a maximum count.
406  * Supported by server versions >= 3.5.8.
407  *
408  * ~~~~~~~~~~{.c}
409  * as_key key;
410  * as_key_init(&key, "myns", "myset", "mykey");
411  *
412  * as_ldt llist;
413  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
414  *
415  * as_integer from_val;
416  * as_integer_init(&from_val, 42);
417  *
418  * as_list *result_list = NULL;
419  *
420  * if ( aerospike_llist_find_from(&as, &err, NULL, &key, &llist, &from_val, 5, &result_list ) != AEROSPIKE_OK ) {
421  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
422  * }
423  * else {
424  * // process the returned elements
425  * as_arraylist_destroy(result_list);
426  * }
427  * ~~~~~~~~~~
428  *
429  * @deprecated LDT functionality has been deprecated.
430  *
431  * @param as The aerospike instance to use for this operation.
432  * @param err The as_error to be populated if an error occurs.
433  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
434  * @param key The key of the record.
435  * @param ldt The llist bin to lookup from. If not an llist bin, will return error.
436  * @param from_val Value from which to start.
437  * @param count Maximum number of values to return.
438  * @param elements The returned list of values.
439  *
440  * @return AEROSPIKE_OK if successful. Otherwise an error.
441  *
442  * @ingroup ldt_operations
443  */
445  aerospike * as, as_error * err, const as_policy_apply * policy, const as_key * key,
446  const as_ldt * ldt, const as_val * from_val, uint32_t count, as_list ** elements);
447 
448 /**
449  * Select values from the begin key up to a maximum count after applying lua filter.
450  * Supported by server versions >= 3.5.8.
451  *
452  * ~~~~~~~~~~{.c}
453  * as_key key;
454  * as_key_init(&key, "myns", "myset", "mykey");
455  *
456  * as_ldt llist;
457  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
458  *
459  * as_integer from_val;
460  * as_integer_init(&from_val, 42);
461  *
462  * as_list *result_list = NULL;
463  *
464  * if ( aerospike_llist_find_from_filter(&as, &err, NULL, &key, &llist, &from_val, 5, "search_filter", NULL, &result_list ) != AEROSPIKE_OK ) {
465  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
466  * }
467  * else {
468  * // process the returned elements
469  * as_arraylist_destroy(result_list);
470  * }
471  * ~~~~~~~~~~
472  *
473  * @deprecated LDT functionality has been deprecated.
474  *
475  * @param as The aerospike instance to use for this operation.
476  * @param err The as_error to be populated if an error occurs.
477  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
478  * @param key The key of the record.
479  * @param ldt The llist bin to lookup from. If not an llist bin, will return error.
480  * @param from_val Value from which to start.
481  * @param count Maximum number of values to return.
482  * @param filter The name of the User-Defined-Function to use as a search filter.
483  * @param filter_args The list of parameters passed in to the User-Defined-Function filter.
484  * @param elements The returned list of values.
485  *
486  * @return AEROSPIKE_OK if successful. Otherwise an error.
487  *
488  * @ingroup ldt_operations
489  */
491  aerospike * as, as_error * err, const as_policy_apply * policy, const as_key * key,
492  const as_ldt * ldt, const as_val * from_val, uint32_t count,
493  const as_udf_function_name filter, const as_list *filter_args, as_list ** elements);
494 
495 /**
496  * Given an llist bin, return all values in the list.
497  *
498  * ~~~~~~~~~~{.c}
499  * as_key key;
500  * as_key_init(&key, "myns", "myset", "mykey");
501  *
502  * as_ldt llist;
503  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
504  *
505  * as_list *result_list = NULL;
506  *
507  * if ( aerospike_llist_filter(&as, &err, NULL, &key, &llist,
508  * &result_list) != AEROSPIKE_OK ) {
509  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
510  * }
511  * else {
512  * // process the returned elements
513  * as_arraylist_destroy(result_list);
514  * }
515  * ~~~~~~~~~~
516  *
517  * @deprecated LDT functionality has been deprecated.
518  *
519  * @param as The aerospike instance to use for this operation.
520  * @param err The as_error to be populated if an error occurs.
521  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
522  * @param key The key of the record.
523  * @param ldt The llist bin to search from. If not an llist bin, will return error.
524  * @param elements The pointer to a list of elements returned from search function. Pointer should
525  * be NULL passed in.
526  *
527  * @return AEROSPIKE_OK if successful. Otherwise an error.
528  *
529  * @ingroup ldt_operations
530  */
532  aerospike * as, as_error * err, const as_policy_apply * policy,
533  const as_key * key, const as_ldt * ldt, as_list ** elements );
534 
535 /**
536  * Given an llist bin, filter the collection of objects using the given
537  * filter function. If no filter function is specified, return all values.
538  *
539  * ~~~~~~~~~~{.c}
540  * as_key key;
541  * as_key_init(&key, "myns", "myset", "mykey");
542  *
543  * as_ldt llist;
544  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
545  *
546  * as_list *result_list = NULL;
547  *
548  * if ( aerospike_llist_filter(&as, &err, NULL, &key, &llist,
549  * "search_filter", NULL, &result_list) != AEROSPIKE_OK ) {
550  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
551  * }
552  * else {
553  * // process the returned elements
554  * as_arraylist_destroy(result_list);
555  * }
556  * ~~~~~~~~~~
557  *
558  * @deprecated LDT functionality has been deprecated.
559  *
560  * @param as The aerospike instance to use for this operation.
561  * @param err The as_error to be populated if an error occurs.
562  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
563  * @param key The key of the record.
564  * @param ldt The llist bin to search from. If not an llist bin, will return error.
565  * @param filter The name of the User-Defined-Function to use as a search filter.
566  * @param filter_args The list of parameters passed in to the User-Defined-Function filter.
567  * @param elements The pointer to a list of elements returned from search function. Pointer should
568  * be NULL passed in.
569  *
570  * @return AEROSPIKE_OK if successful. Otherwise an error.
571  *
572  * @ingroup ldt_operations
573  */
575  aerospike * as, as_error * err, const as_policy_apply * policy,
576  const as_key * key, const as_ldt * ldt,
577  const as_udf_function_name filter, const as_list *filter_args,
578  as_list ** elements );
579 
580 /**
581  * Given an llist bin, return the key values from MIN to MAX, and then
582  * filter the returned collection of objects using the given
583  * filter function. If no filter function is specified, return all values.
584  * Limit returned values size to given count. If count is zero, do not
585  * limit returned values. Count > 0 are supported by server versions >= 3.5.8.
586  *
587  * ~~~~~~~~~~{.c}
588  * as_key key;
589  * as_key_init(&key, "myns", "myset", "mykey");
590  *
591  * as_ldt llist;
592  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
593  *
594  * as_integer min_value;
595  * as_integer_init(&min_value, 18);
596  *
597  * as_integer max_value;
598  * as_integer_init(&max_value, 99);
599  *
600  * as_list *result_list = NULL;
601  *
602  * if ( aerospike_llist_range_limit(&as, &err, NULL, &key, &llist, &min_value, &max_value, 20,
603  * "search_filter", NULL, &result_list) != AEROSPIKE_OK ) {
604  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
605  * }
606  * else {
607  * // process the returned elements
608  * as_arraylist_destroy(result_list);
609  * }
610  * ~~~~~~~~~~
611  *
612  * @deprecated LDT functionality has been deprecated.
613  *
614  * @param as The aerospike instance to use for this operation.
615  * @param err The as_error to be populated if an error occurs.
616  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
617  * @param key The key of the record.
618  * @param ldt The llist bin to search from. If not an llist bin, will return error.
619  * @param min_value The minimum range value (or null to be LEAST value)
620  * @param max_value The maximum range value (or null to be the GREATEST value)
621  * @param count The maximum number of values to return, pass in zero to obtain all values within range.
622  * @param filter The name of the User-Defined-Function to use as a search filter (or null if no filter)
623  * @param filter_args The list of parameters passed in to the User-Defined-Function filter (or null)
624  * @param elements The pointer to a list of elements returned from search function. Pointer should
625  * be NULL passed in.
626  *
627  * @return AEROSPIKE_OK if successful. Otherwise an error.
628  *
629  * @ingroup ldt_operations
630  */
632  aerospike * as, as_error * err, const as_policy_apply * policy,
633  const as_key * key, const as_ldt * ldt,
634  const as_val * min_value, const as_val * max_value, uint32_t count,
635  const as_udf_function_name filter, const as_list *filter_args,
636  as_list ** elements );
637 
638 /**
639  * Given an llist bin, return the key values from MIN to MAX, and then
640  * filter the returned collection of objects using the given
641  * filter function. If no filter function is specified, return all values.
642  *
643  * ~~~~~~~~~~{.c}
644  * as_key key;
645  * as_key_init(&key, "myns", "myset", "mykey");
646  *
647  * as_ldt llist;
648  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
649  *
650  * as_integer min_value;
651  * as_integer_init(&min_value, 18);
652  *
653  * as_integer max_value;
654  * as_integer_init(&max_value, 99);
655  *
656  * as_list *result_list = NULL;
657  *
658  * if ( aerospike_llist_range(&as, &err, NULL, &key, &llist, &min_value, &max_value,
659  * "search_filter", NULL, &result_list) != AEROSPIKE_OK ) {
660  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
661  * }
662  * else {
663  * // process the returned elements
664  * as_arraylist_destroy(result_list);
665  * }
666  * ~~~~~~~~~~
667  *
668  * @deprecated LDT functionality has been deprecated.
669  *
670  * @param as The aerospike instance to use for this operation.
671  * @param err The as_error to be populated if an error occurs.
672  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
673  * @param key The key of the record.
674  * @param ldt The llist bin to search from. If not an llist bin, will return error.
675  * @param min_value The minimum range value (or null to be LEAST value)
676  * @param max_value The maximum range value (or null to be the GREATEST value)
677  * @param filter The name of the User-Defined-Function to use as a search filter (or null if no filter)
678  * @param filter_args The list of parameters passed in to the User-Defined-Function filter (or null)
679  * @param elements The pointer to a list of elements returned from search function. Pointer should
680  * be NULL passed in.
681  *
682  * @return AEROSPIKE_OK if successful. Otherwise an error.
683  *
684  * @ingroup ldt_operations
685  */
687  aerospike * as, as_error * err, const as_policy_apply * policy,
688  const as_key * key, const as_ldt * ldt,
689  const as_val * min_value, const as_val * max_value,
690  const as_udf_function_name filter, const as_list *filter_args,
691  as_list ** elements )
692 {
693  return aerospike_llist_range_limit(as, err, policy, key, ldt, min_value, max_value, 0, filter, filter_args, elements);
694 }
695 
696 /**
697  * Look up a llist and find how many elements it contains
698  *
699  * ~~~~~~~~~~{.c}
700  * as_key key;
701  * as_key_init(&key, "myns", "myset", "mykey");
702  *
703  * as_ldt llist;
704  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
705  * uint32_t llist_size = 0;
706  *
707  * if ( aerospike_llist_size(&as, &err, NULL, &key, &llist, &llist_size) != AEROSPIKE_OK ) {
708  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
709  * }
710  * ~~~~~~~~~~
711  *
712  * @deprecated LDT functionality has been deprecated.
713  *
714  * @param as The aerospike instance to use for this operation.
715  * @param err The as_error to be populated if an error occurs.
716  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
717  * @param key The key of the record.
718  * @param ldt The llist to operate on. If not an llist bin, will return error.
719  * @param n Return the number of elements in the llist.
720  *
721  * @return AEROSPIKE_OK if successful. Otherwise an error.
722  *
723  * @ingroup ldt_operations
724  */
726  aerospike * as, as_error * err, const as_policy_apply * policy,
727  const as_key * key, const as_ldt * ldt,
728  uint32_t *n
729  );
730 
731 /**
732  * Delete the given value from the llist
733  *
734  * ~~~~~~~~~~{.c}
735  * as_key key;
736  * as_key_init(&key, "myns", "myset", "mykey");
737  *
738  * as_ldt llist;
739  * as_ldt_init(&llist, "llist", AS_LDT_LLIST, NULL);
740  *
741  * as_integer ival;
742  * as_integer_init(&ival, 123);
743  *
744  * if ( aerospike_llist_remove(&as, &err, NULL, &key, &llist, &ival) != AEROSPIKE_OK ) {
745  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
746  * }
747  * ~~~~~~~~~~
748  *
749  * @deprecated LDT functionality has been deprecated.
750  *
751  * @param as The aerospike instance to use for this operation.
752  * @param err The as_error to be populated if an error occurs.
753  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
754  * @param key The key of the record.
755  * @param ldt The llist bin to delete from. If not an llist bin, will return error.
756  * @param element The value to delete from the set.
757  *
758  * @return AEROSPIKE_OK if successful. Otherwise an error.
759  *
760  * @ingroup ldt_operations
761  */
763  aerospike * as, as_error * err, const as_policy_apply * policy,
764  const as_key * key, const as_ldt * ldt, const as_val *element
765  );
766 
767 /**
768  * Destroy the llist bin
769  *
770  * ~~~~~~~~~~{.c}
771  * as_key key;
772  * as_key_init(&key, "myns", "myset", "mykey");
773  *
774  * as_ldt llist;
775  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
776  *
777  * if ( aerospike_llist_destroy(&as, &err, NULL, &key, &llist) != AEROSPIKE_OK ) {
778  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
779  * }
780  * ~~~~~~~~~~
781  *
782  * @deprecated LDT functionality has been deprecated.
783  *
784  * @param as The aerospike instance to use for this operation.
785  * @param err The as_error to be populated if an error occurs.
786  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
787  * @param key The key of the record.
788  * @param ldt The llist bin to destroy. If not an llist bin, will return error.
789  *
790  * @return AEROSPIKE_OK if successful. Otherwise an error.
791  *
792  * @ingroup ldt_operations
793  */
795  aerospike * as, as_error * err, const as_policy_apply * policy,
796  const as_key * key, const as_ldt * ldt
797  );
798 
799 /**
800  * SET the storage capacity for this LDT.
801  *
802  * ~~~~~~~~~~{.c}
803  * as_key key;
804  * as_key_init(&key, "myns", "myset", "mykey");
805  *
806  * as_ldt llist;
807  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
808  * uint32_t ldt_capacity = 5000;
809  *
810  * if ( aerospike_llist_set_capacity(&as, &err, NULL, &key, &llist, ldt_capacity) != AEROSPIKE_OK ) {
811  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
812  * }
813  * ~~~~~~~~~~
814  *
815  * @deprecated LDT functionality has been deprecated.
816  *
817  * @param as The aerospike instance to use for this operation.
818  * @param err The as_error to be populated if an error occurs.
819  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
820  * @param key The key of the record.
821  * @param ldt The LDT to operate on. If not an LLIST bin, will return error.
822  * @param ldt_capacity Set by function to 1 for true, 0 for false
823  *
824  * @return AEROSPIKE_OK if successful. Otherwise an error.
825  *
826  * @ingroup ldt_operations
827  */
829  aerospike * as, as_error * err, const as_policy_apply * policy,
830  const as_key * key, const as_ldt * ldt,
831  uint32_t ldt_capacity
832  );
833 
834 /**
835  * Check the storage capacity for this LDT.
836  *
837  * ~~~~~~~~~~{.c}
838  * as_key key;
839  * as_key_init(&key, "myns", "myset", "mykey");
840  *
841  * as_ldt llist;
842  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
843  * uint32_t ldt_capacity = 0;
844  *
845  * if ( aerospike_llist_get_capacity(&as, &err, NULL, &key, &llist, &ldt_capacity) != AEROSPIKE_OK ) {
846  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
847  * }
848  * ~~~~~~~~~~
849  *
850  * @deprecated LDT functionality has been deprecated.
851  *
852  * @param as The aerospike instance to use for this operation.
853  * @param err The as_error to be populated if an error occurs.
854  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
855  * @param key The key of the record.
856  * @param ldt The LDT to operate on. If not an LLIST bin, will return error.
857  * @param ldt_capacity Set by function to 1 for true, 0 for false
858  *
859  * @return AEROSPIKE_OK if successful. Otherwise an error.
860  *
861  * @ingroup ldt_operations
862  */
864  aerospike * as, as_error * err, const as_policy_apply * policy,
865  const as_key * key, const as_ldt * ldt,
866  uint32_t *ldt_capacity
867  );
868 
869 /**
870  * Check to see if an LLIST object exists in this record bin.
871  *
872  * ~~~~~~~~~~{.c}
873  * as_key key;
874  * as_key_init(&key, "myns", "myset", "mykey");
875  *
876  * as_ldt llist;
877  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
878  * uint32_t ldt_exists = 0;
879  *
880  * if ( aerospike_llist_size(&as, &err, NULL, &key, &llist, &ldt_exists) != AEROSPIKE_OK ) {
881  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
882  * }
883  * ~~~~~~~~~~
884  *
885  * @deprecated LDT functionality has been deprecated.
886  *
887  * @param as The aerospike instance to use for this operation.
888  * @param err The as_error to be populated if an error occurs.
889  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
890  * @param key The key of the record.
891  * @param ldt The LDT to operate on. If not an LLIST bin, will return error.
892  * @param ldt_exists Ptr to as_boolean: Set to TRUE if ldt exists, otherwise false.
893  *
894  * @return AEROSPIKE_OK if successful. Otherwise an error.
895  *
896  * @ingroup ldt_operations
897  */
899  aerospike * as, as_error * err, const as_policy_apply * policy,
900  const as_key * key, const as_ldt * ldt,
901  as_boolean *ldt_exists
902  );
903 
904 /**
905  * Set page size for LLIST bin.
906  * Supported by server versions >= 3.5.8.
907  *
908  * ~~~~~~~~~~{.c}
909  * as_key key;
910  * as_key_init(&key, "myns", "myset", "mykey");
911  *
912  * as_ldt llist;
913  * as_ldt_init(&llist, "myllist", AS_LDT_LLIST, NULL);
914  *
915  * if ( aerospike_llist_set_page_size(&as, &err, NULL, &key, &llist, 8192) != AEROSPIKE_OK ) {
916  * fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
917  * }
918  * ~~~~~~~~~~
919  *
920  * @deprecated LDT functionality has been deprecated.
921  *
922  * @param as The aerospike instance to use for this operation.
923  * @param err The as_error to be populated if an error occurs.
924  * @param policy The policy to use for this operation. If NULL, then the default policy will be used.
925  * @param key The key of the record.
926  * @param ldt The LDT to operate on. If not an LLIST bin, will return error.
927  * @param page_size The new llist page size.
928  *
929  * @return AEROSPIKE_OK if successful. Otherwise an error.
930  *
931  * @ingroup ldt_operations
932  */
934  aerospike * as, as_error * err, const as_policy_apply * policy,
935  const as_key * key, const as_ldt * ldt, uint32_t page_size);
936 
937 #ifdef __cplusplus
938 } // end extern "C"
939 #endif