From 507baed12616850b2ef4f917d748ee0d7ba42b7a Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Wed, 23 Aug 2023 13:50:11 -0700 Subject: [PATCH 01/35] CLIENT-2467 Add castring, keystring and certstring fields to as_config_tls. These fields allow certificates to be loaded from a string instead of a file (cafile, keyfile and certfile). --- src/include/aerospike/as_config.h | 61 +++++++++++- src/main/aerospike/as_config.c | 12 +++ src/main/aerospike/as_tls.c | 151 +++++++++++++++++++++++++++++- 3 files changed, 221 insertions(+), 3 deletions(-) diff --git a/src/include/aerospike/as_config.h b/src/include/aerospike/as_config.h index 428dc351c..c643b58a1 100644 --- a/src/include/aerospike/as_config.h +++ b/src/include/aerospike/as_config.h @@ -213,9 +213,17 @@ typedef struct as_config_tls_s { * Path to a trusted CA certificate file. * By default TLS will use system standard trusted CA certificates. * Use as_config_tls_set_cafile() to set this field. + * If cafile is populated, castring is ignored. */ char* cafile; + /** + * String containing trusted CA certificate(s). + * Use as_config_tls_set_castring() to set this field. + * If cafile is populated, castring is ignored. + */ + char* castring; + /** * Path to a directory of trusted certificates. * See the OpenSSL SSL_CTX_load_verify_locations manual page for @@ -272,8 +280,8 @@ typedef struct as_config_tls_s { /** * Path to the client's key for mutual authentication. * By default mutual authentication is disabled. - * * Use as_config_tls_set_keyfile() to set this field. + * If keyfile is populated, keystring is ignored. */ char* keyfile; @@ -285,14 +293,30 @@ typedef struct as_config_tls_s { */ char* keyfile_pw; + /** + * Client's key string for mutual authentication. + * By default mutual authentication is disabled. + * Use as_config_tls_set_keystring() to set this field. + * If keyfile is populated, keystring is ignored. + */ + char* keystring; + /** * Path to the client's certificate chain file for mutual authentication. * By default mutual authentication is disabled. - * * Use as_config_tls_set_certfile() to set this field. + * If certfile is populated, certstring is ignored. */ char* certfile; + /** + * Client's certificate chain file string for mutual authentication. + * By default mutual authentication is disabled. + * Use as_config_tls_set_certstring() to set this field. + * If certfile is populated, certstring is ignored. + */ + char* certstring; + /** * Enable CRL checking for the certificate chain leaf certificate. * An error occurs if a suitable CRL cannot be found. @@ -892,6 +916,17 @@ as_config_tls_set_cafile(as_config* config, const char* cafile) as_config_set_string(&config->tls.cafile, cafile); } +/** + * Set string containing trusted CA certificate(s). + * + * @relates as_config + */ +static inline void +as_config_tls_set_castring(as_config* config, const char* castring) +{ + as_config_set_string(&config->tls.castring, castring); +} + /** * Set TLS path to a directory of trusted certificates. * @@ -958,6 +993,17 @@ as_config_tls_set_keyfile_pw(as_config* config, const char* pw) as_config_set_string(&config->tls.keyfile_pw, pw); } +/** + * Set client's key string for mutual authentication. + * + * @relates as_config + */ +static inline void +as_config_tls_set_keystring(as_config* config, const char* keystring) +{ + as_config_set_string(&config->tls.keystring, keystring); +} + /** * Set TLS path to the client's certificate chain file for mutual authentication. * @@ -969,6 +1015,17 @@ as_config_tls_set_certfile(as_config* config, const char* certfile) as_config_set_string(&config->tls.certfile, certfile); } +/** + * Set client's certificate chain file string for mutual authentication. + * + * @relates as_config + */ +static inline void +as_config_tls_set_certstring(as_config* config, const char* certstring) +{ + as_config_set_string(&config->tls.certstring, certstring); +} + /** * Add TLS host to seed the cluster. * The host address and TLS name will be copied. diff --git a/src/main/aerospike/as_config.c b/src/main/aerospike/as_config.c index a4117d830..c8431f365 100644 --- a/src/main/aerospike/as_config.c +++ b/src/main/aerospike/as_config.c @@ -100,6 +100,10 @@ as_config_destroy(as_config* config) { cf_free(tls->cafile); } + if (tls->castring) { + cf_free(tls->castring); + } + if (tls->capath) { cf_free(tls->capath); } @@ -124,9 +128,17 @@ as_config_destroy(as_config* config) { cf_free(tls->keyfile_pw); } + if (tls->keystring) { + cf_free(tls->keystring); + } + if (tls->certfile) { cf_free(tls->certfile); } + + if (tls->certstring) { + cf_free(tls->certstring); + } } bool diff --git a/src/main/aerospike/as_tls.c b/src/main/aerospike/as_tls.c index 537886d9f..69bcce9ac 100644 --- a/src/main/aerospike/as_tls.c +++ b/src/main/aerospike/as_tls.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -418,6 +418,137 @@ password_cb(char* buf, int size, int rwflag, void* udata) return pw_len; } +static bool +as_tls_load_ca_str(SSL_CTX* ctx, char* cert_str) +{ + BIO* cert_bio = BIO_new_mem_buf(cert_str, -1); + + if (cert_bio == NULL) { + return false; + } + + X509* cert; + int count = 0; + + while ((cert = PEM_read_bio_X509(cert_bio, NULL, 0, NULL)) != NULL) { + X509_STORE* store = SSL_CTX_get_cert_store(ctx); + int rv = X509_STORE_add_cert(store, cert); + + if (rv == 1) { + count++; + } + else { + as_log_warn("Failed to add TLS certificate from string"); + } + + X509_free(cert); + } + + // Above loop always ends with an error - clear it so it doesn't affect + // subsequent SSL calls in this thread. + ERR_clear_error(); + BIO_vfree(cert_bio); + + if (count == 0) { + return false; + } + return true; +} + +static bool +as_tls_load_cert_chain_str(SSL_CTX* ctx, char* cert_str) +{ + BIO* cert_bio = BIO_new_mem_buf(cert_str, -1); + + if (cert_bio == NULL) { + return false; + } + + STACK_OF(X509_INFO)* inf = PEM_X509_INFO_read_bio(cert_bio, NULL, NULL, NULL); + + if (!inf) { + BIO_free(cert_bio); + return false; + } + + /* Iterate over contents of the PEM buffer, and add certs. */ + bool first = true; + + for (int i = 0; i < sk_X509_INFO_num(inf); i++) { + X509_INFO* itmp = sk_X509_INFO_value(inf, i); + + if (itmp->x509) { + /* First cert is server cert. Remaining, if any, are intermediate certs. */ + if (first) { + first = false; + + /* + * Set server certificate. Note that this operation increments the + * reference count, which means that it is okay for cleanup to free it. + */ + if (!SSL_CTX_use_certificate(ctx, itmp->x509)) { + goto Error; + } + + if (ERR_peek_error() != 0) { + goto Error; + } + + /* Get ready to store intermediate certs, if any. */ + SSL_CTX_clear_chain_certs(ctx); + } + else + { + /* Add intermediate cert to chain. */ + if (!SSL_CTX_add0_chain_cert(ctx, itmp->x509)) { + goto Error; + } + + /* + * Above function doesn't increment cert reference count. NULL the info + * reference to it in order to prevent it from being freed during cleanup. + */ + itmp->x509 = NULL; + } + } + } + + sk_X509_INFO_pop_free(inf, X509_INFO_free); + BIO_free(cert_bio); + return true; + +Error: + sk_X509_INFO_pop_free(inf, X509_INFO_free); + BIO_free(cert_bio); + return false; +} + +static bool +as_tls_load_key_str(SSL_CTX* ctx, char* key_str, const char* key_pw) +{ + BIO* key_bio = BIO_new_mem_buf(key_str, -1); + + if (key_bio == NULL) { + return false; + } + + EVP_PKEY* pkey = PEM_read_bio_PrivateKey(key_bio, NULL, password_cb, (void*)key_pw); + + BIO_vfree(key_bio); + + if (pkey == NULL) { + if (ERR_GET_REASON(ERR_peek_error()) == EVP_R_BAD_DECRYPT) { + as_log_warn("Invalid password for key string"); + } + return false; + } + + int rv = SSL_CTX_use_PrivateKey(ctx, pkey); + + EVP_PKEY_free(pkey); + return rv == 1; +} + as_status as_tls_context_setup(as_config_tls* tlscfg, as_tls_context* ctx, as_error* errp) { @@ -524,6 +655,12 @@ as_tls_context_setup(as_config_tls* tlscfg, as_tls_context* ctx, as_error* errp) "Unknown failure loading CAFile"); } } + else if (tlscfg->castring) { + if (! as_tls_load_ca_str(ctx->ssl_ctx, tlscfg->castring)) { + return as_error_set_message(errp, AEROSPIKE_ERR_TLS_ERROR, + "Failed to add any TLS certificates from castring"); + } + } if (tlscfg->certfile) { int rv = SSL_CTX_use_certificate_chain_file(ctx->ssl_ctx, tlscfg->certfile); @@ -548,6 +685,12 @@ as_tls_context_setup(as_config_tls* tlscfg, as_tls_context* ctx, as_error* errp) } } } + else if (tlscfg->certstring) { + if (! as_tls_load_cert_chain_str(ctx->ssl_ctx, tlscfg->certstring)) { + return as_error_set_message(errp, AEROSPIKE_ERR_TLS_ERROR, + "Failed to add any TLS certificate chains from certstrings"); + } + } if (tlscfg->keyfile) { bool ok = false; @@ -602,6 +745,12 @@ as_tls_context_setup(as_config_tls* tlscfg, as_tls_context* ctx, as_error* errp) return AEROSPIKE_ERR_TLS_ERROR; } } + else if (tlscfg->keystring) { + if (! as_tls_load_key_str(ctx->ssl_ctx, tlscfg->keystring, tlscfg->keyfile_pw)) { + return as_error_set_message(errp, AEROSPIKE_ERR_TLS_ERROR, + "Failed to load private key from keystring"); + } + } if (tlscfg->cipher_suite) { int rv = SSL_CTX_set_cipher_list(ctx->ssl_ctx, tlscfg->cipher_suite); From 6d4a8647a32c6c7062fb0085afd31419485ef7ef Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Wed, 23 Aug 2023 15:24:08 -0700 Subject: [PATCH 02/35] CLIENT-2528 On scan/query where max_retries is reached and there are no stored errors, throw exception with AEROSPIKE_ERR_CLUSTER (ie some partition(s) are unavailable) because that is the only retryable error that does not result in stored errors. --- src/main/aerospike/as_partition_tracker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/aerospike/as_partition_tracker.c b/src/main/aerospike/as_partition_tracker.c index 2fb47da40..2b3d00640 100644 --- a/src/main/aerospike/as_partition_tracker.c +++ b/src/main/aerospike/as_partition_tracker.c @@ -477,8 +477,9 @@ as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, // Check if limits have been reached. if (pt->iteration > pt->max_retries) { if (!pt->errors || pt->errors->size <= 0) { - return as_error_set_message(err, AEROSPIKE_ERR_MAX_RETRIES_EXCEEDED, - "Max retries exceeded"); + // The only retryable errors that are not added to the errors list is + // AEROSPIKE_ERR_CLUSTER (ie some partition(s) are unavailable). + return as_error_set_message(err, AEROSPIKE_ERR_CLUSTER, "Partition(s) unavailable"); } // Return last sub-error code received. From 18dd46e1cd63696c1884a6b4b98766d68a5388b3 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Thu, 24 Aug 2023 11:33:57 -0700 Subject: [PATCH 03/35] CLIENT-2440 Document valid map key types (as_string, as_integer, as_bytes, as_list). --- src/include/aerospike/as_map_operations.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/include/aerospike/as_map_operations.h b/src/include/aerospike/as_map_operations.h index 52e8a236b..e4528ed04 100644 --- a/src/include/aerospike/as_map_operations.h +++ b/src/include/aerospike/as_map_operations.h @@ -21,7 +21,13 @@ * @ingroup client_operations * * Unique key map bin operations. Create map operations used by the client operate command. - * The default unique key map is unordered. + * The default unique key map is unordered. Valid map key types are: + *
    + *
  • as_string
  • + *
  • as_integer
  • + *
  • as_bytes
  • + *
  • as_list
  • + *
* * All maps maintain an index and a rank. The index is the item offset from the start of the map, * for both unordered and ordered maps. The rank is the sorted index of the value component. From 657e0ac437e05ed4a195c7962908abdefb980f1e Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Thu, 24 Aug 2023 15:29:06 -0700 Subject: [PATCH 04/35] CLIENT-2485 Add rtype argument to as_exp_map_remove_by and as_exp_list_remove_by macros. Valid rtype for as_exp_map_remove_by macros are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. Valid rtype for as_exp_list_remove_by macros are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. --- src/include/aerospike/as_exp.h | 135 +++++++++++++++----------- src/test/aerospike_list/list_basics.c | 24 ++--- src/test/aerospike_map/map_basics.c | 32 +++--- 3 files changed, 109 insertions(+), 82 deletions(-) diff --git a/src/include/aerospike/as_exp.h b/src/include/aerospike/as_exp.h index fa8365678..2ecd46123 100644 --- a/src/include/aerospike/as_exp.h +++ b/src/include/aerospike/as_exp.h @@ -1745,14 +1745,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list items identified by value. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __val Value expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_value(__ctx, __val, __bin) \ +#define as_exp_list_remove_by_value(__ctx, __rtype, __val, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_ALL_BY_VALUE, 2, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __val, \ __bin @@ -1760,14 +1761,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list items identified by values. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __values Values list expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_value_list(__ctx, __values, __bin) \ +#define as_exp_list_remove_by_value_list(__ctx, __rtype, __values, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_LIST, 2, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __values, \ __bin @@ -1777,15 +1779,16 @@ as_exp_destroy_base64(char* base64) * If end is infinity, the range is greater than equal to begin. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __begin Begin value expression. * @param __end End value expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_value_range(__ctx, __begin, __end, __bin) \ +#define as_exp_list_remove_by_value_range(__ctx, __rtype, __begin, __end, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_INTERVAL, 3, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __begin, __end, \ __bin @@ -1793,15 +1796,16 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list items nearest to value and greater by relative rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __val Value expression. * @param __rank Rank integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_rel_rank_range_to_end(__ctx, __val, __rank, __bin) \ +#define as_exp_list_remove_by_rel_rank_range_to_end(__ctx, __rtype, __val, __rank, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __val, __rank, \ __bin @@ -1810,6 +1814,7 @@ as_exp_destroy_base64(char* base64) * count limit. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __val Value expression. * @param __rank Rank integer expression. * @param __count Count integer expression. @@ -1817,9 +1822,9 @@ as_exp_destroy_base64(char* base64) * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_rel_rank_range(__ctx, __val, __rank, __count, __bin) \ +#define as_exp_list_remove_by_rel_rank_range(__ctx, __rtype, __val, __rank, __count, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __val, __rank, __count, \ __bin @@ -1827,14 +1832,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list item identified by index. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __idx Index integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_index(__ctx, __idx, __bin) \ +#define as_exp_list_remove_by_index(__ctx, __rtype, __idx, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_INDEX, 2, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __idx, \ __bin @@ -1842,14 +1848,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list items starting at specified index to the end of list. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __idx Index integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_index_range_to_end(__ctx, __idx, __bin) \ +#define as_exp_list_remove_by_index_range_to_end(__ctx, __rtype, __idx, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_INDEX_RANGE, 2, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __idx, \ __bin @@ -1857,15 +1864,16 @@ as_exp_destroy_base64(char* base64) * Create expression that removes "count" list items starting at specified index. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __idx Index integer expression. * @param __count Count integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_index_range(__ctx, __idx, __count, __bin) \ +#define as_exp_list_remove_by_index_range(__ctx, __rtype, __idx, __count, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_INDEX_RANGE, 3, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __idx, __count, \ __bin @@ -1873,14 +1881,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list item identified by rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_rank(__ctx, __rank, __bin) \ +#define as_exp_list_remove_by_rank(__ctx, __rtype, __rank, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_RANK, 2, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __rank, \ __bin @@ -1888,14 +1897,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list items starting at specified rank to the last ranked item. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_rank_range_to_end(__ctx, __rank, __bin) \ +#define as_exp_list_remove_by_rank_range_to_end(__ctx, __rtype, __rank, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_RANK_RANGE, 2, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __rank, \ __bin @@ -1903,15 +1913,16 @@ as_exp_destroy_base64(char* base64) * Create expression that removes "count" list items starting at specified rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __count Count integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_rank_range(__ctx, __rank, __count, __bin) \ +#define as_exp_list_remove_by_rank_range(__ctx, __rtype, __rank, __count, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_RANK_RANGE, 3, 0), \ - as_exp_int(AS_LIST_RETURN_NONE), \ + as_exp_int(__rtype), \ __rank, __count, \ __bin @@ -2225,14 +2236,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map item identified by key. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __key Key expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_key(__ctx, __key, __bin) \ +#define as_exp_map_remove_by_key(__ctx, __rtype, __key, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __key, \ __bin @@ -2240,14 +2252,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items identified by keys. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __keys List expression of keys to remove. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_key_list(__ctx, __keys, __bin) \ +#define as_exp_map_remove_by_key_list(__ctx, __rtype, __keys, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_LIST, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __keys, \ __bin @@ -2257,15 +2270,16 @@ as_exp_destroy_base64(char* base64) * If end is infinity, the range is greater than equal to begin. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __begin Begin value expression. * @param __end End value expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_key_range(__ctx, __begin, __end, __bin) \ +#define as_exp_map_remove_by_key_range(__ctx, __rtype, __begin, __end, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_INTERVAL, 3, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __begin, __end, \ __bin @@ -2273,15 +2287,16 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items nearest to key and greater by index. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __key Key expression. * @param __idx Index integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_key_rel_index_range_to_end(__ctx, __key, __idx, __bin) \ +#define as_exp_map_remove_by_key_rel_index_range_to_end(__ctx, __rtype, __key, __idx, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_REL_INDEX_RANGE, 3, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __key, __idx, \ __bin @@ -2289,6 +2304,7 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items nearest to key and greater by index with a count limit. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __key Key expression. * @param __idx Index integer expression. * @param __count Count integer expression. @@ -2296,9 +2312,9 @@ as_exp_destroy_base64(char* base64) * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_key_rel_index_range(__ctx, __key, __idx, __count, __bin) \ +#define as_exp_map_remove_by_key_rel_index_range(__ctx, __rtype, __key, __idx, __count, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_REL_INDEX_RANGE, 4, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __key, __idx, __count, \ __bin @@ -2306,14 +2322,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items identified by value. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __val Value expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_value(__ctx, __val, __bin) \ +#define as_exp_map_remove_by_value(__ctx, __rtype, __val, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_ALL_BY_VALUE, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __val, \ __bin @@ -2321,14 +2338,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items identified by values. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __values Values list expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_value_list(__ctx, __values, __bin) \ +#define as_exp_map_remove_by_value_list(__ctx, __rtype, __values, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_LIST, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __values, \ __bin @@ -2338,15 +2356,16 @@ as_exp_destroy_base64(char* base64) * If end is infinity, the range is greater than equal to begin. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __begin Begin value expression. * @param __end End value expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_value_range(__ctx, __begin, __end, __bin) \ +#define as_exp_map_remove_by_value_range(__ctx, __rtype, __begin, __end, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_INTERVAL, 3, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __begin, __end, \ __bin @@ -2354,15 +2373,16 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items nearest to value and greater by relative rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __val Value expression. * @param __rank Rank integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_value_rel_rank_range_to_end(__ctx, __val, __rank, __bin) \ +#define as_exp_map_remove_by_value_rel_rank_range_to_end(__ctx, __rtype, __val, __rank, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __val, __rank, \ __bin @@ -2371,6 +2391,7 @@ as_exp_destroy_base64(char* base64) * count limit. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __val Value expression. * @param __rank Rank integer expression. * @param __count Count integer expression. @@ -2378,9 +2399,9 @@ as_exp_destroy_base64(char* base64) * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_value_rel_rank_range(__ctx, __val, __rank, __count, __bin) \ +#define as_exp_map_remove_by_value_rel_rank_range(__ctx, __rtype, __val, __rank, __count, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __val, __rank, __count, \ __bin @@ -2388,14 +2409,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map item identified by index. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __idx Index integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_index(__ctx, __idx, __bin) \ +#define as_exp_map_remove_by_index(__ctx, __rtype, __idx, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_INDEX, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __idx, \ __bin @@ -2403,14 +2425,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items starting at specified index to the end of map. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __idx Index integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_index_range_to_end(__ctx, __idx, __bin) \ +#define as_exp_map_remove_by_index_range_to_end(__ctx, __rtype, __idx, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_INDEX_RANGE, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __idx, \ __bin @@ -2418,15 +2441,16 @@ as_exp_destroy_base64(char* base64) * Create expression that removes "count" map items starting at specified index. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __idx Index integer expression. * @param __count Count integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_index_range(__ctx, __idx, __count, __bin) \ +#define as_exp_map_remove_by_index_range(__ctx, __rtype, __idx, __count, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_INDEX_RANGE, 3, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __idx, __count, \ __bin @@ -2434,14 +2458,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map item identified by rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_rank(__ctx, __rank, __bin) \ +#define as_exp_map_remove_by_rank(__ctx, __rtype, __rank, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_RANK, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __rank, \ __bin @@ -2449,14 +2474,15 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map items starting at specified rank to the last ranked item. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_rank_range_to_end(__ctx, __rank, __bin) \ +#define as_exp_map_remove_by_rank_range_to_end(__ctx, __rtype, __rank, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_RANK_RANGE, 2, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __rank, \ __bin @@ -2464,15 +2490,16 @@ as_exp_destroy_base64(char* base64) * Create expression that removes "count" map items starting at specified rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). + * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __count Count integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_rank_range(__ctx, __rank, __count, __bin) \ +#define as_exp_map_remove_by_rank_range(__ctx, __rtype, __rank, __count, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_RANK_RANGE, 3, 0), \ - as_exp_int(AS_MAP_RETURN_NONE), \ + as_exp_int(__rtype), \ __rank, __count, \ __bin diff --git a/src/test/aerospike_list/list_basics.c b/src/test/aerospike_list/list_basics.c index fc42265e1..704dad482 100644 --- a/src/test/aerospike_list/list_basics.c +++ b/src/test/aerospike_list/list_basics.c @@ -2618,11 +2618,11 @@ TEST(list_exp_mod, "List Modify Expressions") as_exp_val(&expected)), as_exp_cmp_eq( as_exp_list_size(NULL, - as_exp_list_remove_by_value(NULL, as_exp_int(5), as_exp_bin_list(BIN_NAME))), + as_exp_list_remove_by_value(NULL, AS_LIST_RETURN_NONE, as_exp_int(5), as_exp_bin_list(BIN_NAME))), as_exp_int(5)), as_exp_cmp_eq( as_exp_list_size(NULL, - as_exp_list_remove_by_value_list(NULL, as_exp_val(&expected), as_exp_bin_list(BIN_NAME))), + as_exp_list_remove_by_value_list(NULL, AS_LIST_RETURN_NONE, as_exp_val(&expected), as_exp_bin_list(BIN_NAME))), as_exp_int(4)))); as_arraylist_destroy(&expected); @@ -2640,17 +2640,17 @@ TEST(list_exp_mod, "List Modify Expressions") as_exp_not(as_exp_or( as_exp_cmp_gt( as_exp_list_size(NULL, - as_exp_list_remove_by_value_range(NULL, as_exp_int(3), as_exp_int(6), + as_exp_list_remove_by_value_range(NULL, AS_LIST_RETURN_NONE, as_exp_int(3), as_exp_int(6), as_exp_bin_list(BIN_NAME))), as_exp_int(4)), as_exp_cmp_gt( as_exp_list_size(NULL, - as_exp_list_remove_by_rel_rank_range_to_end(NULL, as_exp_int(9), as_exp_int(0), + as_exp_list_remove_by_rel_rank_range_to_end(NULL, AS_LIST_RETURN_NONE, as_exp_int(9), as_exp_int(0), as_exp_bin_list(BIN_NAME))), as_exp_int(2)), as_exp_cmp_gt( as_exp_list_size(NULL, - as_exp_list_remove_by_rel_rank_range(NULL, as_exp_int(9), as_exp_int(0), as_exp_int(3), + as_exp_list_remove_by_rel_rank_range(NULL, AS_LIST_RETURN_NONE, as_exp_int(9), as_exp_int(0), as_exp_int(3), as_exp_bin_list(BIN_NAME))), as_exp_int(3))))); assert_not_null(filter6); @@ -2675,25 +2675,25 @@ TEST(list_exp_mod, "List Modify Expressions") as_exp_and( as_exp_cmp_eq( as_exp_list_size(NULL, - as_exp_list_remove_by_index(NULL, as_exp_int(3), + as_exp_list_remove_by_index(NULL, AS_LIST_RETURN_NONE, as_exp_int(3), as_exp_bin_list(BIN_NAME))), as_exp_int(5)), as_exp_cmp_eq( as_exp_list_get_by_index(NULL, AS_LIST_RETURN_VALUE, AS_EXP_TYPE_INT, as_exp_int(-1), - as_exp_list_remove_by_rank(NULL, as_exp_int(0), + as_exp_list_remove_by_rank(NULL, AS_LIST_RETURN_NONE, as_exp_int(0), as_exp_bin_list(BIN_NAME))), as_exp_int(5)), as_exp_cmp_eq( - as_exp_list_remove_by_rank_range_to_end(NULL, as_exp_int(3), + as_exp_list_remove_by_rank_range_to_end(NULL, AS_LIST_RETURN_NONE, as_exp_int(3), as_exp_bin_list(BIN_NAME)), as_exp_val(&expected)), as_exp_cmp_eq( - as_exp_list_remove_by_rank_range(NULL, as_exp_int(-3), as_exp_int(3), + as_exp_list_remove_by_rank_range(NULL, AS_LIST_RETURN_NONE, as_exp_int(-3), as_exp_int(3), as_exp_bin_list(BIN_NAME)), as_exp_val(&expected)), as_exp_cmp_eq( as_exp_list_size(NULL, - as_exp_list_remove_by_index_range_to_end(NULL, as_exp_int(1), + as_exp_list_remove_by_index_range_to_end(NULL, AS_LIST_RETURN_NONE, as_exp_int(1), as_exp_bin_list(BIN_NAME))), as_exp_int(1)), as_exp_cmp_eq( @@ -2701,7 +2701,7 @@ TEST(list_exp_mod, "List Modify Expressions") as_exp_bin_list(BIN_NAME)), as_exp_val(&empty)), as_exp_cmp_eq( - as_exp_list_remove_by_index_range(NULL, as_exp_int(0), as_exp_int(3), + as_exp_list_remove_by_index_range(NULL, AS_LIST_RETURN_NONE, as_exp_int(0), as_exp_int(3), as_exp_bin_list(BIN_NAME)), as_exp_val(&expected)))); @@ -2884,7 +2884,7 @@ TEST(list_exp_infinity, "test as_exp_inf()") as_record_destroy(&rec); // Remove values >= 30 - as_exp_build(read_exp, as_exp_list_remove_by_value_range(NULL, as_exp_int(30), as_exp_inf(), as_exp_bin_list(BIN_NAME))); + as_exp_build(read_exp, as_exp_list_remove_by_value_range(NULL, AS_LIST_RETURN_NONE, as_exp_int(30), as_exp_inf(), as_exp_bin_list(BIN_NAME))); assert_not_null(read_exp); as_operations ops; diff --git a/src/test/aerospike_map/map_basics.c b/src/test/aerospike_map/map_basics.c index 2db34080e..1cb246b88 100644 --- a/src/test/aerospike_map/map_basics.c +++ b/src/test/aerospike_map/map_basics.c @@ -2598,10 +2598,10 @@ TEST(map_exp_mod, "Map Modify Expression") as_exp_int(0)), as_exp_cmp_eq( as_exp_map_size(NULL, - as_exp_map_remove_by_value(NULL, as_exp_int(700), - as_exp_map_remove_by_key_range(NULL, as_exp_int(40), as_exp_int(51), - as_exp_map_remove_by_key_list(NULL, as_exp_val(&rem), - as_exp_map_remove_by_key(NULL, as_exp_int(0), + as_exp_map_remove_by_value(NULL, AS_MAP_RETURN_NONE, as_exp_int(700), + as_exp_map_remove_by_key_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(40), as_exp_int(51), + as_exp_map_remove_by_key_list(NULL, AS_MAP_RETURN_NONE, as_exp_val(&rem), + as_exp_map_remove_by_key(NULL, AS_MAP_RETURN_NONE, as_exp_int(0), as_exp_bin_map(BIN_NAME)))))), as_exp_int(4)))); @@ -2625,34 +2625,34 @@ TEST(map_exp_mod, "Map Modify Expression") as_exp_and( as_exp_cmp_eq( as_exp_map_size(NULL, - as_exp_map_remove_by_key_rel_index_range_to_end(NULL, as_exp_int(50), as_exp_int(1), + as_exp_map_remove_by_key_rel_index_range_to_end(NULL, AS_MAP_RETURN_NONE, as_exp_int(50), as_exp_int(1), as_exp_bin_map(BIN_NAME))), as_exp_int(6)), as_exp_cmp_eq( as_exp_map_size(NULL, - as_exp_map_remove_by_key_rel_index_range(NULL, as_exp_int(50), as_exp_int(1), as_exp_int(2), + as_exp_map_remove_by_key_rel_index_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(50), as_exp_int(1), as_exp_int(2), as_exp_bin_map(BIN_NAME))), as_exp_int(8)), as_exp_cmp_eq( as_exp_map_get_by_rank(NULL, AS_MAP_RETURN_VALUE, AS_EXP_TYPE_INT, as_exp_int(-1), - as_exp_map_remove_by_value_list(NULL, as_exp_val(&rem), - as_exp_map_remove_by_value_range(NULL, as_exp_int(400), as_exp_int(701), - as_exp_map_remove_by_value_rel_rank_range_to_end(NULL, as_exp_int(700), as_exp_int(1), + as_exp_map_remove_by_value_list(NULL, AS_MAP_RETURN_NONE, as_exp_val(&rem), + as_exp_map_remove_by_value_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(400), as_exp_int(701), + as_exp_map_remove_by_value_rel_rank_range_to_end(NULL, AS_MAP_RETURN_NONE, as_exp_int(700), as_exp_int(1), as_exp_bin_map(BIN_NAME))))), as_exp_int(300)), as_exp_cmp_eq( as_exp_map_size(NULL, - as_exp_map_remove_by_index_range(NULL, as_exp_int(0), as_exp_int(1), - as_exp_map_remove_by_index(NULL, as_exp_int(0), - as_exp_map_remove_by_value_rel_rank_range(NULL, as_exp_int(500), as_exp_int(2), as_exp_int(4), + as_exp_map_remove_by_index_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(0), as_exp_int(1), + as_exp_map_remove_by_index(NULL, AS_MAP_RETURN_NONE, as_exp_int(0), + as_exp_map_remove_by_value_rel_rank_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(500), as_exp_int(2), as_exp_int(4), as_exp_bin_map(BIN_NAME))))), as_exp_int(5)), as_exp_cmp_eq( as_exp_map_size(NULL, - as_exp_map_remove_by_rank_range(NULL, as_exp_int(1), as_exp_int(2), - as_exp_map_remove_by_rank(NULL, as_exp_int(-1), - as_exp_map_remove_by_rank_range_to_end(NULL, as_exp_int(-2), - as_exp_map_remove_by_index_range_to_end(NULL, as_exp_int(7), + as_exp_map_remove_by_rank_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(1), as_exp_int(2), + as_exp_map_remove_by_rank(NULL, AS_MAP_RETURN_NONE, as_exp_int(-1), + as_exp_map_remove_by_rank_range_to_end(NULL, AS_MAP_RETURN_NONE, as_exp_int(-2), + as_exp_map_remove_by_index_range_to_end(NULL, AS_MAP_RETURN_NONE, as_exp_int(7), as_exp_bin_map(BIN_NAME)))))), as_exp_int(2)))); From aa582c15a3171bdf327e36e83cf5622876d4db51 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Thu, 31 Aug 2023 15:35:32 -0700 Subject: [PATCH 05/35] CLIENT-2485 Remove rtype argument from the following macros since INVERTED is not applicable to them. as_exp_map_remove_by_key as_exp_map_remove_by_index as_exp_map_remove_by_rank as_exp_list_remove_by_index as_exp_list_remove_by_rank Also, add inverted map expression test: map_inverted_exp --- src/include/aerospike/as_exp.h | 25 ++++------ src/test/aerospike_list/list_basics.c | 4 +- src/test/aerospike_map/map_basics.c | 67 +++++++++++++++++++++++++-- 3 files changed, 76 insertions(+), 20 deletions(-) diff --git a/src/include/aerospike/as_exp.h b/src/include/aerospike/as_exp.h index 2ecd46123..39aab7088 100644 --- a/src/include/aerospike/as_exp.h +++ b/src/include/aerospike/as_exp.h @@ -1832,15 +1832,14 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list item identified by index. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). - * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __idx Index integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_index(__ctx, __rtype, __idx, __bin) \ +#define as_exp_list_remove_by_index(__ctx, __idx, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_INDEX, 2, 0), \ - as_exp_int(__rtype), \ + as_exp_int(AS_LIST_RETURN_NONE), \ __idx, \ __bin @@ -1881,15 +1880,14 @@ as_exp_destroy_base64(char* base64) * Create expression that removes list item identified by rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). - * @param __rtype Return type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __bin List bin or list value expression. * @return (list expression) * @ingroup expression */ -#define as_exp_list_remove_by_rank(__ctx, __rtype, __rank, __bin) \ +#define as_exp_list_remove_by_rank(__ctx, __rank, __bin) \ _AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_RANK, 2, 0), \ - as_exp_int(__rtype), \ + as_exp_int(AS_LIST_RETURN_NONE), \ __rank, \ __bin @@ -2236,15 +2234,14 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map item identified by key. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). - * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __key Key expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_key(__ctx, __rtype, __key, __bin) \ +#define as_exp_map_remove_by_key(__ctx, __key, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY, 2, 0), \ - as_exp_int(__rtype), \ + as_exp_int(AS_MAP_RETURN_NONE), \ __key, \ __bin @@ -2409,15 +2406,14 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map item identified by index. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). - * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __idx Index integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_index(__ctx, __rtype, __idx, __bin) \ +#define as_exp_map_remove_by_index(__ctx, __idx, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_INDEX, 2, 0), \ - as_exp_int(__rtype), \ + as_exp_int(AS_MAP_RETURN_NONE), \ __idx, \ __bin @@ -2458,15 +2454,14 @@ as_exp_destroy_base64(char* base64) * Create expression that removes map item identified by rank. * * @param __ctx Optional context path for nested CDT (as_cdt_ctx). - * @param __rtype Return type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED. * @param __rank Rank integer expression. * @param __bin Map bin or map value expression. * @return (map expression) * @ingroup expression */ -#define as_exp_map_remove_by_rank(__ctx, __rtype, __rank, __bin) \ +#define as_exp_map_remove_by_rank(__ctx, __rank, __bin) \ _AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_RANK, 2, 0), \ - as_exp_int(__rtype), \ + as_exp_int(AS_MAP_RETURN_NONE), \ __rank, \ __bin diff --git a/src/test/aerospike_list/list_basics.c b/src/test/aerospike_list/list_basics.c index 704dad482..e15e8bf56 100644 --- a/src/test/aerospike_list/list_basics.c +++ b/src/test/aerospike_list/list_basics.c @@ -2675,12 +2675,12 @@ TEST(list_exp_mod, "List Modify Expressions") as_exp_and( as_exp_cmp_eq( as_exp_list_size(NULL, - as_exp_list_remove_by_index(NULL, AS_LIST_RETURN_NONE, as_exp_int(3), + as_exp_list_remove_by_index(NULL, as_exp_int(3), as_exp_bin_list(BIN_NAME))), as_exp_int(5)), as_exp_cmp_eq( as_exp_list_get_by_index(NULL, AS_LIST_RETURN_VALUE, AS_EXP_TYPE_INT, as_exp_int(-1), - as_exp_list_remove_by_rank(NULL, AS_LIST_RETURN_NONE, as_exp_int(0), + as_exp_list_remove_by_rank(NULL, as_exp_int(0), as_exp_bin_list(BIN_NAME))), as_exp_int(5)), as_exp_cmp_eq( diff --git a/src/test/aerospike_map/map_basics.c b/src/test/aerospike_map/map_basics.c index 1cb246b88..ffe115ca6 100644 --- a/src/test/aerospike_map/map_basics.c +++ b/src/test/aerospike_map/map_basics.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ #include #include #include +#include #include #include "../test.h" @@ -2601,7 +2603,7 @@ TEST(map_exp_mod, "Map Modify Expression") as_exp_map_remove_by_value(NULL, AS_MAP_RETURN_NONE, as_exp_int(700), as_exp_map_remove_by_key_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(40), as_exp_int(51), as_exp_map_remove_by_key_list(NULL, AS_MAP_RETURN_NONE, as_exp_val(&rem), - as_exp_map_remove_by_key(NULL, AS_MAP_RETURN_NONE, as_exp_int(0), + as_exp_map_remove_by_key(NULL, as_exp_int(0), as_exp_bin_map(BIN_NAME)))))), as_exp_int(4)))); @@ -2643,14 +2645,14 @@ TEST(map_exp_mod, "Map Modify Expression") as_exp_cmp_eq( as_exp_map_size(NULL, as_exp_map_remove_by_index_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(0), as_exp_int(1), - as_exp_map_remove_by_index(NULL, AS_MAP_RETURN_NONE, as_exp_int(0), + as_exp_map_remove_by_index(NULL, as_exp_int(0), as_exp_map_remove_by_value_rel_rank_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(500), as_exp_int(2), as_exp_int(4), as_exp_bin_map(BIN_NAME))))), as_exp_int(5)), as_exp_cmp_eq( as_exp_map_size(NULL, as_exp_map_remove_by_rank_range(NULL, AS_MAP_RETURN_NONE, as_exp_int(1), as_exp_int(2), - as_exp_map_remove_by_rank(NULL, AS_MAP_RETURN_NONE, as_exp_int(-1), + as_exp_map_remove_by_rank(NULL, as_exp_int(-1), as_exp_map_remove_by_rank_range_to_end(NULL, AS_MAP_RETURN_NONE, as_exp_int(-2), as_exp_map_remove_by_index_range_to_end(NULL, AS_MAP_RETURN_NONE, as_exp_int(7), as_exp_bin_map(BIN_NAME)))))), @@ -2950,6 +2952,64 @@ TEST(ordered_map_eq_exp, "Ordered Map Equality Expression") as_exp_destroy(filter); } +TEST(map_inverted_exp, "Map Inverted Expression") +{ + as_key rkey; + as_key_init_int64(&rkey, NAMESPACE, SET, 29); + + as_error err; + as_status status = aerospike_key_remove(as, &err, NULL, &rkey); + assert_true(status == AEROSPIKE_OK || status == AEROSPIKE_ERR_RECORD_NOT_FOUND); + + as_hashmap map; + as_hashmap_init(&map, 4); + as_stringmap_set_int64((as_map*)&map, "a", 1); + as_stringmap_set_int64((as_map*)&map, "b", 2); + as_stringmap_set_int64((as_map*)&map, "c", 2); + as_stringmap_set_int64((as_map*)&map, "d", 3); + + const char* bin_name = "smap"; + as_record rec; + as_record_init(&rec, 1); + as_record_set_map(&rec, bin_name, (as_map*)&map); + + status = aerospike_key_put(as, &err, NULL, &rkey, &rec); + assert_int_eq(status, AEROSPIKE_OK); + as_record_destroy(&rec); + + // Use INVERTED to remove all entries where value != 2. + as_exp_build(expr, as_exp_map_remove_by_value(NULL, AS_MAP_RETURN_INVERTED, as_exp_int(2), + as_exp_bin_map(bin_name))); + + as_operations ops; + as_operations_inita(&ops, 1); + as_operations_exp_read(&ops, bin_name, expr, AS_EXP_READ_DEFAULT); + + as_record* results = NULL; + + status = aerospike_key_operate(as, &err, NULL, &rkey, &ops, &results); + assert_int_eq(status, AEROSPIKE_OK); + + as_map* map_result = as_record_get_map(results, bin_name); + assert_int_eq(as_map_size(map_result), 2); + + as_string s1; + as_string_init(&s1, "b", false); + as_val* v1 = as_map_get(map_result, (as_val*)&s1); + assert_int_eq(v1->type, AS_INTEGER); + assert_int_eq(((as_integer*)v1)->value, 2); + + as_string s2; + as_string_init(&s2, "c", false); + as_val* v2 = as_map_get(map_result, (as_val*)&s2); + assert_int_eq(v2->type, AS_INTEGER); + assert_int_eq(((as_integer*)v2)->value, 2); + + as_operations_destroy(&ops); + as_exp_destroy(expr); + as_record_destroy(results); +} + /****************************************************************************** * TEST SUITE *****************************************************************************/ @@ -2986,4 +3046,5 @@ SUITE(map_basics, "aerospike map basic tests") suite_add(map_exp); suite_add(map_ordered_result); suite_add(ordered_map_eq_exp); + suite_add(map_inverted_exp); } From 0aec4f0e4d294a184e74cacf7ca2216747bb0542 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Tue, 5 Sep 2023 16:08:07 -0700 Subject: [PATCH 06/35] Mention minimum openssl library version (1.0.2) in readme. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 004f437be..9d98de165 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ Run this script after installing XCode and Brew: See [Windows Build](vs). +### OpenSSL Library + +This minimum OpenSSL library version is 1.0.2. + ### Event Library (Optional) An event library is required when C client asynchronous functionality is used. From 13cbadc3cd01d258357861fb4b7ba86978ec91b9 Mon Sep 17 00:00:00 2001 From: Kevin Porter Date: Wed, 6 Sep 2023 10:50:50 -0700 Subject: [PATCH 07/35] Add tests to query a CDT ctx containing a string. --- src/test/aerospike_index/index_basics.c | 6 ++ src/test/aerospike_query/query_foreach.c | 114 +++++++++++++++++++++-- 2 files changed, 112 insertions(+), 8 deletions(-) diff --git a/src/test/aerospike_index/index_basics.c b/src/test/aerospike_index/index_basics.c index c18060494..b17412eba 100644 --- a/src/test/aerospike_index/index_basics.c +++ b/src/test/aerospike_index/index_basics.c @@ -167,6 +167,12 @@ TEST(index_ctx_test , "Create ctx index on bin") info("sindex-info: %s", res); free(res); res = NULL; + + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_test_ctx"); + + if (err.code != AEROSPIKE_OK) { + info("error(%d): %s", err.code, err.message); + } } TEST(ctx_restore_test , "backup/restore ctx") diff --git a/src/test/aerospike_query/query_foreach.c b/src/test/aerospike_query/query_foreach.c index 57f92f655..26bc3c862 100644 --- a/src/test/aerospike_query/query_foreach.c +++ b/src/test/aerospike_query/query_foreach.c @@ -116,20 +116,21 @@ query_foreach_create(void) status = aerospike_index_create(as, &err, &task, NULL, NAMESPACE, SET, "d", "idx_test_d", AS_INDEX_NUMERIC); index_process_return_code(status, &err, &task); - // create complex index on "e" + + // create complex index on "x" + status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "x", "idx_test_x", AS_INDEX_TYPE_LIST, AS_INDEX_STRING); + index_process_return_code(status, &err, &task); + as_cdt_ctx ctx; + as_cdt_ctx_init(&ctx, 1); - as_cdt_ctx_add_list_rank(&ctx, -1); + as_cdt_ctx_add_list_index(&ctx, 0); - status = aerospike_index_create_ctx(as, &err, &task, NULL, NAMESPACE, SET, "z", "idx_ctx_test_z", AS_INDEX_TYPE_DEFAULT, AS_INDEX_NUMERIC, &ctx); + status = aerospike_index_create_ctx(as, &err, &task, NULL, NAMESPACE, SET, "x", "idx_ctx_test_x", AS_INDEX_TYPE_DEFAULT, AS_INDEX_STRING, &ctx); index_process_return_code(status, &err, &task); as_cdt_ctx_destroy(&ctx); - // create complex index on "x" - status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "x", "idx_test_x", AS_INDEX_TYPE_LIST, AS_INDEX_STRING); - index_process_return_code(status, &err, &task); - // create complex index on "y" status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "y", "idx_test_y", AS_INDEX_TYPE_MAPKEYS, AS_INDEX_STRING); index_process_return_code(status, &err, &task); @@ -138,10 +139,29 @@ query_foreach_create(void) status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "y", "idx_test_y1", AS_INDEX_TYPE_MAPVALUES, AS_INDEX_STRING); index_process_return_code(status, &err, &task); + as_string ykey; + as_string_init(&ykey, "ykey", false); + + as_cdt_ctx_init(&ctx, 1); + as_cdt_ctx_add_map_key(&ctx, (as_val*)&ykey); + + status = aerospike_index_create_ctx(as, &err, &task, NULL, NAMESPACE, SET, "y", "idx_ctx_test_y", AS_INDEX_TYPE_DEFAULT, AS_INDEX_STRING, &ctx); + index_process_return_code(status, &err, &task); + + as_cdt_ctx_destroy(&ctx); + // create complex index on "z" status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "z", "idx_test_z", AS_INDEX_TYPE_LIST, AS_INDEX_NUMERIC); index_process_return_code(status, &err, &task); + as_cdt_ctx_init(&ctx, 1); + as_cdt_ctx_add_list_rank(&ctx, -1); + + status = aerospike_index_create_ctx(as, &err, &task, NULL, NAMESPACE, SET, "z", "idx_ctx_test_z", AS_INDEX_TYPE_DEFAULT, AS_INDEX_NUMERIC, &ctx); + index_process_return_code(status, &err, &task); + + as_cdt_ctx_destroy(&ctx); + char* buffer = alloca(n_recs * 1024 + 1); uint32_t the_ttl = AS_RECORD_NO_EXPIRE_TTL; @@ -305,6 +325,11 @@ query_foreach_destroy(void) info("error(%d): %s", err.code, err.message); } + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_ctx_test_x"); + if (err.code != AEROSPIKE_OK) { + info("error(%d): %s", err.code, err.message); + } + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_test_y"); if (err.code != AEROSPIKE_OK) { info("error(%d): %s", err.code, err.message); @@ -315,11 +340,21 @@ query_foreach_destroy(void) info("error(%d): %s", err.code, err.message); } + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_ctx_test_y"); + if (err.code != AEROSPIKE_OK) { + info("error(%d): %s", err.code, err.message); + } + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_test_z"); if (err.code != AEROSPIKE_OK) { info("error(%d): %s", err.code, err.message); } + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_ctx_test_z"); + if (err.code != AEROSPIKE_OK) { + info("error(%d): %s", err.code, err.message); + } + return true; } @@ -555,7 +590,7 @@ TEST(query_foreach_5, "IN LIST count(*) where x contains 'x'") aerospike_query_foreach(as, &err, NULL, &q, query_foreach_count_callback, &count); if (err.code != AEROSPIKE_OK) { - fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line); + fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line); } assert_int_eq(err.code, AEROSPIKE_OK); @@ -1594,6 +1629,67 @@ TEST(query_foreach_int_with_double_bin, "test query on double behavior") assert_int_eq(err.code, AEROSPIKE_OK); } +TEST(query_list_ctx_is_string, "IN LIST count(*) where x[0] is 'x'") +{ + as_error err; + as_error_reset(&err); + + uint32_t count = 0; + + as_cdt_ctx ctx; + as_cdt_ctx_init(&ctx, 1); + as_cdt_ctx_add_list_index(&ctx, 0); + + as_query q; + as_query_init(&q, NAMESPACE, SET); + + as_query_where_inita(&q, 1); + as_query_where_with_ctx(&q, "x", &ctx, as_string_equals("x")); + + aerospike_query_foreach(as, &err, NULL, &q, query_foreach_count_callback, &count); + + if (err.code != AEROSPIKE_OK) { + fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line); + } + + assert_int_eq(err.code, AEROSPIKE_OK); + assert_int_eq(count, 34); + + as_query_destroy(&q); +} + +TEST(query_map_ctx_is_string, "IN LIST count(*) where y['ykey'] is 'yvalue'") +{ + as_error err; + as_error_reset(&err); + + uint32_t count = 0; + + as_string ykey; + as_string_init(&ykey, "ykey", false); + + as_cdt_ctx ctx; + as_cdt_ctx_init(&ctx, 1); + as_cdt_ctx_add_map_key(&ctx, (as_val*)&ykey); + + as_query q; + as_query_init(&q, NAMESPACE, SET); + + as_query_where_inita(&q, 1); + as_query_where_with_ctx(&q, "y", &ctx, as_string_equals("yvalue")); + + aerospike_query_foreach(as, &err, NULL, &q, query_foreach_count_callback, &count); + + if (err.code != AEROSPIKE_OK) { + fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line); + } + + assert_int_eq(err.code, AEROSPIKE_OK); + assert_int_eq(count, 15); + + as_query_destroy(&q); +} + /****************************************************************************** * TEST SUITE *****************************************************************************/ @@ -1659,4 +1755,6 @@ SUITE(query_foreach, "aerospike_query_foreach tests") suite_add(query_filter_map_bytes); suite_add(query_foreach_nullset); suite_add(query_foreach_int_with_double_bin); + suite_add(query_list_ctx_is_string); + suite_add(query_map_ctx_is_string); } From 49c34483ed191fc2aca407b8ecfc3d8ec8dcbda3 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Thu, 14 Sep 2023 16:26:25 -0700 Subject: [PATCH 08/35] Adjust query_foreach tests to be compatible with upcoming server version 7.0. --- src/test/aerospike_query/query_foreach.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/aerospike_query/query_foreach.c b/src/test/aerospike_query/query_foreach.c index 26bc3c862..792305fec 100644 --- a/src/test/aerospike_query/query_foreach.c +++ b/src/test/aerospike_query/query_foreach.c @@ -1710,6 +1710,22 @@ SUITE(query_foreach, "aerospike_query_foreach tests") if (strcmp(namespace_storage, "memory") == 0) { namespace_in_memory = true; + + char shadow[128]; + shadow[0] = '\0'; + + get_info_field(NAMESPACE_INFO, "storage-engine.file[0]", shadow, sizeof(shadow)); + + if (shadow[0] != '\0') { + namespace_has_persistence = true; + } + else { + get_info_field(NAMESPACE_INFO, "storage-engine.device[0]", shadow, sizeof(shadow)); + + if (shadow[0] != '\0') { + namespace_has_persistence = true; + } + } } if (! namespace_in_memory) { From 2024bd749af66b95f0bc1f2c82ed8680136741bd Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 18 Sep 2023 17:09:54 -0700 Subject: [PATCH 09/35] CLIENT-2558 Set in_doubt in sync commands when AEROSPIKE_ERR_INVALID_NODE is returned. --- src/main/aerospike/as_command.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/aerospike/as_command.c b/src/main/aerospike/as_command.c index 1abe65a53..1dc48cf23 100644 --- a/src/main/aerospike/as_command.c +++ b/src/main/aerospike/as_command.c @@ -605,9 +605,11 @@ as_command_execute(as_command* cmd, as_error* err) cmd->replica_size, &cmd->replica_index); if (! node) { - return as_error_update(err, AEROSPIKE_ERR_INVALID_NODE, - "Node not found for partition %s:%u", - cmd->ns, cmd->partition_id); + as_error_update(err, AEROSPIKE_ERR_INVALID_NODE, + "Node not found for partition %s:%u", cmd->ns, cmd->partition_id); + + as_error_set_in_doubt(err, cmd->flags & AS_COMMAND_FLAGS_READ, cmd->sent); + return err->code; } as_node_reserve(node); release_node = true; From a34f00a0a5bd480d1e249486042a98f514bcf339 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Tue, 19 Sep 2023 17:47:11 -0700 Subject: [PATCH 10/35] Update docs for as_error_update() and as_error_set_message(). --- src/include/aerospike/as_error.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/aerospike/as_error.h b/src/include/aerospike/as_error.h index a688f8f5e..4102b6f6d 100644 --- a/src/include/aerospike/as_error.h +++ b/src/include/aerospike/as_error.h @@ -135,7 +135,7 @@ typedef struct as_error_s { *****************************************************************************/ /** - * as_error_update(&as->error, AEROSPIKE_OK, "%s %d", "a", 1); + * Set all as_error fields and default in_doubt to false. Variable arguments are accepted. * * @ingroup as_error_object */ @@ -143,7 +143,7 @@ typedef struct as_error_s { as_error_setallv( __err, __code, __func__, __FILE__, __LINE__, __fmt, ##__VA_ARGS__ ); /** - * as_error_set_message(&as->error, AEROSPIKE_ERR, "error message"); + * Set all as_error fields and default in_doubt to false. Variable arguments are not accepted. * * @ingroup as_error_object */ From 9757235212329886897e3db1889b6b021d204b9c Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Wed, 20 Sep 2023 16:52:43 -0700 Subject: [PATCH 11/35] CLIENT-2570 Support as_exp_record_size(). --- src/include/aerospike/as_exp.h | 26 +++++++++++++++++- src/test/aerospike_query/query_foreach.c | 34 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/include/aerospike/as_exp.h b/src/include/aerospike/as_exp.h index 39aab7088..1d8d25e94 100644 --- a/src/include/aerospike/as_exp.h +++ b/src/include/aerospike/as_exp.h @@ -119,6 +119,7 @@ typedef enum { _AS_EXP_CODE_KEY_EXIST = 71, _AS_EXP_CODE_IS_TOMBSTONE = 72, _AS_EXP_CODE_MEMORY_SIZE = 73, + _AS_EXP_CODE_RECORD_SIZE = 74, _AS_EXP_CODE_KEY = 80, _AS_EXP_CODE_BIN = 81, @@ -670,11 +671,32 @@ as_exp_destroy_base64(char* base64) */ #define as_exp_set_name() {.op=_AS_EXP_CODE_SET_NAME, .count=1} +/** + * Create expression that returns the record size. This expression usually evaluates + * quickly because record meta data is cached in memory. + * + * Requires server version 7.0+. This expression replaces as_exp_device_size() and + * as_exp_memory_size(). + * + * ~~~~~~~~~~{.c} + * // Record size >= 100 KB + * as_exp_build(expression, + * as_exp_cmp_ge(as_exp_record_size(), as_exp_int(100 * 1024))); + * ~~~~~~~~~~ + * + * @return (integer value) Uncompressed size of the record. + * @ingroup expression + */ +#define as_exp_record_size() {.op=_AS_EXP_CODE_RECORD_SIZE, .count=1} + /** * Create expression that returns record size on disk. If server storage-engine is * memory, then zero is returned. This expression usually evaluates quickly * because record meta data is cached in memory. * + * This expression should only be used for server versions less than 7.0. Use + * as_exp_record_size() for server version 7.0+. + * * ~~~~~~~~~~{.c} * // Record device size >= 100 KB * as_exp_build(expression, @@ -773,7 +795,9 @@ as_exp_destroy_base64(char* base64) * storage-engine is memory or data-in-memory is true, otherwise returns 0. * This expression usually evaluates quickly because record meta data is cached * in memory. - * Requires server version 5.3.0+. + * + * Requires server version between 5.3 inclusive and 7.0 exclusive. + * Use as_exp_record_size() for server version 7.0+. * * ~~~~~~~~~~{.c} * // Record memory size >= 100 KB diff --git a/src/test/aerospike_query/query_foreach.c b/src/test/aerospike_query/query_foreach.c index 792305fec..bbc56f97b 100644 --- a/src/test/aerospike_query/query_foreach.c +++ b/src/test/aerospike_query/query_foreach.c @@ -801,6 +801,39 @@ TEST(query_with_equality_filter, "query_with_equality_filter") as_query_destroy(&q); } +TEST(query_with_rec_size_filter, "query_with_rec_size_filter") +{ + as_error err; + as_error_reset(&err); + + int count = 0; + + as_query q; + as_query_init(&q, NAMESPACE, SET); + + as_query_select_inita(&q, 1); + as_query_select(&q, "c"); + + as_query_where_inita(&q, 1); + as_query_where(&q, "a", as_string_equals("abc")); + + as_exp_build(filter, + as_exp_cmp_ge(as_exp_record_size(), as_exp_int(65 * 1024))); + + as_policy_query p; + as_policy_query_init(&p); + p.base.filter_exp = filter; + + aerospike_query_foreach(as, &err, &p, &q, count_callback, &count); + + // We should match 100 - 65 records + assert_int_eq(err.code, 0); + assert_int_eq(count, 35); + + as_exp_destroy(filter); + as_query_destroy(&q); +} + TEST(query_with_rec_device_size_filter, "query_with_rec_device_size_filter") { as_error err; @@ -1750,6 +1783,7 @@ SUITE(query_foreach, "aerospike_query_foreach tests") suite_add(query_foreach_9); suite_add(query_with_range_filter); suite_add(query_with_equality_filter); + suite_add(query_with_rec_size_filter); suite_add(query_with_rec_device_size_filter); suite_add(query_with_rec_memory_size_filter); suite_add(query_intermittent_bin_filter); From 09614add8a9c21355f22cd294e3d1ca5e89be04e Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Tue, 3 Oct 2023 16:19:03 -0700 Subject: [PATCH 12/35] CLIENT-2579 Allow read-only operations in aerospike_batch_operate(). --- src/main/aerospike/aerospike_batch.c | 59 +++++++++++++++++++++------- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/src/main/aerospike/aerospike_batch.c b/src/main/aerospike/aerospike_batch.c index 6f7f00639..5c3bae809 100644 --- a/src/main/aerospike/aerospike_batch.c +++ b/src/main/aerospike/aerospike_batch.c @@ -3550,26 +3550,57 @@ aerospike_batch_operate( { as_error_reset(err); - if (! policy) { - policy = &as->config.policies.batch_parent_write; + uint32_t n_operations = ops->binops.size; + bool has_write = false; + + for (uint32_t i = 0; i < n_operations; i++) { + as_binop* op = &ops->binops.entries[i]; + + if (as_op_is_write[op->op]) { + has_write = true; + break; + } } + + if (has_write) { + if (! policy) { + policy = &as->config.policies.batch_parent_write; + } - if (! policy_write) { - policy_write = &as->config.policies.batch_write; + if (! policy_write) { + policy_write = &as->config.policies.batch_write; + } + + as_batch_write_record rec = { + .type = AS_BATCH_WRITE, + .has_write = true, + .policy = policy_write, + .ops = ops + }; + + as_batch_attr attr; + as_batch_attr_write_row(&attr, policy_write, ops); + + return as_batch_keys_execute(as, err, policy, batch, (as_batch_base_record*)&rec, &attr, + listener, udata); } + else { + if (! policy) { + policy = &as->config.policies.batch; + } - as_batch_write_record rec = { - .type = AS_BATCH_WRITE, - .has_write = true, - .policy = policy_write, - .ops = ops - }; + as_batch_read_record rec = { + .type = AS_BATCH_READ, + .ops = ops + }; - as_batch_attr attr; - as_batch_attr_write_row(&attr, policy_write, ops); + as_batch_attr attr; + as_batch_attr_read_header(&attr, policy); + as_batch_attr_read_adjust_ops(&attr, ops); - return as_batch_keys_execute(as, err, policy, batch, (as_batch_base_record*)&rec, &attr, - listener, udata); + return as_batch_keys_execute(as, err, policy, batch, (as_batch_base_record*)&rec, &attr, + listener, udata); + } } as_status From 7e9143a4a0b755eb88b6c484c98d89b293f9e03f Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 9 Oct 2023 15:13:49 -0700 Subject: [PATCH 13/35] CLIENT-2585 Support secondary index on a blob bin. Requires server version 7.0+. --- src/include/aerospike/aerospike_index.h | 5 +- src/include/aerospike/as_cdt_internal.h | 3 + src/include/aerospike/as_query.h | 19 +++ src/main/aerospike/aerospike_index.c | 5 +- src/main/aerospike/aerospike_query.c | 73 ++++++++-- src/main/aerospike/as_cdt_internal.c | 17 +++ src/main/aerospike/as_query.c | 174 +++++++++++++++++------ src/test/aerospike_query/query_foreach.c | 48 ++++++- 8 files changed, 279 insertions(+), 65 deletions(-) diff --git a/src/include/aerospike/aerospike_index.h b/src/include/aerospike/aerospike_index.h index ce2e8e7d0..fc5289d77 100644 --- a/src/include/aerospike/aerospike_index.h +++ b/src/include/aerospike/aerospike_index.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -73,7 +73,8 @@ typedef enum as_index_type_s { typedef enum as_index_datatype_s { AS_INDEX_STRING, AS_INDEX_NUMERIC, - AS_INDEX_GEO2DSPHERE + AS_INDEX_GEO2DSPHERE, + AS_INDEX_BLOB // Requires server version 7.0+. } as_index_datatype; /** diff --git a/src/include/aerospike/as_cdt_internal.h b/src/include/aerospike/as_cdt_internal.h index 6b3d16c98..dbe0b2b1d 100644 --- a/src/include/aerospike/as_cdt_internal.h +++ b/src/include/aerospike/as_cdt_internal.h @@ -88,6 +88,9 @@ as_unpack_str_new(as_unpacker* pk, char** str, uint32_t max); bool as_unpack_bytes_init(as_unpacker* pk, uint8_t* b, uint32_t max); +bool +as_unpack_bytes_new(as_unpacker* pk, uint8_t** bytes, uint32_t* bytes_size, uint32_t max); + #define as_cmp_error() \ printf("Line %d\n", __LINE__);\ return false; diff --git a/src/include/aerospike/as_query.h b/src/include/aerospike/as_query.h index fe7febd93..cdd3d0ba0 100644 --- a/src/include/aerospike/as_query.h +++ b/src/include/aerospike/as_query.h @@ -44,6 +44,19 @@ extern "C" { */ #define as_string_equals(__val) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_DEFAULT, AS_INDEX_STRING, __val +/** + * Macro for setting setting the BLOB_EQUAL predicate. + * Requires server version 7.0+. + * + * ~~~~~~~~~~{.c} + * // as_blob_equals(uint8_t* bytes, uint32_t size, bool free) + * as_query_where(query, "bin1", as_blob_equals(bytes, size, true)); + * ~~~~~~~~~~ + * + * @relates as_query + */ +#define as_blob_equals(__val, __size, __free) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_DEFAULT, AS_INDEX_BLOB, __val, __size, __free + /** * Macro for setting setting the INTEGER_EQUAL predicate. * @@ -125,6 +138,12 @@ typedef union as_predicate_value_u { bool _free; } string_val; + struct { + uint8_t* bytes; + uint32_t bytes_size; + bool _free; + } blob_val; + struct { int64_t min; int64_t max; diff --git a/src/main/aerospike/aerospike_index.c b/src/main/aerospike/aerospike_index.c index dcbde829f..4e45b455f 100644 --- a/src/main/aerospike/aerospike_index.c +++ b/src/main/aerospike/aerospike_index.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -47,6 +47,9 @@ aerospike_index_create_ctx( case AS_INDEX_NUMERIC: dtype_string = "NUMERIC"; break; + case AS_INDEX_BLOB: + dtype_string = "BLOB"; + break; case AS_INDEX_GEO2DSPHERE: dtype_string = "GEO2DSPHERE"; break; diff --git a/src/main/aerospike/aerospike_query.c b/src/main/aerospike/aerospike_query.c index 7f4a33ecf..5c6359115 100644 --- a/src/main/aerospike/aerospike_query.c +++ b/src/main/aerospike/aerospike_query.c @@ -578,6 +578,27 @@ as_query_write_range_string(uint8_t* p, char* begin, char* end) return p; } +static uint8_t* +as_query_write_range_blob(uint8_t* p, uint8_t* bytes, uint32_t size) +{ + // Write particle type. + *p++ = AS_BYTES_BLOB; + + // Write begin value. + *(uint32_t*)p = cf_swap_to_be32(size); + p += sizeof(uint32_t); + memcpy(p, bytes, size); + p += size; + + // Write end value. + *(uint32_t*)p = cf_swap_to_be32(size); + p += sizeof(uint32_t); + memcpy(p, bytes, size); + p += size; + + return p; +} + static uint8_t* as_query_write_range_geojson(uint8_t* p, char* begin, char* end) { @@ -689,15 +710,26 @@ as_query_command_size( // bin name size(1) + particle type size(1) + begin particle size(4) + end particle size(4) = 10 filter_size += (uint32_t)strlen(pred->bin) + 10; - switch(pred->type) { + switch (pred->type) { case AS_PREDICATE_EQUAL: - if (pred->dtype == AS_INDEX_STRING) { - filter_size += (uint32_t)strlen(pred->value.string_val.string) * 2; - } - else if (pred->dtype == AS_INDEX_NUMERIC) { - filter_size += sizeof(int64_t) * 2; + switch (pred->dtype) { + case AS_INDEX_STRING: + filter_size += (uint32_t)strlen(pred->value.string_val.string) * 2; + break; + + case AS_INDEX_NUMERIC: + filter_size += sizeof(int64_t) * 2; + break; + + case AS_INDEX_BLOB: + filter_size += pred->value.blob_val.bytes_size * 2; + break; + + default: + break; } break; + case AS_PREDICATE_RANGE: if (pred->dtype == AS_INDEX_NUMERIC) { filter_size += sizeof(int64_t) * 2; @@ -902,16 +934,31 @@ as_query_command_init( *len_ptr = (uint8_t)(s - (uint8_t*)pred->bin); // Write particle type and range values. - switch(pred->type) { + switch (pred->type) { case AS_PREDICATE_EQUAL: - if (pred->dtype == AS_INDEX_STRING) { - char* str = pred->value.string_val.string; - p = as_query_write_range_string(p, str, str); - } - else if (pred->dtype == AS_INDEX_NUMERIC) { - p = as_query_write_range_integer(p, pred->value.integer, pred->value.integer); + switch (pred->dtype) { + case AS_INDEX_STRING: { + char* str = pred->value.string_val.string; + p = as_query_write_range_string(p, str, str); + break; + } + + case AS_INDEX_NUMERIC: { + p = as_query_write_range_integer(p, pred->value.integer, pred->value.integer); + break; + } + + case AS_INDEX_BLOB: { + p = as_query_write_range_blob(p, pred->value.blob_val.bytes, pred->value.blob_val.bytes_size); + break; + } + + default: { + break; + } } break; + case AS_PREDICATE_RANGE: if (pred->dtype == AS_INDEX_NUMERIC) { p = as_query_write_range_integer(p, pred->value.integer_range.min, pred->value.integer_range.max); diff --git a/src/main/aerospike/as_cdt_internal.c b/src/main/aerospike/as_cdt_internal.c index adb4e54f9..4ba93c6db 100644 --- a/src/main/aerospike/as_cdt_internal.c +++ b/src/main/aerospike/as_cdt_internal.c @@ -247,6 +247,23 @@ as_unpack_bytes_init(as_unpacker* pk, uint8_t* b, uint32_t max) return true; } +bool +as_unpack_bytes_new(as_unpacker* pk, uint8_t** bytes, uint32_t* bytes_size, uint32_t max) +{ + uint32_t size; + const uint8_t* p = as_unpack_str(pk, &size); + + if (!p || size > max) { + return false; + } + + uint8_t* b = cf_malloc(size); + memcpy(b, p, size); + *bytes = b; + *bytes_size = size; + return true; +} + bool as_val_compare(as_val* v1, as_val* v2) { diff --git a/src/main/aerospike/as_query.c b/src/main/aerospike/as_query.c index bea615693..12b56d346 100644 --- a/src/main/aerospike/as_query.c +++ b/src/main/aerospike/as_query.c @@ -104,9 +104,22 @@ as_query_destroy(as_query* query) cf_free(pred->ctx); } - if ((pred->dtype == AS_INDEX_STRING || pred->dtype == AS_INDEX_GEO2DSPHERE) && - pred->value.string_val._free) { - cf_free(pred->value.string_val.string); + switch (pred->dtype) { + case AS_INDEX_GEO2DSPHERE: + case AS_INDEX_STRING: + if (pred->value.string_val._free) { + cf_free(pred->value.string_val.string); + } + break; + + case AS_INDEX_BLOB: + if (pred->value.blob_val._free) { + cf_free(pred->value.blob_val.bytes); + } + break; + + default: + break; } } cf_free(query->where.entries); @@ -227,19 +240,30 @@ as_query_where_internal( p->ctx_size = 0; } - switch(type) { + switch (type) { case AS_PREDICATE_EQUAL: - if (dtype == AS_INDEX_STRING) { - p->value.string_val.string = va_arg(ap, char*); - p->value.string_val._free = false; - } - else if (dtype == AS_INDEX_NUMERIC) { - p->value.integer = va_arg(ap, int64_t); - } - else { - status = false; + switch (dtype) { + case AS_INDEX_STRING: + p->value.string_val.string = va_arg(ap, char*); + p->value.string_val._free = false; + break; + + case AS_INDEX_NUMERIC: + p->value.integer = va_arg(ap, int64_t); + break; + + case AS_INDEX_BLOB: + p->value.blob_val.bytes = va_arg(ap, uint8_t*); + p->value.blob_val.bytes_size = va_arg(ap, uint32_t); + p->value.blob_val._free = (bool)va_arg(ap, uint32_t); + break; + + default: + status = false; + break; } break; + case AS_PREDICATE_RANGE: if (dtype == AS_INDEX_NUMERIC) { p->value.integer_range.min = va_arg(ap, int64_t); @@ -335,13 +359,23 @@ as_query_to_bytes(const as_query* query, uint8_t** bytes, uint32_t* bytes_size) as_pack_int64(&pk, pred->dtype); as_pack_int64(&pk, pred->itype); - switch(pred->type) { + switch (pred->type) { case AS_PREDICATE_EQUAL: - if (pred->dtype == AS_INDEX_STRING) { - as_pack_string(&pk, pred->value.string_val.string); - } - else if (pred->dtype == AS_INDEX_NUMERIC) { - as_pack_int64(&pk, pred->value.integer); + switch (pred->dtype) { + case AS_INDEX_STRING: + as_pack_string(&pk, pred->value.string_val.string); + break; + + case AS_INDEX_NUMERIC: + as_pack_int64(&pk, pred->value.integer); + break; + + case AS_INDEX_BLOB: + as_pack_bytes(&pk, pred->value.blob_val.bytes, pred->value.blob_val.bytes_size); + break; + + default: + break; } break; @@ -485,7 +519,7 @@ as_query_from_bytes(as_query* query, const uint8_t* bytes, uint32_t bytes_size) // Unpack where as_predicate* pred = NULL; - bool free_pred_string = false; + bool free_pred_val = false; bool b = false; if (as_unpack_uint64(&pk, &uval) != 0) { @@ -504,7 +538,7 @@ as_query_from_bytes(as_query* query, const uint8_t* bytes, uint32_t bytes_size) pred->ctx = NULL; pred->ctx_size = 0; pred->ctx_free = false; - free_pred_string = false; + free_pred_val = false; if (! as_unpack_str_init(&pk, pred->bin, AS_BIN_NAME_MAX_SIZE)) { goto HandleError; @@ -559,19 +593,34 @@ as_query_from_bytes(as_query* query, const uint8_t* bytes, uint32_t bytes_size) pred->itype = (as_index_type)ival; - switch(pred->type) { + switch (pred->type) { case AS_PREDICATE_EQUAL: - if (pred->dtype == AS_INDEX_STRING) { - if (! as_unpack_str_new(&pk, &pred->value.string_val.string, 4096)) { - goto HandlePredError; - } - pred->value.string_val._free = true; - free_pred_string = true; - } - else if (pred->dtype == AS_INDEX_NUMERIC) { - if (as_unpack_int64(&pk, &pred->value.integer) != 0) { - goto HandlePredError; - } + switch (pred->dtype) { + case AS_INDEX_STRING: + if (! as_unpack_str_new(&pk, &pred->value.string_val.string, 4096)) { + goto HandlePredError; + } + pred->value.string_val._free = true; + free_pred_val = true; + break; + + case AS_INDEX_NUMERIC: + if (as_unpack_int64(&pk, &pred->value.integer) != 0) { + goto HandlePredError; + } + break; + + case AS_INDEX_BLOB: + if (! as_unpack_bytes_new(&pk, &pred->value.blob_val.bytes, + &pred->value.blob_val.bytes_size, 4096)) { + goto HandlePredError; + } + pred->value.blob_val._free = true; + free_pred_val = true; + break; + + default: + break; } break; @@ -590,7 +639,7 @@ as_query_from_bytes(as_query* query, const uint8_t* bytes, uint32_t bytes_size) goto HandlePredError; } pred->value.string_val._free = true; - free_pred_string = true; + free_pred_val = true; } break; @@ -789,9 +838,23 @@ as_query_from_bytes(as_query* query, const uint8_t* bytes, uint32_t bytes_size) pred->ctx = NULL; } - if (free_pred_string) { - cf_free(pred->value.string_val.string); - pred->value.string_val.string = NULL; + if (free_pred_val) { + switch (pred->dtype) { + case AS_INDEX_GEO2DSPHERE: + case AS_INDEX_STRING: + cf_free(pred->value.string_val.string); + pred->value.string_val.string = NULL; + break; + + case AS_INDEX_BLOB: + cf_free(pred->value.blob_val.bytes); + pred->value.blob_val.bytes = NULL; + pred->value.blob_val.bytes_size = 0; + break; + + default: + break; + } } HandleError: @@ -921,17 +984,34 @@ as_query_compare(as_query* q1, as_query* q2) { as_cmp_error(); } - switch(p1->type) { + switch (p1->type) { case AS_PREDICATE_EQUAL: - if (p1->dtype == AS_INDEX_STRING) { - if (strcmp(p1->value.string_val.string, p2->value.string_val.string) != 0) { - as_cmp_error(); - } - } - else if (p1->dtype == AS_INDEX_NUMERIC) { - if (p1->value.integer != p2->value.integer) { - as_cmp_error(); - } + switch (p1->dtype) { + case AS_INDEX_STRING: + if (strcmp(p1->value.string_val.string, p2->value.string_val.string) != 0) { + as_cmp_error(); + } + break; + + case AS_INDEX_NUMERIC: + if (p1->value.integer != p2->value.integer) { + as_cmp_error(); + } + break; + + case AS_INDEX_BLOB: + if (p1->value.blob_val.bytes_size != p2->value.blob_val.bytes_size) { + as_cmp_error(); + } + + if (memcmp(p1->value.blob_val.bytes, p2->value.blob_val.bytes, + p1->value.blob_val.bytes_size) != 0) { + as_cmp_error(); + } + break; + + default: + break; } break; diff --git a/src/test/aerospike_query/query_foreach.c b/src/test/aerospike_query/query_foreach.c index bbc56f97b..978e91dc2 100644 --- a/src/test/aerospike_query/query_foreach.c +++ b/src/test/aerospike_query/query_foreach.c @@ -162,6 +162,9 @@ query_foreach_create(void) as_cdt_ctx_destroy(&ctx); + status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "blob", "idx_blob_test", AS_INDEX_TYPE_DEFAULT, AS_INDEX_BLOB); + index_process_return_code(status, &err, &task); + char* buffer = alloca(n_recs * 1024 + 1); uint32_t the_ttl = AS_RECORD_NO_EXPIRE_TTL; @@ -239,11 +242,16 @@ query_foreach_create(void) } buffer[i * 1024] = '\0'; + // Make blob. + uint8_t blob[4]; + uint8_t* blob_ptr = blob; + *(uint32_t*)blob_ptr = 50000 + i; + // We only create the g bin for odd records. bool create_g_bin = i % 2 == 1; as_record r; - as_record_init(&r, 10 + (create_g_bin ? 1 : 0)); + as_record_init(&r, 11 + (create_g_bin ? 1 : 0)); as_record_set_str(&r, "a", a); as_record_set_int64(&r, "b", b); as_record_set_int64(&r, "c", c); @@ -256,7 +264,8 @@ query_foreach_create(void) as_record_set_list(&r, "x", (as_list *) &list); as_record_set_map(&r, "y", (as_map *) &map); as_record_set_list(&r, "z", (as_list *) &list2); - as_record_set_str(&r, "bigstr", buffer); + as_record_set_str(&r, "bigstr", buffer); + as_record_set_rawp(&r, "blob", blob_ptr, sizeof(uint32_t), false); r.ttl = the_ttl; @@ -355,6 +364,11 @@ query_foreach_destroy(void) info("error(%d): %s", err.code, err.message); } + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_blob_test"); + if (err.code != AEROSPIKE_OK) { + info("error(%d): %s", err.code, err.message); + } + return true; } @@ -1688,6 +1702,7 @@ TEST(query_list_ctx_is_string, "IN LIST count(*) where x[0] is 'x'") assert_int_eq(err.code, AEROSPIKE_OK); assert_int_eq(count, 34); + as_cdt_ctx_destroy(&ctx); as_query_destroy(&q); } @@ -1720,6 +1735,34 @@ TEST(query_map_ctx_is_string, "IN LIST count(*) where y['ykey'] is 'yvalue'") assert_int_eq(err.code, AEROSPIKE_OK); assert_int_eq(count, 15); + as_cdt_ctx_destroy(&ctx); + as_query_destroy(&q); +} + +TEST(query_blob_index, "query blob index") +{ + as_error err; + as_error_reset(&err); + + uint32_t count = 0; + + uint8_t blob[4]; + *((uint32_t*)blob) = 50003; + + as_query q; + as_query_init(&q, NAMESPACE, SET); + + as_query_select_inita(&q, 1); + as_query_select(&q, "blob"); + + as_query_where_inita(&q, 1); + as_query_where(&q, "blob", as_blob_equals(blob, 4, false)); + + aerospike_query_foreach(as, &err, NULL, &q, query_foreach_count_callback, &count); + + assert_int_eq(err.code, 0); + assert_int_eq(count, 1); + as_query_destroy(&q); } @@ -1807,4 +1850,5 @@ SUITE(query_foreach, "aerospike_query_foreach tests") suite_add(query_foreach_int_with_double_bin); suite_add(query_list_ctx_is_string); suite_add(query_map_ctx_is_string); + suite_add(query_blob_index); } From f64849ac45e72db301f40707f887ca5d3737c890 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Tue, 10 Oct 2023 18:31:26 -0700 Subject: [PATCH 14/35] CLIENT-2598 Support persistent map indexes. Requires server version 7.0+. --- src/include/aerospike/as_map_operations.h | 34 +++++++++++++++++ src/main/aerospike/as_map_operations.c | 46 ++++++++++++++++++++++- src/test/aerospike_map/map_basics.c | 2 +- 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/src/include/aerospike/as_map_operations.h b/src/include/aerospike/as_map_operations.h index e4528ed04..f661e58c0 100644 --- a/src/include/aerospike/as_map_operations.h +++ b/src/include/aerospike/as_map_operations.h @@ -351,6 +351,21 @@ as_map_policy_set(as_map_policy* policy, as_map_order order, as_map_write_mode m AS_EXTERN void as_map_policy_set_flags(as_map_policy* policy, as_map_order order, uint32_t flags); +/** + * Set map attributes to specified map order, write flags and whether to persist the map index. + * + * @param policy Target map policy. + * @param order Map order. + * @param flags Map write flags. See as_map_write_flags. + * @param persist_index If true, persist map index. A map index improves lookup performance, + * but requires more storage. A map index can be created for a top-level + * ordered map only. Nested and unordered map indexes are not supported. + * + * @ingroup map_operations + */ +AS_EXTERN void +as_map_policy_set_all(as_map_policy* policy, as_map_order order, uint32_t flags, bool persist_index); + /** * Create map create operation. * Server creates map at given context level. @@ -362,6 +377,25 @@ as_operations_map_create( as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_order order ); +/** + * Create map create operation. + * Server creates map at given context level. + * + * @param ops Target operations list. + * @param name Bin name. + * @param ctx Optional path to nested map. If not defined, the top-level map is used. + * @param order Map order. + * @param persist_index If true, persist map index. A map index improves lookup performance, + * but requires more storage. A map index can be created for a top-level + * ordered map only. Nested and unordered map indexes are not supported. + * + * @ingroup map_operations + */ +AS_EXTERN bool +as_operations_map_create_all( + as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_order order, bool persist_index + ); + /** * Create set map policy operation. * Server sets map policy attributes. Server does not return a value. diff --git a/src/main/aerospike/as_map_operations.c b/src/main/aerospike/as_map_operations.c index f2c8d9ef7..7aa238419 100644 --- a/src/main/aerospike/as_map_operations.c +++ b/src/main/aerospike/as_map_operations.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -130,6 +130,19 @@ as_map_policy_set_flags(as_map_policy* policy, as_map_order order, uint32_t flag policy->items_command = PUT_ITEMS; } +void +as_map_policy_set_all(as_map_policy* policy, as_map_order order, uint32_t flags, bool persist_index) +{ + policy->attributes = order; + + if (persist_index) { + policy->attributes |= 0x10; + } + policy->flags = flags; + policy->item_command = PUT; + policy->items_command = PUT_ITEMS; +} + bool as_operations_map_create( as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_order order @@ -151,14 +164,43 @@ as_operations_map_create( return as_cdt_add_packed(&pk, ops, name, AS_OPERATOR_MAP_MODIFY); } +bool +as_operations_map_create_all( + as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_order order, bool persist_index + ) +{ + // If context not defined, the set order for top-level bin list. + if (! ctx) { + as_map_policy policy; + as_map_policy_set_all(&policy, order, AS_MAP_UPDATE, persist_index); + return as_operations_map_set_policy(ops, name, NULL, &policy); + } + + uint32_t flag = as_map_order_to_flag(order); + + // Create nested map. persist_index does not apply here, so ignore it. + as_packer pk = as_cdt_begin(); + as_cdt_pack_header_flag(&pk, ctx, SET_TYPE, 1, flag); + as_pack_uint64(&pk, (uint64_t)order); + as_cdt_end(&pk); + return as_cdt_add_packed(&pk, ops, name, AS_OPERATOR_MAP_MODIFY); +} + bool as_operations_map_set_policy( as_operations* ops, const char* name, as_cdt_ctx* ctx, as_map_policy* policy ) { + uint64_t attr = policy->attributes; + + // Remove persist_index flag for nested maps. + if (ctx && (attr & 0x10) != 0) { + attr &= ~0x10; + } + as_packer pk = as_cdt_begin(); as_cdt_pack_header(&pk, ctx, SET_TYPE, 1); - as_pack_uint64(&pk, policy->attributes); + as_pack_uint64(&pk, attr); as_cdt_end(&pk); return as_cdt_add_packed(&pk, ops, name, AS_OPERATOR_MAP_MODIFY); } diff --git a/src/test/aerospike_map/map_basics.c b/src/test/aerospike_map/map_basics.c index ffe115ca6..cc0389430 100644 --- a/src/test/aerospike_map/map_basics.c +++ b/src/test/aerospike_map/map_basics.c @@ -2510,7 +2510,7 @@ TEST(map_create, "Map create") as_operations ops; as_operations_inita(&ops, 3); - as_operations_map_create(&ops, BIN_NAME, &ctx, AS_MAP_KEY_ORDERED); + as_operations_map_create_all(&ops, BIN_NAME, &ctx, AS_MAP_KEY_ORDERED, true); as_string k31; as_string_init(&k31, "key31", false); as_integer v31; From b7b3215eda3139a9bd9f28b9275f1e7548203f65 Mon Sep 17 00:00:00 2001 From: Kevin Porter Date: Thu, 12 Oct 2023 14:36:51 -0700 Subject: [PATCH 15/35] CLIENT-2605 Upgrade UDF module to Lua 5.4 to be consistent with Aerospike Server 7.0. Remove luajit submodule. Remove Lua 5.1 from the Windows aerospike-client-c-dependencies package. Build the lua submodule directly in Visual Studio, instead of relying on aerospike-client-c-dependencies package. Support parallel make (make -j). Drop support for Centos/RHEL 7. Drop support for Debian 10. Co-authored-by: Brian Nichols --- .build.yml | 4 - .github/workflows/build.yml | 6 +- .gitmodules | 4 - Makefile | 131 ++++-------- README.md | 30 --- examples/project/Makefile | 64 +----- modules/common | 2 +- modules/lua | 2 +- modules/mod-lua | 2 +- project/modules.mk | 130 +----------- project/rules.mk | 4 - project/settings.mk | 61 +----- project/test.mk | 10 +- vs/aerospike-test/aerospike-test.vcxproj | 4 +- vs/aerospike-test/packages.config | 2 +- vs/aerospike/aerospike.vcxproj | 68 ++++++- vs/aerospike/aerospike.vcxproj.filters | 192 ++++++++++++++++++ vs/aerospike/packages.config | 2 +- vs/examples/append/append.vcxproj | 4 +- vs/examples/append/packages.config | 2 +- .../async-batch-get/async-batch-get.vcxproj | 4 +- vs/examples/async-batch-get/packages.config | 2 +- .../async-delay-queue.vcxproj | 4 +- vs/examples/async-delay-queue/packages.config | 2 +- vs/examples/async-get/async-get.vcxproj | 4 +- vs/examples/async-get/packages.config | 2 +- vs/examples/async-query/async-query.vcxproj | 4 +- vs/examples/async-query/packages.config | 2 +- vs/examples/async-scan/async-scan.vcxproj | 4 +- vs/examples/async-scan/packages.config | 2 +- vs/examples/batch-get/batch-get.vcxproj | 4 +- vs/examples/batch-get/packages.config | 2 +- vs/examples/expire/expire.vcxproj | 4 +- vs/examples/expire/packages.config | 2 +- vs/examples/generation/generation.vcxproj | 4 +- vs/examples/generation/packages.config | 2 +- vs/examples/geo-filter/geo-filter.vcxproj | 4 +- vs/examples/geo-filter/packages.config | 2 +- vs/examples/geo-simple/geo-simple.vcxproj | 4 +- vs/examples/geo-simple/packages.config | 2 +- vs/examples/get/get.vcxproj | 4 +- vs/examples/get/packages.config | 2 +- vs/examples/incr/incr.vcxproj | 4 +- vs/examples/incr/packages.config | 2 +- vs/examples/list/list.vcxproj | 4 +- vs/examples/list/packages.config | 2 +- vs/examples/map/map.vcxproj | 4 +- vs/examples/map/packages.config | 2 +- vs/examples/put/packages.config | 2 +- vs/examples/put/put.vcxproj | 4 +- vs/examples/query-aggregate/packages.config | 2 +- .../query-aggregate/query-aggregate.vcxproj | 4 +- vs/examples/query/packages.config | 2 +- vs/examples/query/query.vcxproj | 4 +- vs/examples/scan-background/packages.config | 2 +- .../scan-background/scan-background.vcxproj | 4 +- vs/examples/scan/packages.config | 2 +- vs/examples/scan/scan.vcxproj | 4 +- vs/examples/touch/packages.config | 2 +- vs/examples/touch/touch.vcxproj | 4 +- vs/examples/udf/packages.config | 2 +- vs/examples/udf/udf.vcxproj | 4 +- vs/props/base.props | 4 +- 63 files changed, 387 insertions(+), 467 deletions(-) diff --git a/.build.yml b/.build.yml index a5268742d..52d33d0bf 100644 --- a/.build.yml +++ b/.build.yml @@ -2,20 +2,16 @@ name: aerospike-client-c container: - base: - - docker.qe.aerospike.com/build/aerospike-client-c:centos-7 - docker.qe.aerospike.com/build/aerospike-client-c:rhel-8 - docker.qe.aerospike.com/build/aerospike-client-c:rhel-9 - docker.qe.aerospike.com/build/aerospike-client-c:amazonlinux-2023 - - docker.qe.aerospike.com/build/aerospike-client-c:debian-10 - docker.qe.aerospike.com/build/aerospike-client-c:debian-11 - docker.qe.aerospike.com/build/aerospike-client-c:debian-12 - docker.qe.aerospike.com/build/aerospike-client-c:ubuntu-20.04 - docker.qe.aerospike.com/build/aerospike-client-c:ubuntu-22.04 - - docker.qe.aerospike.com/build/aerospike-client-c:arm-centos-7 - docker.qe.aerospike.com/build/aerospike-client-c:arm-rhel-8 - docker.qe.aerospike.com/build/aerospike-client-c:arm-rhel-9 - docker.qe.aerospike.com/build/aerospike-client-c:arm-amazonlinux-2023 - - docker.qe.aerospike.com/build/aerospike-client-c:arm-debian-10 - docker.qe.aerospike.com/build/aerospike-client-c:arm-debian-11 - docker.qe.aerospike.com/build/aerospike-client-c:arm-debian-12 - docker.qe.aerospike.com/build/aerospike-client-c:arm-ubuntu-20.04 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c85ed142e..4ae8d7c70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,11 +2,9 @@ name: Aerospike C Client Tests on: push: - branches: - - master + branches: [master, stage] pull_request: - branches: - - master + branches: [master, stage] jobs: build: diff --git a/.gitmodules b/.gitmodules index e4aba31e3..08c9c55ed 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,7 +10,3 @@ path = modules/lua url = https://github.com/aerospike/lua.git ignore = dirty -[submodule "modules/luajit"] - path = modules/luajit - url = https://github.com/aerospike/luajit.git - ignore = dirty diff --git a/Makefile b/Makefile index 4df1be6c8..da78c30a6 100644 --- a/Makefile +++ b/Makefile @@ -4,47 +4,32 @@ include project/settings.mk # Modules -COMMON := modules/common -LUAMOD := modules/lua -LUAJIT := modules/luajit -MOD_LUA := modules/mod-lua -MODULES := COMMON MOD_LUA - -# Use the Lua submodule? [By default, yes.] -USE_LUAMOD = 1 - -# Use LuaJIT instead of Lua? [By default, no.] -USE_LUAJIT = 0 - -# Permit easy overriding of the default. -ifeq ($(USE_LUAJIT),1) - USE_LUAMOD = 0 -endif - -ifeq ($(and $(USE_LUAMOD:0=),$(USE_LUAJIT:0=)),1) - $(error Only at most one of USE_LUAMOD or USE_LUAJIT may be enabled (i.e., set to 1.)) -else - ifeq ($(USE_LUAMOD),1) - MODULES += LUAMOD - else - ifeq ($(USE_LUAJIT),1) - MODULES += LUAJIT - endif - endif -endif +COMMON := $(abspath modules/common) +LUAMOD := $(abspath modules/lua) +MOD_LUA := $(abspath modules/mod-lua) +MODULES := COMMON +MODULES += MOD_LUA # Override optimizations via: make O=n O = 3 # Make-local Compiler Flags +EXT_CFLAGS = CC_FLAGS = -std=gnu99 -g -Wall -fPIC -O$(O) CC_FLAGS += -fno-common -fno-strict-aliasing CC_FLAGS += -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE $(EXT_CFLAGS) ifeq ($(ARCH),x86_64) - CC_FLAGS += -march=nocona + REAL_ARCH = -march=nocona +endif + +ifeq ($(ARCH),aarch64) + REAL_ARCH = -mcpu=neoverse-n1 endif +CC_CFLAGS += $(REAL_ARCH) +EVENT_LIB = + ifeq ($(EVENT_LIB),libev) CC_FLAGS += -DAS_USE_LIBEV endif @@ -59,12 +44,13 @@ endif ifeq ($(OS),Darwin) CC_FLAGS += -D_DARWIN_UNLIMITED_SELECT -I/usr/local/include + LUA_PLATFORM = LUA_USE_MACOSX ifneq ($(wildcard /opt/homebrew/include),) # Mac new homebrew external include path CC_FLAGS += -I/opt/homebrew/include else ifneq ($(wildcard /usr/local/opt/libevent/include),) - # Mac old homebrew libevent include path + # Mac old homebrew libevent include path CC_FLAGS += -I/usr/local/opt/libevent/include endif @@ -78,14 +64,12 @@ ifeq ($(OS),Darwin) # macports openssl include path CC_FLAGS += -I/opt/local/include endif - - LUA_PLATFORM = macosx else ifeq ($(OS),FreeBSD) CC_FLAGS += -finline-functions -I/usr/local/include - LUA_PLATFORM = freebsd + LUA_PLATFORM = LUA_USE_LINUX # nothing BSD specific in luaconf.h else CC_FLAGS += -finline-functions -rdynamic - LUA_PLATFORM = linux + LUA_PLATFORM = LUA_USE_LINUX ifneq ($(wildcard /etc/alpine-release),) CC_FLAGS += -DAS_ALPINE @@ -93,7 +77,7 @@ else endif # Linker flags -LD_FLAGS = $(LDFLAGS) +LD_FLAGS = $(LDFLAGS) ifeq ($(OS),Darwin) LD_FLAGS += -undefined dynamic_lookup @@ -107,37 +91,9 @@ ifdef DEBUG endif # Include Paths -INC_PATH += $(COMMON)/$(TARGET_INCL) -INC_PATH += $(MOD_LUA)/$(TARGET_INCL) - -# Library Paths -# LIB_PATH += - -ifeq ($(USE_LUAMOD),1) - INC_PATH += $(LUAMOD)/src -else - ifeq ($(USE_LUAJIT),1) - INC_PATH += $(LUAJIT)/src - else - # Find where the Lua development package is installed in the build environment. - INC_PATH += $(or \ - $(wildcard /usr/include/lua-5.1), \ - $(wildcard /usr/include/lua5.1)) - INCLUDE_LUA_5_1 = /usr/include/lua5.1 - ifneq ($(wildcard $(INCLUDE_LUA_5_1)),) - LUA_SUFFIX=5.1 - endif - ifeq ($(OS),Darwin) - ifneq ($(wildcard /usr/local/include),) - INC_PATH += /usr/local/include - endif - ifneq ($(wildcard /usr/local/lib),) - LIB_LUA = -L/usr/local/lib - endif - endif - LIB_LUA += -llua$(LUA_SUFFIX) - endif -endif +INC_PATH += $(COMMON)/$(SOURCE_INCL) +INC_PATH += $(MOD_LUA)/$(SOURCE_INCL) +INC_PATH += $(LUAMOD) ############################################################################### ## OBJECTS ## @@ -203,20 +159,14 @@ AEROSPIKE += version.o OBJECTS := OBJECTS += $(AEROSPIKE:%=$(TARGET_OBJ)/aerospike/%) -DEPS := +DEPS = DEPS += $(COMMON)/$(TARGET_OBJ)/common/aerospike/*.o DEPS += $(COMMON)/$(TARGET_OBJ)/common/citrusleaf/*.o DEPS += $(MOD_LUA)/$(TARGET_OBJ)/*.o -ifeq ($(USE_LUAMOD),1) - LUA_DYNAMIC_OBJ = $(filter-out $(LUAMOD)/src/lua.o $(LUAMOD)/src/luac.o, $(shell ls $(LUAMOD)/src/*.o)) - LUA_STATIC_OBJ = $(LUA_DYNAMIC_OBJ) -else - ifeq ($(USE_LUAJIT),1) - LUA_DYNAMIC_OBJ = $(shell ls $(LUAJIT)/src/*_dyn.o) - LUA_STATIC_OBJ = $(filter-out $(LUA_DYNAMIC_OBJ) $(LUAJIT)/src/luajit.o, $(shell ls $(LUAJIT)/src/*.o)) - endif -endif +EXP_DEPS := $(foreach DD, $(DEPS), $(wildcard $(DEP))) + +LUA_OBJECTS = $(filter-out $(LUAMOD)/lua.o, $(shell ls $(LUAMOD)/*.o)) ############################################################################### ## HEADERS ## @@ -233,8 +183,9 @@ COMMON-HEADERS += $(COMMON)/$(SOURCE_INCL)/citrusleaf/cf_queue.h EXCLUDE-HEADERS = -HEADERS := -HEADERS += $(filter-out $(EXCLUDE-HEADERS), $(wildcard $(SOURCE_INCL)/aerospike/*.h)) +AEROSPIKE-HEADERS := $(filter-out $(EXCLUDE-HEADERS), $(wildcard $(SOURCE_INCL)/aerospike/*.h)) + +HEADERS := $(AEROSPIKE-HEADERS) HEADERS += $(COMMON-HEADERS) ############################################################################### @@ -256,8 +207,7 @@ version: build: libaerospike .PHONY: prepare -prepare: modules-prepare $(subst $(SOURCE_INCL),$(TARGET_INCL),$(HEADERS)) - $(noop) +prepare: modules-prepare $(subst $(SOURCE_INCL),$(TARGET_INCL),$(AEROSPIKE-HEADERS)) .PHONY: prepare-clean prepare-clean: @@ -298,23 +248,18 @@ tags etags: ## BUILD TARGETS ## ############################################################################### -$(TARGET_OBJ)/%.o: $(COMMON)/$(TARGET_LIB)/libaerospike-common.a $(MOD_LUA)/$(TARGET_LIB)/libmod_lua.a $(SOURCE_MAIN)/%.c $(SOURCE_INCL)/citrusleaf/*.h | modules +$(TARGET_OBJ)/aerospike/%.o: $(SOURCE_MAIN)/aerospike/%.c $(object) -$(TARGET_OBJ)/aerospike/%.o: $(COMMON)/$(TARGET_LIB)/libaerospike-common.a $(MOD_LUA)/$(TARGET_LIB)/libmod_lua.a $(SOURCE_MAIN)/aerospike/%.c $(SOURCE_INCL)/citrusleaf/*.h $(SOURCE_INCL)/aerospike/*.h | modules - $(object) - -$(TARGET_LIB)/libaerospike.$(DYNAMIC_SUFFIX): $(OBJECTS) | modules - $(library) $(DEPS) $(LUA_DYNAMIC_OBJ) - -$(TARGET_LIB)/libaerospike.a: $(OBJECTS) | modules - $(archive) $(DEPS) $(LUA_STATIC_OBJ) +$(TARGET_LIB)/libaerospike.$(DYNAMIC_SUFFIX): $(OBJECTS) $(EXP_DEPS) | modules + $(library) $(DEPS) $(LUA_OBJECTS) -$(TARGET_INCL)/aerospike: | $(TARGET_INCL) - mkdir $@ +$(TARGET_LIB)/libaerospike.a: $(OBJECTS) $(EXP_DEPS) | modules + $(archive) $(DEPS) $(LUA_OBJECTS) -$(TARGET_INCL)/aerospike/%.h: $(SOURCE_INCL)/aerospike/%.h | $(TARGET_INCL)/aerospike - cp -p $^ $@ +$(TARGET_INCL)/aerospike/%.h: $(SOURCE_INCL)/aerospike/%.h + @mkdir -p $(@D) + cp -p $< $@ ############################################################################### include project/modules.mk project/test.mk project/rules.mk diff --git a/README.md b/README.md index 9d98de165..03c21f6b7 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,11 @@ are also included. [Also do on Ubuntu:] $ sudo apt-get install ncurses-dev - [Optional:] - $ sudo apt-get install liblua5.1-dev - ### Red Hat Enterprise Linux, CentOS and Amazon Linux $ sudo yum install openssl-devel glibc-devel autoconf automake libtool [Optional:] - $ sudo yum install lua-devel $ sudo yum install gcc-c++ graphviz rpm-build ### Fedora @@ -30,7 +26,6 @@ are also included. $ sudo yum install openssl-devel glibc-devel autoconf automake libtool [Optional:] - $ sudo yum install compat-lua-devel-5.1.5 $ sudo yum install gcc-c++ graphviz rpm-build ### MacOS @@ -154,31 +149,6 @@ To install header files and library on the current machine: $ sudo make install -## Lua - -The C client requires [Lua](http://www.lua.org) 5.1 support for the -client-side portion of User Defined Function (UDF) query aggregation. -By default, the C client builds with Lua support provided by the -included `lua` submodule. - -Optionally, Lua support may be provided by either the included `luajit` -submodule or by the build environment. - -To enable [LuaJIT](http://luajit.org) 2.0.3, the build must be performed -with the `USE_LUAJIT=1` option passed on all relevant `make` command -lines (i.e., the C client itself and API examples). -[Note that on some platforms, [Valgrind](http://www.valgrind.org) -may not function out-of-the-box on applications built with the C client -when LuaJIT is enabled without using an unreleased version of LuaJIT -built with additional options.] - -To use Lua provided by the development environment, either the `lua5.1` -development package may be installed (on platforms that have it), or -else Lua 5.1.5 may be built from the source release and installed into -the standard location (usually `/usr/local/`.) In either of these two -cases, the build must be performed with the option `USE_LUAMOD=0` passed -on all relevant `make` command lines. - ## Package Installer packages can be created for RedHat (rpm), Debian (deb), Mac OS X (pkg). diff --git a/examples/project/Makefile b/examples/project/Makefile index 6cbb19ddc..ee0666a5a 100644 --- a/examples/project/Makefile +++ b/examples/project/Makefile @@ -20,12 +20,12 @@ endif ifeq ($(OS),Darwin) CC_FLAGS += -D_DARWIN_UNLIMITED_SELECT - + ifneq ($(wildcard /opt/homebrew/include),) # Mac new homebrew external include path CC_FLAGS += -I/opt/homebrew/include else ifneq ($(wildcard /usr/local/opt/libevent/include),) - # Mac old homebrew libevent include path + # Mac old homebrew libevent include path CC_FLAGS += -I/usr/local/opt/libevent/include endif @@ -69,7 +69,7 @@ ifeq ($(OS),Darwin) else # Mac old homebrew external lib path LD_FLAGS += -L/usr/local/lib - + ifeq ($(EVENT_LIB),libevent) LD_FLAGS += -L/usr/local/opt/libevent/lib endif @@ -82,11 +82,7 @@ ifeq ($(OS),Darwin) # Mac old homebrew openssl lib path LD_FLAGS += -L/usr/local/opt/openssl/lib endif - - ifeq ($(USE_LUAJIT),1) - LD_FLAGS += -pagezero_size 10000 -image_base 100000000 - endif - + LINK_SUFFIX = else ifeq ($(OS),FreeBSD) LD_FLAGS += -L/usr/local/lib @@ -108,7 +104,7 @@ ifeq ($(EVENT_LIB),libevent) LD_FLAGS += -levent_core -levent_pthreads endif -LD_FLAGS += -lssl -lcrypto $(LIB_LUA) -lpthread -lm -lz $(LINK_SUFFIX) +LD_FLAGS += -lssl -lcrypto -lpthread -lm -lz $(LINK_SUFFIX) ifeq ($(OS),Linux) LD_FLAGS += -lrt -ldl @@ -116,56 +112,6 @@ else ifeq ($(OS),FreeBSD) LD_FLAGS += -lrt endif -# Use the Lua submodule? [By default, yes.] -USE_LUAMOD = 1 - -# Use LuaJIT instead of Lua? [By default, no.] -USE_LUAJIT = 0 - -# Permit easy overriding of the default. -ifeq ($(USE_LUAJIT),1) - USE_LUAMOD = 0 -endif - -ifeq ($(and $(USE_LUAMOD:0=),$(USE_LUAJIT:0=)),1) - $(error Only at most one of USE_LUAMOD or USE_LUAJIT may be enabled (i.e., set to 1.)) -endif - -ifeq ($(USE_LUAJIT),1) - ifeq ($(OS),Darwin) - LD_FLAGS += -pagezero_size 10000 -image_base 100000000 - endif -else - ifeq ($(USE_LUAMOD),0) - # Find where the Lua development package is installed in the build environment. - ifeq ($(OS),Darwin) - LUA_LIBPATH = $(or \ - $(wildcard /usr/local/lib/liblua.5.1.dylib), \ - $(wildcard /usr/local/lib/liblua.5.1.a), \ - $(wildcard /usr/local/lib/liblua.dylib), \ - $(wildcard /usr/local/lib/liblua.a), \ - $(error Cannot find liblua 5.1)) - LUA_LIBDIR = $(dir $(LUA_LIBPATH)) - LUA_LIB = $(patsubst lib%,%,$(basename $(notdir $(LUA_LIBPATH)))) - else - # Linux - LUA_LIBPATH = $(or \ - $(wildcard /usr/lib/liblua5.1.so), \ - $(wildcard /usr/lib/liblua5.1.a), \ - $(wildcard /usr/lib/x86_64-linux-gnu/liblua5.1.so), \ - $(wildcard /usr/lib/x86_64-linux-gnu/liblua5.1.a), \ - $(wildcard /usr/lib64/liblua-5.1.so), \ - $(wildcard /usr/lib64/liblua-5.1.a), \ - $(wildcard /usr/lib/liblua.so), \ - $(wildcard /usr/lib/liblua.a), \ - $(error Cannot find liblua 5.1)) - LUA_LIBDIR = $(dir $(LUA_LIBPATH)) - LUA_LIB = $(patsubst lib%,%,$(basename $(notdir $(LUA_LIBPATH)))) - endif - LD_FLAGS += -L$(LUA_LIBDIR) -l$(LUA_LIB) - endif -endif - LD_FLAGS += -lm -lz CC = cc diff --git a/modules/common b/modules/common index c9144779e..4d829e138 160000 --- a/modules/common +++ b/modules/common @@ -1 +1 @@ -Subproject commit c9144779e6983357fa57a54f0914994c244ae25e +Subproject commit 4d829e1380676cf19c0607f05234a13efaff0045 diff --git a/modules/lua b/modules/lua index e0725f737..644318516 160000 --- a/modules/lua +++ b/modules/lua @@ -1 +1 @@ -Subproject commit e0725f73702f6d1cebd7042064d6303a583b6fd6 +Subproject commit 6443185167c77adcc8552a3fee7edab7895db1a9 diff --git a/modules/mod-lua b/modules/mod-lua index 15ecea2c5..57fdeaa27 160000 --- a/modules/mod-lua +++ b/modules/mod-lua @@ -1 +1 @@ -Subproject commit 15ecea2c50b515744c2f55ab17c63b951d8baf2e +Subproject commit 57fdeaa27885b1ba8c519b619620ffbea8c86041 diff --git a/project/modules.mk b/project/modules.mk index 44ea85303..5862235e1 100644 --- a/project/modules.mk +++ b/project/modules.mk @@ -37,7 +37,7 @@ $(COMMON)/$(TARGET_LIB)/libaerospike-common.a: .PHONY: COMMON-prepare COMMON-prepare: $(COMMON-TARGET) - $(noop) + $(MAKE) -e -C $(COMMON) prepare $(TARGET_INCL)/%.h: $(COMMON)/$(SOURCE_INCL)/%.h @mkdir -p $(@D) @@ -68,137 +68,15 @@ ifeq ($(wildcard $(MOD_LUA)/Makefile),) $(error ) endif -ifeq ($(COMMON),$(abspath $(COMMON))) - COMMON_PATH = $(COMMON) -else - COMMON_PATH = ../../$(COMMON) -endif - -ifeq ($(LUAJIT),$(abspath $(LUAJIT))) - LUAJIT_PATH = $(LUAJIT) -else - LUAJIT_PATH = ../../$(LUAJIT) -endif - -ifeq ($(LUAMOD),$(abspath $(LUAMOD))) - LUAMOD_PATH = $(LUAMOD) -else - LUAMOD_PATH = ../../$(LUAMOD) -endif - .PHONY: MOD_LUA-build MOD_LUA-build: $(MOD_LUA)/$(TARGET_LIB)/libmod_lua.a .PHONY: MOD_LUA-clean MOD_LUA-clean: - $(MAKE) -e -C $(MOD_LUA) clean COMMON=$(COMMON_PATH) USE_LUAJIT=$(USE_LUAJIT) LUAJIT=$(LUAJIT_PATH) USE_LUAMOD=$(USE_LUAMOD) LUAMOD=$(LUAMOD_PATH) + $(MAKE) -e -C $(MOD_LUA) clean COMMON=$(COMMON) LUAMOD=$(LUAMOD) $(MOD_LUA)/$(TARGET_LIB)/libmod_lua.a: - $(MAKE) -e -C $(MOD_LUA) libmod_lua.a COMMON=$(COMMON_PATH) USE_LUAJIT=$(USE_LUAJIT) LUAJIT=$(LUAJIT_PATH) USE_LUAMOD=$(USE_LUAMOD) LUAMOD=$(LUAMOD_PATH) EXT_CFLAGS=-DAS_MOD_LUA_CLIENT + $(MAKE) -e -C $(MOD_LUA) COMMON=$(COMMON) LUAMOD=$(LUAMOD) EXT_CFLAGS=-DAS_MOD_LUA_CLIENT .PHONY: MOD_LUA-prepare -MOD_LUA-prepare: MOD_LUA-make-prepare - $(noop) - -.PHONY: MOD_LUA-make-prepare -MOD_LUA-make-prepare: - @$(MAKE) -e -C $(MOD_LUA) prepare COMMON=$(COMMON_PATH) USE_LUAJIT=$(USE_LUAJIT) LUAJIT=$(LUAJIT_PATH) USE_LUAMOD=$(USE_LUAMOD) LUAMOD=$(LUAMOD_PATH) - -############################################################################### -## LUA MODULE ## -############################################################################### - -ifeq ($(USE_LUAMOD),1) - ifndef LUAMOD - $(warning ***************************************************************) - $(warning *) - $(warning * LUAMOD is not defined. ) - $(warning * LUAMOD should be set to a valid path. ) - $(warning *) - $(warning ***************************************************************) - $(error ) - endif - - ifeq ($(wildcard $(LUAMOD)/Makefile),) - $(warning ***************************************************************) - $(warning *) - $(warning * LUAMOD is '$(LUAMOD)') - $(warning * LUAMOD doesn't contain 'Makefile'. ) - $(warning * LUAMOD should be set to a valid path. ) - $(warning *) - $(warning ***************************************************************) - $(error ) - endif -endif - -.PHONY: LUAMOD-build -LUAMOD-build: $(LUAMOD)/src/liblua.a - -$(LUAMOD)/src/liblua.a: $(LUAMOD)/src/luaconf.h -ifeq ($(USE_LUAMOD),1) - ifeq ($(OS),FreeBSD) - $(MAKE) CC=$(CC) CFLAGS="-O2 -Wall -fPIC -DLUA_USE_LINUX" -C $(LUAMOD) $(LUA_PLATFORM) - else - $(MAKE) -C $(LUAMOD) $(LUA_PLATFORM) - endif -endif - -$(LUAMOD)/src/luaconf.h: $(LUAMOD)/src/luaconf.h.orig -ifeq ($(USE_LUAMOD),1) - (cd $(LUAMOD)/src; rm -f $(notdir $@); ln -s $(notdir $<) $(notdir $@)) -endif - -.PHONY: LUAMOD-clean -LUAMOD-clean: -ifeq ($(USE_LUAMOD),1) - $(MAKE) -e -C $(LUAMOD) clean - rm -f $(LUAMOD)/src/luaconf.h -endif - -.PHONY: LUAMOD-prepare -LUAMOD-prepare: $(LUAMOD)/src/luaconf.h - -############################################################################### -## LUA JIT MODULE ## -############################################################################### - -ifeq ($(USE_LUAJIT),1) - ifndef LUAJIT - $(warning ***************************************************************) - $(warning *) - $(warning * LUAJIT is not defined. ) - $(warning * LUAJIT should be set to a valid path. ) - $(warning *) - $(warning ***************************************************************) - $(error ) - endif - - ifeq ($(wildcard $(LUAJIT)/Makefile),) - $(warning ***************************************************************) - $(warning *) - $(warning * LUAJIT is '$(LUAJIT)') - $(warning * LUAJIT doesn't contain 'Makefile'. ) - $(warning * LUAJIT should be set to a valid path. ) - $(warning *) - $(warning ***************************************************************) - $(error ) - endif -endif - -.PHONY: LUAJIT-build -LUAJIT-build: $(LUAJIT)/src/libluajit.a - -$(LUAJIT)/src/libluajit.a: $(LUAJIT)/src/luaconf.h -ifeq ($(USE_LUAJIT),1) - $(MAKE) -C $(LUAJIT) Q= TARGET_SONAME=libluajit.so CCDEBUG=-g CFLAGS= LDFLAGS= -endif - -.PHONY: LUAJIT-clean -LUAJIT-clean: -ifeq ($(USE_LUAJIT),1) - $(MAKE) -e -C $(LUAJIT) clean - (cd $(LUAJIT)/src; $(RM) $(LUAJIT)/src/libluajit.a) -endif - -.PHONY: LUAJIT-prepare -LUAJIT-prepare: + $(MAKE) -e -C $(MOD_LUA) prepare COMMON=$(COMMON) LUAMOD=$(LUAMOD) diff --git a/project/rules.mk b/project/rules.mk index be9bfae3a..589bef297 100644 --- a/project/rules.mk +++ b/project/rules.mk @@ -50,10 +50,6 @@ info: @echo " flags: " $(AR_FLAGS) $(ARFLAGS) @echo -.PHONY: $(TARGET_OBJ)/%.o -$(TARGET_OBJ)/%.o : %.c | $(TARGET_OBJ) - $(object) - ############################################################################### ## MODULE RULES ## ############################################################################### diff --git a/project/settings.mk b/project/settings.mk index 2d5f036d7..ac5cb2fd2 100644 --- a/project/settings.mk +++ b/project/settings.mk @@ -18,8 +18,7 @@ PROJECT = project MODULES = modules SOURCE = src TARGET = target - -MODULES = +LIBRARIES = ############################################################################### ## BUILD TOOLS ## @@ -71,55 +70,10 @@ TARGET_TEST = $(TARGET_BASE)/test ## FUNCTIONS ## ############################################################################### -# -# Builds an object, library, archive or executable using the dependencies specified for the target. -# -# x: [dependencies] -# $(call , include_paths, library_paths, libraries, flags) -# -# Commands: -# build - Automatically determine build type based on target name. -# object - Build an object: .o -# library - Build a dynamic shared library: .so -# archive - Build a static library (archive): .a -# executable - Build an executable -# -# Arguments: -# include_paths - Space separated list of search paths for include files. -# Relative paths are relative to the project root. -# library_paths - Space separated list of search paths for libraries. -# Relative paths are relative to the project root. -# libraries - space separated list of libraries. -# flags - space separated list of linking flags. -# -# You can optionally define variables, rather than arguments as: -# -# X_inc_path = [include_paths] -# X_lib_path = [library_paths] -# X_lib = [libraries] -# X_flags = [flags] -# -# Where X is the name of the build target. -# - -define build - $(if $(filter .o,$(suffix $@)), - $(call object, $(1),$(2),$(3),$(4)), - $(if $(filter .so,$(suffix $@)), - $(call library, $(1),$(2),$(3),$(4)), - $(if $(filter .a,$(suffix $@)), - $(call archive, $(1),$(2),$(3),$(4)), - $(call executable, $(1),$(2),$(3),$(4)) - ) - ) - ) -endef - define executable @if [ ! -d `dirname $@` ]; then mkdir -p `dirname $@`; fi $(strip $(CC) \ $(addprefix -I, $(INC_PATH)) \ - $(addprefix -L, $(SUBMODULES:%=%/$(TARGET_LIB))) \ $(addprefix -L, $(LIB_PATH)) \ $(addprefix -l, $(LIBRARIES)) \ $(CC_FLAGS) \ @@ -145,12 +99,12 @@ define library @if [ ! -d `dirname $@` ]; then mkdir -p `dirname $@`; fi $(strip $(CC) $(DYNAMIC_FLAG) \ $(addprefix -I, $(INC_PATH)) \ - $(addprefix -L, $(SUBMODULES:%=%/$(TARGET_LIB))) \ $(addprefix -L, $(LIB_PATH)) \ $(addprefix -l, $(LIBRARIES)) \ + $(LD_FLAGS) \ + $(LDFLAGS) \ -o $@ \ $(filter %.o, $^) \ - $(LD_FLAGS) \ ) endef @@ -158,7 +112,6 @@ define object @if [ ! -d `dirname $@` ]; then mkdir -p `dirname $@`; fi $(strip $(CC) \ $(addprefix -I, $(INC_PATH)) \ - $(addprefix -L, $(SUBMODULES:%=%/$(TARGET_LIB))) \ $(addprefix -L, $(LIB_PATH)) \ $(CC_FLAGS) \ $(CFLAGS) \ @@ -166,11 +119,3 @@ define object -c $(filter %.c %.cpp, $^) \ ) endef - -define make_each - @for i in $(1); do \ - if [ -e "$$i/Makefile" ]; then \ - make -C $$i $(2);\ - fi \ - done; -endef diff --git a/project/test.mk b/project/test.mk index 1a9555da0..9b6397fcf 100644 --- a/project/test.mk +++ b/project/test.mk @@ -40,7 +40,7 @@ ifeq ($(OS),Darwin) else # Mac old homebrew external lib path TEST_LDFLAGS += -L/usr/local/lib - + ifeq ($(EVENT_LIB),libevent) TEST_LDFLAGS += -L/usr/local/opt/libevent/lib endif @@ -53,11 +53,7 @@ ifeq ($(OS),Darwin) # Mac old homebrew openssl lib path TEST_LDFLAGS += -L/usr/local/opt/openssl/lib endif - - ifeq ($(USE_LUAJIT),1) - TEST_LDFLAGS += -pagezero_size 10000 -image_base 100000000 - endif - + LINK_SUFFIX = else ifeq ($(OS),FreeBSD) TEST_LDFLAGS += -L/usr/local/lib @@ -79,7 +75,7 @@ ifeq ($(EVENT_LIB),libevent) TEST_LDFLAGS += -levent_core -levent_pthreads endif -TEST_LDFLAGS += -lssl -lcrypto $(LIB_LUA) -lpthread -lm -lz $(LINK_SUFFIX) +TEST_LDFLAGS += -lssl -lcrypto -lpthread -lm -lz $(LINK_SUFFIX) AS_HOST := 127.0.0.1 AS_PORT := 3000 diff --git a/vs/aerospike-test/aerospike-test.vcxproj b/vs/aerospike-test/aerospike-test.vcxproj index a30bd1944..4dc94a5ca 100644 --- a/vs/aerospike-test/aerospike-test.vcxproj +++ b/vs/aerospike-test/aerospike-test.vcxproj @@ -291,12 +291,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/aerospike-test/packages.config b/vs/aerospike-test/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/aerospike-test/packages.config +++ b/vs/aerospike-test/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/aerospike/aerospike.vcxproj b/vs/aerospike/aerospike.vcxproj index daf37b941..576625189 100644 --- a/vs/aerospike/aerospike.vcxproj +++ b/vs/aerospike/aerospike.vcxproj @@ -152,7 +152,7 @@ ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) @@ -332,6 +332,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -440,6 +468,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -513,12 +575,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/aerospike/aerospike.vcxproj.filters b/vs/aerospike/aerospike.vcxproj.filters index 60e2f3af7..da0791309 100644 --- a/vs/aerospike/aerospike.vcxproj.filters +++ b/vs/aerospike/aerospike.vcxproj.filters @@ -34,6 +34,12 @@ {a5ec2876-755e-4e48-a853-7a10c271fcbc} + + {ebc519ab-6c78-43e7-bf69-d67a07529449} + + + {60b7698e-9072-4cb2-bf4c-b4490f325143} + @@ -405,6 +411,90 @@ Header Files\common\aerospike + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + + + Header Files\lua + @@ -749,6 +839,108 @@ Source Files\common\aerospike + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + + + Source Files\lua + diff --git a/vs/aerospike/packages.config b/vs/aerospike/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/aerospike/packages.config +++ b/vs/aerospike/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/append/append.vcxproj b/vs/examples/append/append.vcxproj index 17ddd70a4..df47307a8 100644 --- a/vs/examples/append/append.vcxproj +++ b/vs/examples/append/append.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/append/packages.config b/vs/examples/append/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/append/packages.config +++ b/vs/examples/append/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/async-batch-get/async-batch-get.vcxproj b/vs/examples/async-batch-get/async-batch-get.vcxproj index cfebd7dda..1c41df8c5 100644 --- a/vs/examples/async-batch-get/async-batch-get.vcxproj +++ b/vs/examples/async-batch-get/async-batch-get.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/async-batch-get/packages.config b/vs/examples/async-batch-get/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/async-batch-get/packages.config +++ b/vs/examples/async-batch-get/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/async-delay-queue/async-delay-queue.vcxproj b/vs/examples/async-delay-queue/async-delay-queue.vcxproj index 59659eaaf..42885675c 100644 --- a/vs/examples/async-delay-queue/async-delay-queue.vcxproj +++ b/vs/examples/async-delay-queue/async-delay-queue.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/async-delay-queue/packages.config b/vs/examples/async-delay-queue/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/async-delay-queue/packages.config +++ b/vs/examples/async-delay-queue/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/async-get/async-get.vcxproj b/vs/examples/async-get/async-get.vcxproj index f3893a275..397df48c1 100644 --- a/vs/examples/async-get/async-get.vcxproj +++ b/vs/examples/async-get/async-get.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/async-get/packages.config b/vs/examples/async-get/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/async-get/packages.config +++ b/vs/examples/async-get/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/async-query/async-query.vcxproj b/vs/examples/async-query/async-query.vcxproj index 2dac593fd..816d7aba9 100644 --- a/vs/examples/async-query/async-query.vcxproj +++ b/vs/examples/async-query/async-query.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/async-query/packages.config b/vs/examples/async-query/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/async-query/packages.config +++ b/vs/examples/async-query/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/async-scan/async-scan.vcxproj b/vs/examples/async-scan/async-scan.vcxproj index ca01b819c..cdaa52ebe 100644 --- a/vs/examples/async-scan/async-scan.vcxproj +++ b/vs/examples/async-scan/async-scan.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/async-scan/packages.config b/vs/examples/async-scan/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/async-scan/packages.config +++ b/vs/examples/async-scan/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/batch-get/batch-get.vcxproj b/vs/examples/batch-get/batch-get.vcxproj index fe8616e0e..efac91d9e 100644 --- a/vs/examples/batch-get/batch-get.vcxproj +++ b/vs/examples/batch-get/batch-get.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/batch-get/packages.config b/vs/examples/batch-get/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/batch-get/packages.config +++ b/vs/examples/batch-get/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/expire/expire.vcxproj b/vs/examples/expire/expire.vcxproj index 3e9f1cd56..44d32711b 100644 --- a/vs/examples/expire/expire.vcxproj +++ b/vs/examples/expire/expire.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/expire/packages.config b/vs/examples/expire/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/expire/packages.config +++ b/vs/examples/expire/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/generation/generation.vcxproj b/vs/examples/generation/generation.vcxproj index 81ea3ed80..34aa0b223 100644 --- a/vs/examples/generation/generation.vcxproj +++ b/vs/examples/generation/generation.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/generation/packages.config b/vs/examples/generation/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/generation/packages.config +++ b/vs/examples/generation/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/geo-filter/geo-filter.vcxproj b/vs/examples/geo-filter/geo-filter.vcxproj index 258cb7353..b081594b4 100644 --- a/vs/examples/geo-filter/geo-filter.vcxproj +++ b/vs/examples/geo-filter/geo-filter.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/geo-filter/packages.config b/vs/examples/geo-filter/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/geo-filter/packages.config +++ b/vs/examples/geo-filter/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/geo-simple/geo-simple.vcxproj b/vs/examples/geo-simple/geo-simple.vcxproj index 8592756ae..0e1785909 100644 --- a/vs/examples/geo-simple/geo-simple.vcxproj +++ b/vs/examples/geo-simple/geo-simple.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/geo-simple/packages.config b/vs/examples/geo-simple/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/geo-simple/packages.config +++ b/vs/examples/geo-simple/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/get/get.vcxproj b/vs/examples/get/get.vcxproj index 748ce0256..f3680db55 100644 --- a/vs/examples/get/get.vcxproj +++ b/vs/examples/get/get.vcxproj @@ -226,12 +226,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/get/packages.config b/vs/examples/get/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/get/packages.config +++ b/vs/examples/get/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/incr/incr.vcxproj b/vs/examples/incr/incr.vcxproj index 9642f500c..db060ce69 100644 --- a/vs/examples/incr/incr.vcxproj +++ b/vs/examples/incr/incr.vcxproj @@ -243,12 +243,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/incr/packages.config b/vs/examples/incr/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/incr/packages.config +++ b/vs/examples/incr/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/list/list.vcxproj b/vs/examples/list/list.vcxproj index b52100e94..acb2ea033 100644 --- a/vs/examples/list/list.vcxproj +++ b/vs/examples/list/list.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/list/packages.config b/vs/examples/list/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/list/packages.config +++ b/vs/examples/list/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/map/map.vcxproj b/vs/examples/map/map.vcxproj index 0ce77a9ea..2f4a04912 100644 --- a/vs/examples/map/map.vcxproj +++ b/vs/examples/map/map.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/map/packages.config b/vs/examples/map/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/map/packages.config +++ b/vs/examples/map/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/put/packages.config b/vs/examples/put/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/put/packages.config +++ b/vs/examples/put/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/put/put.vcxproj b/vs/examples/put/put.vcxproj index e62da312c..18b666aa6 100644 --- a/vs/examples/put/put.vcxproj +++ b/vs/examples/put/put.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/query-aggregate/packages.config b/vs/examples/query-aggregate/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/query-aggregate/packages.config +++ b/vs/examples/query-aggregate/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/query-aggregate/query-aggregate.vcxproj b/vs/examples/query-aggregate/query-aggregate.vcxproj index 91dfa9e9b..87bd62710 100644 --- a/vs/examples/query-aggregate/query-aggregate.vcxproj +++ b/vs/examples/query-aggregate/query-aggregate.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/query/packages.config b/vs/examples/query/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/query/packages.config +++ b/vs/examples/query/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/query/query.vcxproj b/vs/examples/query/query.vcxproj index 398dce82c..7d413d951 100644 --- a/vs/examples/query/query.vcxproj +++ b/vs/examples/query/query.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/scan-background/packages.config b/vs/examples/scan-background/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/scan-background/packages.config +++ b/vs/examples/scan-background/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/scan-background/scan-background.vcxproj b/vs/examples/scan-background/scan-background.vcxproj index 91e66ba99..2d444ad8a 100644 --- a/vs/examples/scan-background/scan-background.vcxproj +++ b/vs/examples/scan-background/scan-background.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/scan/packages.config b/vs/examples/scan/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/scan/packages.config +++ b/vs/examples/scan/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/scan/scan.vcxproj b/vs/examples/scan/scan.vcxproj index 49b4139a1..b201a005d 100644 --- a/vs/examples/scan/scan.vcxproj +++ b/vs/examples/scan/scan.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/touch/packages.config b/vs/examples/touch/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/touch/packages.config +++ b/vs/examples/touch/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/touch/touch.vcxproj b/vs/examples/touch/touch.vcxproj index 1adfe093f..3719a4ee0 100644 --- a/vs/examples/touch/touch.vcxproj +++ b/vs/examples/touch/touch.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/examples/udf/packages.config b/vs/examples/udf/packages.config index 19dfadde0..1067234ed 100644 --- a/vs/examples/udf/packages.config +++ b/vs/examples/udf/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/vs/examples/udf/udf.vcxproj b/vs/examples/udf/udf.vcxproj index 6985dc654..bddc56c75 100644 --- a/vs/examples/udf/udf.vcxproj +++ b/vs/examples/udf/udf.vcxproj @@ -237,12 +237,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/vs/props/base.props b/vs/props/base.props index cda3c77b1..5f458bb22 100644 --- a/vs/props/base.props +++ b/vs/props/base.props @@ -16,13 +16,13 @@ $(SolutionDir)x64\$(Configuration);%(AdditionalLibraryDirectories) - lua51.lib;pthreadVC2d.lib;ssleay32.lib;libeay32.lib;zlibd.lib;ws2_32.lib;%(AdditionalDependencies) + pthreadVC2d.lib;ssleay32.lib;libeay32.lib;zlibd.lib;ws2_32.lib;%(AdditionalDependencies) $(SolutionDir)x64\$(Configuration);%(AdditionalLibraryDirectories) - lua51.lib;pthreadVC2.lib;ssleay32.lib;libeay32.lib;zlib.lib;ws2_32.lib;%(AdditionalDependencies) + pthreadVC2.lib;ssleay32.lib;libeay32.lib;zlib.lib;ws2_32.lib;%(AdditionalDependencies) From 9ef7056b10e7f50291f87598cef75709263924c5 Mon Sep 17 00:00:00 2001 From: Kevin Porter Date: Thu, 12 Oct 2023 14:49:41 -0700 Subject: [PATCH 16/35] CLIENT-2605 - Remove luajit from git cache. --- modules/luajit | 1 - 1 file changed, 1 deletion(-) delete mode 160000 modules/luajit diff --git a/modules/luajit b/modules/luajit deleted file mode 160000 index 0e8c66e98..000000000 --- a/modules/luajit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0e8c66e98668b4c07da427bd814d213d2990f6cd From b53f3c417bab855da834a4d6fcd5d2db43b998d8 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Fri, 13 Oct 2023 10:25:13 -0700 Subject: [PATCH 17/35] Use latest mod-lua submodule. --- modules/mod-lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mod-lua b/modules/mod-lua index 57fdeaa27..844e38310 160000 --- a/modules/mod-lua +++ b/modules/mod-lua @@ -1 +1 @@ -Subproject commit 57fdeaa27885b1ba8c519b619620ffbea8c86041 +Subproject commit 844e383101cba5788862da2f0f93bfe24d10f5bf From 1ac97cb72b413061c510026578a9e5cfe1216a6d Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Wed, 18 Oct 2023 18:07:21 -0700 Subject: [PATCH 18/35] CLIENT-2585 Support secondary index on a blob in a list/map bin. Requires server version 7.0+. --- src/include/aerospike/as_query.h | 51 ++++++++++++++++++++---- src/test/aerospike_query/query_foreach.c | 44 ++++++++++++++++++++ 2 files changed, 88 insertions(+), 7 deletions(-) diff --git a/src/include/aerospike/as_query.h b/src/include/aerospike/as_query.h index cdd3d0ba0..6e4436c24 100644 --- a/src/include/aerospike/as_query.h +++ b/src/include/aerospike/as_query.h @@ -34,18 +34,19 @@ extern "C" { *****************************************************************************/ /** - * Macro for setting setting the STRING_EQUAL predicate. + * Filter on string bins. * * ~~~~~~~~~~{.c} * as_query_where(query, "bin1", as_string_equals("abc")); * ~~~~~~~~~~ * * @relates as_query + * @ingroup query_object */ #define as_string_equals(__val) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_DEFAULT, AS_INDEX_STRING, __val /** - * Macro for setting setting the BLOB_EQUAL predicate. + * Filter on blob bins. * Requires server version 7.0+. * * ~~~~~~~~~~{.c} @@ -54,22 +55,24 @@ extern "C" { * ~~~~~~~~~~ * * @relates as_query + * @ingroup query_object */ #define as_blob_equals(__val, __size, __free) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_DEFAULT, AS_INDEX_BLOB, __val, __size, __free /** - * Macro for setting setting the INTEGER_EQUAL predicate. + * Filter on integer bins. * * ~~~~~~~~~~{.c} * as_query_where(query, "bin1", as_integer_equals(123)); * ~~~~~~~~~~ * * @relates as_query + * @ingroup query_object */ #define as_integer_equals(__val) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_DEFAULT, AS_INDEX_NUMERIC, (int64_t)__val /** - * Macro for setting setting the INTEGER_RANGE predicate. + * Ranger filter on integer bins. * * ~~~~~~~~~~{.c} * as_query_where(query, "bin1", as_integer_range(1,100)); @@ -81,7 +84,7 @@ extern "C" { #define as_integer_range(__min, __max) AS_PREDICATE_RANGE, AS_INDEX_TYPE_DEFAULT, AS_INDEX_NUMERIC, (int64_t)__min, (int64_t)__max /** - * Macro for setting setting the RANGE predicate. + * Range filter on list/map elements. * * ~~~~~~~~~~{.c} * as_query_where(query, "bin1", as_range(LIST,NUMERIC,1,100)); @@ -93,7 +96,7 @@ extern "C" { #define as_range(indextype, datatype, __min, __max) AS_PREDICATE_RANGE, AS_INDEX_TYPE_ ##indextype, AS_INDEX_ ##datatype, __min, __max /** - * Macro for setting setting the CONTAINS predicate. + * Contains filter on list/map elements. * * ~~~~~~~~~~{.c} * as_query_where(query, "bin1", as_contains(LIST,STRING,"val")); @@ -105,7 +108,21 @@ extern "C" { #define as_contains(indextype, datatype, __val) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_ ##indextype, AS_INDEX_ ##datatype, __val /** - * Macro for setting setting the EQUALS predicate. + * Contains blob filter on list/map elements. + * Requires server version 7.0+. + * + * ~~~~~~~~~~{.c} + * // as_blob_contains(type, uint8_t* bytes, uint32_t size, bool free) + * as_query_where(query, "bin1", as_blob_equals(LIST, bytes, size, true)); + * ~~~~~~~~~~ + * + * @relates as_query + * @ingroup query_object + */ +#define as_blob_contains(indextype, __val, __size, __free) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_ ##indextype, AS_INDEX_BLOB, __val, __size, __free + +/** + * Filter specified type on bins. * * ~~~~~~~~~~{.c} * as_query_where(query, "bin1", as_equals(NUMERIC,5)); @@ -116,8 +133,28 @@ extern "C" { */ #define as_equals(datatype, __val) AS_PREDICATE_EQUAL, AS_INDEX_TYPE_DEFAULT, AS_INDEX_ ##datatype, __val +/** + * Within filter on GEO bins. + * + * ~~~~~~~~~~{.c} + * as_query_where(query, "bin1", as_geo_within(region)); + * ~~~~~~~~~~ + * + * @relates as_query + * @ingroup query_object + */ #define as_geo_within(__val) AS_PREDICATE_RANGE, AS_INDEX_TYPE_DEFAULT, AS_INDEX_GEO2DSPHERE, __val +/** + * Contains filter on GEO bins. + * + * ~~~~~~~~~~{.c} + * as_query_where(query, "bin1", as_geo_contains(region)); + * ~~~~~~~~~~ + * + * @relates as_query + * @ingroup query_object + */ #define as_geo_contains(__val) AS_PREDICATE_RANGE, AS_INDEX_TYPE_DEFAULT, AS_INDEX_GEO2DSPHERE, __val diff --git a/src/test/aerospike_query/query_foreach.c b/src/test/aerospike_query/query_foreach.c index 978e91dc2..2fc9173f4 100644 --- a/src/test/aerospike_query/query_foreach.c +++ b/src/test/aerospike_query/query_foreach.c @@ -165,6 +165,9 @@ query_foreach_create(void) status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "blob", "idx_blob_test", AS_INDEX_TYPE_DEFAULT, AS_INDEX_BLOB); index_process_return_code(status, &err, &task); + status = aerospike_index_create_complex(as, &err, &task, NULL, NAMESPACE, SET, "blob_list", "idx_list_blob_test", AS_INDEX_TYPE_LIST, AS_INDEX_BLOB); + index_process_return_code(status, &err, &task); + char* buffer = alloca(n_recs * 1024 + 1); uint32_t the_ttl = AS_RECORD_NO_EXPIRE_TTL; @@ -247,6 +250,13 @@ query_foreach_create(void) uint8_t* blob_ptr = blob; *(uint32_t*)blob_ptr = 50000 + i; + // Make list of blobs + as_arraylist list3; + as_arraylist_init(&list3, 1, 0); + as_bytes bytes; + as_bytes_init_wrap(&bytes, blob_ptr, 4, false); + as_arraylist_append_bytes(&list3, &bytes); + // We only create the g bin for odd records. bool create_g_bin = i % 2 == 1; @@ -264,6 +274,7 @@ query_foreach_create(void) as_record_set_list(&r, "x", (as_list *) &list); as_record_set_map(&r, "y", (as_map *) &map); as_record_set_list(&r, "z", (as_list *) &list2); + as_record_set_list(&r, "blob_list", (as_list *) &list3); as_record_set_str(&r, "bigstr", buffer); as_record_set_rawp(&r, "blob", blob_ptr, sizeof(uint32_t), false); @@ -369,6 +380,11 @@ query_foreach_destroy(void) info("error(%d): %s", err.code, err.message); } + aerospike_index_remove(as, &err, NULL, NAMESPACE, "idx_list_blob_test"); + if (err.code != AEROSPIKE_OK) { + info("error(%d): %s", err.code, err.message); + } + return true; } @@ -1766,6 +1782,33 @@ TEST(query_blob_index, "query blob index") as_query_destroy(&q); } +TEST(query_blob_list_index, "query blob list index") +{ + as_error err; + as_error_reset(&err); + + uint32_t count = 0; + + uint8_t blob[4]; + *((uint32_t*)blob) = 50003; + + as_query q; + as_query_init(&q, NAMESPACE, SET); + + as_query_select_inita(&q, 1); + as_query_select(&q, "blob_list"); + + as_query_where_inita(&q, 1); + as_query_where(&q, "blob_list", as_blob_contains(LIST, &blob, 4, false)); + + aerospike_query_foreach(as, &err, NULL, &q, query_foreach_count_callback, &count); + + assert_int_eq(err.code, 0); + assert_int_eq(count, 1); + + as_query_destroy(&q); +} + /****************************************************************************** * TEST SUITE *****************************************************************************/ @@ -1851,4 +1894,5 @@ SUITE(query_foreach, "aerospike_query_foreach tests") suite_add(query_list_ctx_is_string); suite_add(query_map_ctx_is_string); suite_add(query_blob_index); + suite_add(query_blob_list_index); } From 712669e3926ce6a484f17e4b98614104b5efb6f8 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Thu, 19 Oct 2023 12:47:39 -0700 Subject: [PATCH 19/35] CLIENT-2605 Build the lua submodule directly in Xcode, instead of relying on an external lua library. --- .../aerospike-test.xcodeproj/project.pbxproj | 4 - xcode/aerospike.xcodeproj/project.pbxproj | 166 ++++++++++++++++-- xcode/examples.xcodeproj/project.pbxproj | 4 - 3 files changed, 150 insertions(+), 24 deletions(-) diff --git a/xcode/aerospike-test.xcodeproj/project.pbxproj b/xcode/aerospike-test.xcodeproj/project.pbxproj index 78fd943e7..f863b5b18 100644 --- a/xcode/aerospike-test.xcodeproj/project.pbxproj +++ b/xcode/aerospike-test.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - BE9280C61E4AC2F0007F7DA7 /* liblua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE9280C51E4AC2F0007F7DA7 /* liblua.a */; }; BE9280C81E4AC521007F7DA7 /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BE9280C71E4AC521007F7DA7 /* libz.1.dylib */; }; BF1881E028E5093F003DCB7B /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BF1881DF28E5093F003DCB7B /* libssl.a */; }; BF3F7D47259BDD2B0092D808 /* map_sort.c in Sources */ = {isa = PBXBuildFile; fileRef = BF3F7D46259BDD2B0092D808 /* map_sort.c */; }; @@ -166,7 +165,6 @@ buildActionMask = 2147483647; files = ( BFD8C86F18D7E3A300CB8B6D /* libaerospike.a in Frameworks */, - BE9280C61E4AC2F0007F7DA7 /* liblua.a in Frameworks */, BF9750111E4EC8C900B737CF /* libev.a in Frameworks */, BF9750131E4ECA1C00B737CF /* libuv.a in Frameworks */, BF1881E028E5093F003DCB7B /* libssl.a in Frameworks */, @@ -575,7 +573,6 @@ "$(OpenSSL)/include", ); LIBRARY_SEARCH_PATHS = ( - ../modules/lua/src, "$(External)/lib", "$(OpenSSL)/lib", ); @@ -632,7 +629,6 @@ "$(OpenSSL)/include", ); LIBRARY_SEARCH_PATHS = ( - ../modules/lua/src, "$(External)/lib", "$(OpenSSL)/lib", ); diff --git a/xcode/aerospike.xcodeproj/project.pbxproj b/xcode/aerospike.xcodeproj/project.pbxproj index 823636c69..31afd2938 100644 --- a/xcode/aerospike.xcodeproj/project.pbxproj +++ b/xcode/aerospike.xcodeproj/project.pbxproj @@ -70,6 +70,40 @@ BF8EABF61BF3C2800027EF45 /* as_event_ev.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EABF51BF3C2800027EF45 /* as_event_ev.c */; }; BF8EABF81BF3C28F0027EF45 /* as_event_uv.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EABF71BF3C28F0027EF45 /* as_event_uv.c */; }; BF8EEB2D1A2CED34000F2B00 /* as_command.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EEB2C1A2CED34000F2B00 /* as_command.c */; }; + BF8EF49C2AE1B39500FEEC3A /* lapi.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF49B2AE1B39500FEEC3A /* lapi.c */; }; + BF8EF4A52AE1B41100FEEC3A /* lauxlib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF49D2AE1B41100FEEC3A /* lauxlib.c */; }; + BF8EF4A62AE1B41100FEEC3A /* lbaselib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF49E2AE1B41100FEEC3A /* lbaselib.c */; }; + BF8EF4A72AE1B41100FEEC3A /* lcode.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF49F2AE1B41100FEEC3A /* lcode.c */; }; + BF8EF4A82AE1B41100FEEC3A /* lcorolib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4A02AE1B41100FEEC3A /* lcorolib.c */; }; + BF8EF4A92AE1B41100FEEC3A /* lctype.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4A12AE1B41100FEEC3A /* lctype.c */; }; + BF8EF4AA2AE1B41100FEEC3A /* ldblib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4A22AE1B41100FEEC3A /* ldblib.c */; }; + BF8EF4AB2AE1B41100FEEC3A /* ldebug.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4A32AE1B41100FEEC3A /* ldebug.c */; }; + BF8EF4AC2AE1B41100FEEC3A /* ldo.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4A42AE1B41100FEEC3A /* ldo.c */; }; + BF8EF4B82AE1B44900FEEC3A /* ldump.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4AD2AE1B44900FEEC3A /* ldump.c */; }; + BF8EF4B92AE1B44900FEEC3A /* lfunc.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4AE2AE1B44900FEEC3A /* lfunc.c */; }; + BF8EF4BA2AE1B44900FEEC3A /* lgc.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4AF2AE1B44900FEEC3A /* lgc.c */; }; + BF8EF4BB2AE1B44900FEEC3A /* linit.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B02AE1B44900FEEC3A /* linit.c */; }; + BF8EF4BC2AE1B44900FEEC3A /* liolib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B12AE1B44900FEEC3A /* liolib.c */; }; + BF8EF4BD2AE1B44900FEEC3A /* llex.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B22AE1B44900FEEC3A /* llex.c */; }; + BF8EF4BE2AE1B44900FEEC3A /* lmathlib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B32AE1B44900FEEC3A /* lmathlib.c */; }; + BF8EF4BF2AE1B44900FEEC3A /* lmem.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B42AE1B44900FEEC3A /* lmem.c */; }; + BF8EF4C02AE1B44900FEEC3A /* loadlib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B52AE1B44900FEEC3A /* loadlib.c */; }; + BF8EF4C12AE1B44900FEEC3A /* lobject.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B62AE1B44900FEEC3A /* lobject.c */; }; + BF8EF4C22AE1B44900FEEC3A /* lopcodes.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4B72AE1B44900FEEC3A /* lopcodes.c */; }; + BF8EF4CA2AE1B47B00FEEC3A /* loslib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4C32AE1B47B00FEEC3A /* loslib.c */; }; + BF8EF4CB2AE1B47B00FEEC3A /* lparser.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4C42AE1B47B00FEEC3A /* lparser.c */; }; + BF8EF4CC2AE1B47B00FEEC3A /* lstate.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4C52AE1B47B00FEEC3A /* lstate.c */; }; + BF8EF4CD2AE1B47B00FEEC3A /* lstring.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4C62AE1B47B00FEEC3A /* lstring.c */; }; + BF8EF4CE2AE1B47B00FEEC3A /* lstrlib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4C72AE1B47B00FEEC3A /* lstrlib.c */; }; + BF8EF4CF2AE1B47B00FEEC3A /* ltable.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4C82AE1B47B00FEEC3A /* ltable.c */; }; + BF8EF4D02AE1B47B00FEEC3A /* ltablib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4C92AE1B47B00FEEC3A /* ltablib.c */; }; + BF8EF4D82AE1B4BA00FEEC3A /* ltests.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4D12AE1B4BA00FEEC3A /* ltests.c */; }; + BF8EF4D92AE1B4BA00FEEC3A /* ltm.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4D22AE1B4BA00FEEC3A /* ltm.c */; }; + BF8EF4DA2AE1B4BA00FEEC3A /* lua.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4D32AE1B4BA00FEEC3A /* lua.c */; }; + BF8EF4DB2AE1B4BA00FEEC3A /* lundump.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4D42AE1B4BA00FEEC3A /* lundump.c */; }; + BF8EF4DC2AE1B4BA00FEEC3A /* lutf8lib.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4D52AE1B4BA00FEEC3A /* lutf8lib.c */; }; + BF8EF4DD2AE1B4BA00FEEC3A /* lvm.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4D62AE1B4BA00FEEC3A /* lvm.c */; }; + BF8EF4DE2AE1B4BA00FEEC3A /* lzio.c in Sources */ = {isa = PBXBuildFile; fileRef = BF8EF4D72AE1B4BA00FEEC3A /* lzio.c */; }; BF90C76522AB0EB20062D920 /* as_list_operations.c in Sources */ = {isa = PBXBuildFile; fileRef = BF90C76422AB0EB20062D920 /* as_list_operations.c */; }; BF90C76A22AB143C0062D920 /* as_cdt_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BF90C76922AB143C0062D920 /* as_cdt_internal.h */; }; BF90C76C22AB154A0062D920 /* as_cdt_internal.c in Sources */ = {isa = PBXBuildFile; fileRef = BF90C76B22AB154A0062D920 /* as_cdt_internal.c */; }; @@ -249,6 +283,40 @@ BF8EABF51BF3C2800027EF45 /* as_event_ev.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = as_event_ev.c; path = ../src/main/aerospike/as_event_ev.c; sourceTree = ""; }; BF8EABF71BF3C28F0027EF45 /* as_event_uv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = as_event_uv.c; path = ../src/main/aerospike/as_event_uv.c; sourceTree = ""; }; BF8EEB2C1A2CED34000F2B00 /* as_command.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = as_command.c; path = ../src/main/aerospike/as_command.c; sourceTree = ""; }; + BF8EF49B2AE1B39500FEEC3A /* lapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lapi.c; path = ../modules/lua/lapi.c; sourceTree = ""; }; + BF8EF49D2AE1B41100FEEC3A /* lauxlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lauxlib.c; path = ../modules/lua/lauxlib.c; sourceTree = ""; }; + BF8EF49E2AE1B41100FEEC3A /* lbaselib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lbaselib.c; path = ../modules/lua/lbaselib.c; sourceTree = ""; }; + BF8EF49F2AE1B41100FEEC3A /* lcode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lcode.c; path = ../modules/lua/lcode.c; sourceTree = ""; }; + BF8EF4A02AE1B41100FEEC3A /* lcorolib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lcorolib.c; path = ../modules/lua/lcorolib.c; sourceTree = ""; }; + BF8EF4A12AE1B41100FEEC3A /* lctype.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lctype.c; path = ../modules/lua/lctype.c; sourceTree = ""; }; + BF8EF4A22AE1B41100FEEC3A /* ldblib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldblib.c; path = ../modules/lua/ldblib.c; sourceTree = ""; }; + BF8EF4A32AE1B41100FEEC3A /* ldebug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldebug.c; path = ../modules/lua/ldebug.c; sourceTree = ""; }; + BF8EF4A42AE1B41100FEEC3A /* ldo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldo.c; path = ../modules/lua/ldo.c; sourceTree = ""; }; + BF8EF4AD2AE1B44900FEEC3A /* ldump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldump.c; path = ../modules/lua/ldump.c; sourceTree = ""; }; + BF8EF4AE2AE1B44900FEEC3A /* lfunc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lfunc.c; path = ../modules/lua/lfunc.c; sourceTree = ""; }; + BF8EF4AF2AE1B44900FEEC3A /* lgc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lgc.c; path = ../modules/lua/lgc.c; sourceTree = ""; }; + BF8EF4B02AE1B44900FEEC3A /* linit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = linit.c; path = ../modules/lua/linit.c; sourceTree = ""; }; + BF8EF4B12AE1B44900FEEC3A /* liolib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = liolib.c; path = ../modules/lua/liolib.c; sourceTree = ""; }; + BF8EF4B22AE1B44900FEEC3A /* llex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = llex.c; path = ../modules/lua/llex.c; sourceTree = ""; }; + BF8EF4B32AE1B44900FEEC3A /* lmathlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lmathlib.c; path = ../modules/lua/lmathlib.c; sourceTree = ""; }; + BF8EF4B42AE1B44900FEEC3A /* lmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lmem.c; path = ../modules/lua/lmem.c; sourceTree = ""; }; + BF8EF4B52AE1B44900FEEC3A /* loadlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loadlib.c; path = ../modules/lua/loadlib.c; sourceTree = ""; }; + BF8EF4B62AE1B44900FEEC3A /* lobject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lobject.c; path = ../modules/lua/lobject.c; sourceTree = ""; }; + BF8EF4B72AE1B44900FEEC3A /* lopcodes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lopcodes.c; path = ../modules/lua/lopcodes.c; sourceTree = ""; }; + BF8EF4C32AE1B47B00FEEC3A /* loslib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loslib.c; path = ../modules/lua/loslib.c; sourceTree = ""; }; + BF8EF4C42AE1B47B00FEEC3A /* lparser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lparser.c; path = ../modules/lua/lparser.c; sourceTree = ""; }; + BF8EF4C52AE1B47B00FEEC3A /* lstate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstate.c; path = ../modules/lua/lstate.c; sourceTree = ""; }; + BF8EF4C62AE1B47B00FEEC3A /* lstring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstring.c; path = ../modules/lua/lstring.c; sourceTree = ""; }; + BF8EF4C72AE1B47B00FEEC3A /* lstrlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstrlib.c; path = ../modules/lua/lstrlib.c; sourceTree = ""; }; + BF8EF4C82AE1B47B00FEEC3A /* ltable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltable.c; path = ../modules/lua/ltable.c; sourceTree = ""; }; + BF8EF4C92AE1B47B00FEEC3A /* ltablib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltablib.c; path = ../modules/lua/ltablib.c; sourceTree = ""; }; + BF8EF4D12AE1B4BA00FEEC3A /* ltests.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltests.c; path = ../modules/lua/ltests.c; sourceTree = ""; }; + BF8EF4D22AE1B4BA00FEEC3A /* ltm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltm.c; path = ../modules/lua/ltm.c; sourceTree = ""; }; + BF8EF4D32AE1B4BA00FEEC3A /* lua.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lua.c; path = ../modules/lua/lua.c; sourceTree = ""; }; + BF8EF4D42AE1B4BA00FEEC3A /* lundump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lundump.c; path = ../modules/lua/lundump.c; sourceTree = ""; }; + BF8EF4D52AE1B4BA00FEEC3A /* lutf8lib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lutf8lib.c; path = ../modules/lua/lutf8lib.c; sourceTree = ""; }; + BF8EF4D62AE1B4BA00FEEC3A /* lvm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lvm.c; path = ../modules/lua/lvm.c; sourceTree = ""; }; + BF8EF4D72AE1B4BA00FEEC3A /* lzio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lzio.c; path = ../modules/lua/lzio.c; sourceTree = ""; }; BF90C76422AB0EB20062D920 /* as_list_operations.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = as_list_operations.c; path = ../src/main/aerospike/as_list_operations.c; sourceTree = ""; }; BF90C76922AB143C0062D920 /* as_cdt_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = as_cdt_internal.h; path = ../src/include/aerospike/as_cdt_internal.h; sourceTree = ""; }; BF90C76B22AB154A0062D920 /* as_cdt_internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = as_cdt_internal.c; path = ../src/main/aerospike/as_cdt_internal.c; sourceTree = ""; }; @@ -393,6 +461,47 @@ name = Products; sourceTree = ""; }; + BF8EF49A2AE1B31200FEEC3A /* lua */ = { + isa = PBXGroup; + children = ( + BF8EF4D12AE1B4BA00FEEC3A /* ltests.c */, + BF8EF4D22AE1B4BA00FEEC3A /* ltm.c */, + BF8EF4D32AE1B4BA00FEEC3A /* lua.c */, + BF8EF4D42AE1B4BA00FEEC3A /* lundump.c */, + BF8EF4D52AE1B4BA00FEEC3A /* lutf8lib.c */, + BF8EF4D62AE1B4BA00FEEC3A /* lvm.c */, + BF8EF4D72AE1B4BA00FEEC3A /* lzio.c */, + BF8EF4C32AE1B47B00FEEC3A /* loslib.c */, + BF8EF4C42AE1B47B00FEEC3A /* lparser.c */, + BF8EF4C52AE1B47B00FEEC3A /* lstate.c */, + BF8EF4C62AE1B47B00FEEC3A /* lstring.c */, + BF8EF4C72AE1B47B00FEEC3A /* lstrlib.c */, + BF8EF4C82AE1B47B00FEEC3A /* ltable.c */, + BF8EF4C92AE1B47B00FEEC3A /* ltablib.c */, + BF8EF4AD2AE1B44900FEEC3A /* ldump.c */, + BF8EF4AE2AE1B44900FEEC3A /* lfunc.c */, + BF8EF4AF2AE1B44900FEEC3A /* lgc.c */, + BF8EF4B02AE1B44900FEEC3A /* linit.c */, + BF8EF4B12AE1B44900FEEC3A /* liolib.c */, + BF8EF4B22AE1B44900FEEC3A /* llex.c */, + BF8EF4B32AE1B44900FEEC3A /* lmathlib.c */, + BF8EF4B42AE1B44900FEEC3A /* lmem.c */, + BF8EF4B52AE1B44900FEEC3A /* loadlib.c */, + BF8EF4B62AE1B44900FEEC3A /* lobject.c */, + BF8EF4B72AE1B44900FEEC3A /* lopcodes.c */, + BF8EF49D2AE1B41100FEEC3A /* lauxlib.c */, + BF8EF49E2AE1B41100FEEC3A /* lbaselib.c */, + BF8EF49F2AE1B41100FEEC3A /* lcode.c */, + BF8EF4A02AE1B41100FEEC3A /* lcorolib.c */, + BF8EF4A12AE1B41100FEEC3A /* lctype.c */, + BF8EF4A22AE1B41100FEEC3A /* ldblib.c */, + BF8EF4A32AE1B41100FEEC3A /* ldebug.c */, + BF8EF4A42AE1B41100FEEC3A /* ldo.c */, + BF8EF49B2AE1B39500FEEC3A /* lapi.c */, + ); + name = lua; + sourceTree = ""; + }; BFC65B291C92189A0079DF5A /* src */ = { isa = PBXGroup; children = ( @@ -468,6 +577,7 @@ BFC65B2C1C921B490079DF5A /* modules */ = { isa = PBXGroup; children = ( + BF8EF49A2AE1B31200FEEC3A /* lua */, BFC65B2D1C921B650079DF5A /* common */, BFC65B311C921CB40079DF5A /* mod-lua */, ); @@ -786,9 +896,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + BF8EF4BD2AE1B44900FEEC3A /* llex.c in Sources */, BFBA916B1914344B00AADA9A /* as_partition.c in Sources */, BFBA104F18B7D8B300A64E68 /* as_arraylist_iterator.c in Sources */, BFBB6481190595E900682A6E /* as_timer.c in Sources */, + BF8EF4DC2AE1B4BA00FEEC3A /* lutf8lib.c in Sources */, + BF8EF4BC2AE1B44900FEEC3A /* liolib.c in Sources */, BF2337A11B4DC8BD00670C64 /* as_buffer_pool.c in Sources */, BFBD205118BC3436009ED931 /* mod_lua_aerospike.c in Sources */, BF843C5918D3E64900A06CFB /* cf_alloc.c in Sources */, @@ -800,42 +913,57 @@ BFC0028A1901E08500CB9BC8 /* as_lookup.c in Sources */, BFBD205218BC3436009ED931 /* mod_lua_bytes.c in Sources */, BF7EBCC025D4B17000D5DFE9 /* as_exp_operations.c in Sources */, + BF8EF4A72AE1B41100FEEC3A /* lcode.c in Sources */, BF5548ED19E36A7C007DDB9E /* as_log.c in Sources */, BFC002881901BCB200CB9BC8 /* as_vector.c in Sources */, BF2AA7E218BEBFA500E54AF3 /* aerospike_query.c in Sources */, BF93AA061AE9E6EB003ECE3B /* as_thread_pool.c in Sources */, BFC38AE11948F7CA000C53D9 /* as_admin.c in Sources */, + BF8EF4CE2AE1B47B00FEEC3A /* lstrlib.c in Sources */, BFBD205618BC3436009ED931 /* mod_lua_record.c in Sources */, + BF8EF4A52AE1B41100FEEC3A /* lauxlib.c in Sources */, + BF8EF4BA2AE1B44900FEEC3A /* lgc.c in Sources */, BF222CFF1BB3397E006827A6 /* mod_lua_geojson.c in Sources */, BF2AA7DB18BEBFA500E54AF3 /* aerospike_index.c in Sources */, BF219F101A622C23001E321C /* as_socket.c in Sources */, BFE3C39B1D62720800AA7F20 /* as_address.c in Sources */, BF8EABF81BF3C28F0027EF45 /* as_event_uv.c in Sources */, + BF8EF4CA2AE1B47B00FEEC3A /* loslib.c in Sources */, BF90C76522AB0EB20062D920 /* as_list_operations.c in Sources */, BFBBBAEB18B6D9D0003FFD88 /* cf_b64.c in Sources */, BF25DA931BB0790F00AC7512 /* as_event.c in Sources */, BF2AA7F318BEBFA500E54AF3 /* as_scan.c in Sources */, BFBA106E18B7DFA100A64E68 /* as_msgpack_serializer.c in Sources */, BF457A8822B1B6F700409D04 /* as_bit_operations.c in Sources */, + BF8EF4A82AE1B41100FEEC3A /* lcorolib.c in Sources */, BF32147123E8F9C6004A7E19 /* as_partition_tracker.c in Sources */, BFBA04A91947AA8400F9924E /* cf_random.c in Sources */, BF2337A21B4DC8BD00670C64 /* as_double.c in Sources */, + BF8EF4AC2AE1B41100FEEC3A /* ldo.c in Sources */, BF2AA7DC18BEBFA500E54AF3 /* aerospike_info.c in Sources */, BFBD205018BC3436009ED931 /* internal.c in Sources */, BFBA106618B7D8B300A64E68 /* as_stream.c in Sources */, + BF8EF4C02AE1B44900FEEC3A /* loadlib.c in Sources */, BFBD205718BC3436009ED931 /* mod_lua_reg.c in Sources */, BFCEC9C21DD6A9F300429C94 /* ssl_util.c in Sources */, BF2AA7DA18BEBFA500E54AF3 /* aerospike_batch.c in Sources */, BF2AA7EE18BEBFA500E54AF3 /* as_policy.c in Sources */, + BF8EF4D92AE1B4BA00FEEC3A /* ltm.c in Sources */, BF2886F6282C9360008E441C /* as_orderedmap.c in Sources */, BF809CDD2432836000C16F3D /* as_hll_operations.c in Sources */, BF2AA7E918BEBFA500E54AF3 /* as_error.c in Sources */, BF222CFD1BB33961006827A6 /* as_geojson.c in Sources */, + BF8EF4AA2AE1B41100FEEC3A /* ldblib.c in Sources */, BFBD9F8C2310500A0092FFD3 /* as_cdt_ctx.c in Sources */, BFBA105018B7D8B300A64E68 /* as_arraylist.c in Sources */, BFC3A8EB1B97D24D00F2F758 /* version.c in Sources */, BF90C77122AB30E40062D920 /* as_map_operations.c in Sources */, BF4E4E451D50150700BEEF94 /* as_peers.c in Sources */, + BF8EF4D82AE1B4BA00FEEC3A /* ltests.c in Sources */, + BF8EF4BF2AE1B44900FEEC3A /* lmem.c in Sources */, + BF8EF4CD2AE1B47B00FEEC3A /* lstring.c in Sources */, + BF8EF4BB2AE1B44900FEEC3A /* linit.c in Sources */, + BF8EF4CC2AE1B47B00FEEC3A /* lstate.c in Sources */, BFBD205818BC3436009ED931 /* mod_lua_stream.c in Sources */, BFBBBAED18B6D9D0003FFD88 /* cf_clock.c in Sources */, BFBA106F18B7DFA100A64E68 /* as_msgpack.c in Sources */, @@ -845,14 +973,21 @@ BFBA106218B7D8B300A64E68 /* as_pair.c in Sources */, BFBA105318B7D8B300A64E68 /* as_bytes.c in Sources */, BF2AA7EA18BEBFA500E54AF3 /* as_key.c in Sources */, + BF8EF4DD2AE1B4BA00FEEC3A /* lvm.c in Sources */, BF8EABF61BF3C2800027EF45 /* as_event_ev.c in Sources */, + BF8EF4B82AE1B44900FEEC3A /* ldump.c in Sources */, BFBA105E18B7D8B300A64E68 /* as_module.c in Sources */, + BF8EF4BE2AE1B44900FEEC3A /* lmathlib.c in Sources */, BF2AA7ED18BEBFA500E54AF3 /* as_operations.c in Sources */, + BF8EF4A92AE1B41100FEEC3A /* lctype.c in Sources */, BFBBBAEF18B6D9D0003FFD88 /* cf_digest.c in Sources */, + BF8EF4DE2AE1B4BA00FEEC3A /* lzio.c in Sources */, BFBA104D18B7D8B300A64E68 /* as_arraylist_hooks.c in Sources */, BF2AA7E418BEBFA500E54AF3 /* aerospike_udf.c in Sources */, + BF8EF4B92AE1B44900FEEC3A /* lfunc.c in Sources */, BFBA105A18B7D8B300A64E68 /* as_list.c in Sources */, BF1C2AE120BE089700868695 /* aerospike_stats.c in Sources */, + BF8EF4C22AE1B44900FEEC3A /* lopcodes.c in Sources */, BFBA106118B7D8B300A64E68 /* as_nil.c in Sources */, BFABF3311FCF85EC004745A1 /* as_queue_mt.c in Sources */, BF21EA541C062FF500E2031E /* as_event_none.c in Sources */, @@ -863,18 +998,23 @@ BFBA105118B7D8B300A64E68 /* as_boolean.c in Sources */, BF2669921BBB74AE00C61962 /* as_queue.c in Sources */, BFBDAFE0191B0C5C007EB07C /* as_info.c in Sources */, + BF8EF4AB2AE1B41100FEEC3A /* ldebug.c in Sources */, BF8EEB2D1A2CED34000F2B00 /* as_command.c in Sources */, BFBBBAEE18B6D9D0003FFD88 /* cf_crypto.c in Sources */, + BF8EF4C12AE1B44900FEEC3A /* lobject.c in Sources */, BF2AA7F418BEBFA500E54AF3 /* as_udf.c in Sources */, BFBA105818B7D8B300A64E68 /* as_integer.c in Sources */, BFBB3C8F192D729A00251B15 /* as_node.c in Sources */, BFD8FE7C20CF6DFC000A80F1 /* as_query_validate.c in Sources */, + BF8EF4CF2AE1B47B00FEEC3A /* ltable.c in Sources */, BFC65B181C910A900079DF5A /* as_random.c in Sources */, BFBD205418BC3436009ED931 /* mod_lua_list.c in Sources */, BF26C4671B45AE8F00E6929D /* as_job.c in Sources */, + BF8EF4DB2AE1B4BA00FEEC3A /* lundump.c in Sources */, BFBD205518BC3436009ED931 /* mod_lua_map.c in Sources */, BF2AA7E518BEBFA500E54AF3 /* aerospike.c in Sources */, BF2AA7E318BEBFA500E54AF3 /* aerospike_scan.c in Sources */, + BF8EF4CB2AE1B47B00FEEC3A /* lparser.c in Sources */, BF6FE4331BF2748E00175BF8 /* as_pipe.c in Sources */, BF1FF985215ECA75000A8F3A /* as_msgpack_ext.c in Sources */, BFBA106318B7D8B300A64E68 /* as_rec.c in Sources */, @@ -887,9 +1027,12 @@ BF2AA7EF18BEBFA500E54AF3 /* as_query.c in Sources */, BFBA04B51947B42000F9924E /* as_password.c in Sources */, BFBA105918B7D8B300A64E68 /* as_iterator.c in Sources */, + BF8EF49C2AE1B39500FEEC3A /* lapi.c in Sources */, BFBD205A18BC3436009ED931 /* mod_lua.c in Sources */, BFBBBAF118B6D9D0003FFD88 /* cf_ll.c in Sources */, + BF8EF4A62AE1B41100FEEC3A /* lbaselib.c in Sources */, BFBA106718B7D8B300A64E68 /* as_string.c in Sources */, + BF8EF4D02AE1B47B00FEEC3A /* ltablib.c in Sources */, BF2AA7E818BEBFA500E54AF3 /* as_config.c in Sources */, BF2AA7CF18BEBFA500E54AF3 /* _bin.c in Sources */, BFBD205318BC3436009ED931 /* mod_lua_iterator.c in Sources */, @@ -901,6 +1044,7 @@ BFBB64831905D5B500682A6E /* as_cluster.c in Sources */, BFBA105C18B7D8B300A64E68 /* as_map.c in Sources */, BF2AA7E618BEBFA500E54AF3 /* as_batch.c in Sources */, + BF8EF4DA2AE1B4BA00FEEC3A /* lua.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1019,19 +1163,14 @@ ../src/include, ../src/default/include, ../modules/ck/include, - ../modules/lua/src, + ../modules/lua, /usr/local/include, /usr/local/opt/openssl/include, /opt/homebrew/opt/openssl/include, ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_CFLAGS = ( - "-D_DARWIN_UNLIMITED_SELECT", - ); - OTHER_LDFLAGS = ( - "-L/usr/local/lib", - "-L../modules/lua/src", - ); + OTHER_CFLAGS = "-D_DARWIN_UNLIMITED_SELECT"; + OTHER_LDFLAGS = "-L/usr/local/lib"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -1049,19 +1188,14 @@ ../src/include, ../src/default/include, ../modules/ck/include, - ../modules/lua/src, + ../modules/lua, /usr/local/include, /usr/local/opt/openssl/include, /opt/homebrew/opt/openssl/include, ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_CFLAGS = ( - "-D_DARWIN_UNLIMITED_SELECT", - ); - OTHER_LDFLAGS = ( - "-L/usr/local/lib", - "-L../modules/lua/src", - ); + OTHER_CFLAGS = "-D_DARWIN_UNLIMITED_SELECT"; + OTHER_LDFLAGS = "-L/usr/local/lib"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/xcode/examples.xcodeproj/project.pbxproj b/xcode/examples.xcodeproj/project.pbxproj index 2b09e8617..ca11a0681 100644 --- a/xcode/examples.xcodeproj/project.pbxproj +++ b/xcode/examples.xcodeproj/project.pbxproj @@ -13,7 +13,6 @@ BF1CA19828D9399B00110268 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BF1CA18E28D9399B00110268 /* libz.a */; }; BF1CA1A828D93CA900110268 /* libaerospike.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BFC65C851C923A210079DF5A /* libaerospike.a */; }; BF2CE58F201976C2000CD2C8 /* example.c in Sources */ = {isa = PBXBuildFile; fileRef = BFD60E64201964E4004A6CE2 /* example.c */; }; - BF78C0E228E3BCC60013CD2B /* liblua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE9280D81E4BA65D007F7DA7 /* liblua.a */; }; BFBDFE7622F3A30800F585B2 /* example_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = BFC65C881C923CEB0079DF5A /* example_utils.c */; }; BFBDFE8922F3A3CE00F585B2 /* example.c in Sources */ = {isa = PBXBuildFile; fileRef = BF508B4622F3592D00BA4282 /* example.c */; }; BFC65C891C923CEB0079DF5A /* example_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = BFC65C881C923CEB0079DF5A /* example_utils.c */; }; @@ -331,7 +330,6 @@ buildActionMask = 2147483647; files = ( BF1CA1A828D93CA900110268 /* libaerospike.a in Frameworks */, - BF78C0E228E3BCC60013CD2B /* liblua.a in Frameworks */, BF1CA15E28D9345200110268 /* libssl.a in Frameworks */, BF1CA17528D9348A00110268 /* libcrypto.a in Frameworks */, BF1CA19828D9399B00110268 /* libz.a in Frameworks */, @@ -1499,7 +1497,6 @@ /usr/local/include, ); LIBRARY_SEARCH_PATHS = ( - ../modules/lua/src, "$(OpenSSL)/lib", "$(External)/lib", ); @@ -1548,7 +1545,6 @@ /usr/local/include, ); LIBRARY_SEARCH_PATHS = ( - ../modules/lua/src, "$(OpenSSL)/lib", "$(External)/lib", ); From 207efb16de605890e57f9d8facfd3867ce4c6d42 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 23 Oct 2023 17:39:15 -0700 Subject: [PATCH 20/35] AER-6669 - Use generational GC - seems better with 5.4. --- modules/mod-lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mod-lua b/modules/mod-lua index 844e38310..2eded46b2 160000 --- a/modules/mod-lua +++ b/modules/mod-lua @@ -1 +1 @@ -Subproject commit 844e383101cba5788862da2f0f93bfe24d10f5bf +Subproject commit 2eded46b26d4180caf22c51e36cb897fa0e6c604 From 987b4c26c9a077bb8b6a211a8dbd8763f817a7b4 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 23 Oct 2023 18:47:53 -0700 Subject: [PATCH 21/35] CLIENT-2585 Fix record size in query blob test. --- src/test/aerospike_query/query_foreach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/aerospike_query/query_foreach.c b/src/test/aerospike_query/query_foreach.c index 2fc9173f4..c2b7bd528 100644 --- a/src/test/aerospike_query/query_foreach.c +++ b/src/test/aerospike_query/query_foreach.c @@ -261,7 +261,7 @@ query_foreach_create(void) bool create_g_bin = i % 2 == 1; as_record r; - as_record_init(&r, 11 + (create_g_bin ? 1 : 0)); + as_record_init(&r, 12 + (create_g_bin ? 1 : 0)); as_record_set_str(&r, "a", a); as_record_set_int64(&r, "b", b); as_record_set_int64(&r, "c", c); From de644388a882c531255edebee3cb40f251e5ae3a Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Tue, 24 Oct 2023 15:31:43 -0700 Subject: [PATCH 22/35] In Visual Studio, add new lua 5.4 include path to all build targets. --- vs/aerospike/aerospike.vcxproj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vs/aerospike/aerospike.vcxproj b/vs/aerospike/aerospike.vcxproj index 576625189..a8c0728ca 100644 --- a/vs/aerospike/aerospike.vcxproj +++ b/vs/aerospike/aerospike.vcxproj @@ -134,28 +134,28 @@ - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) - ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;$(IncludePath) + ..\..\src\include;..\..\modules\common\src\include;..\..\modules\mod-lua\src\include;..\..\modules\lua;$(IncludePath) From 15bb8f8fdff24acf0d25a5668b51328f3af640bc Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Tue, 24 Oct 2023 15:35:40 -0700 Subject: [PATCH 23/35] Update version 6.5.0 --- src/include/aerospike/version.h | 2 +- src/main/aerospike/version.c | 2 +- vs/aerospike-client-c-libevent.nuspec | 2 +- vs/aerospike-client-c-libuv.nuspec | 2 +- vs/aerospike-client-c.nuspec | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/aerospike/version.h b/src/include/aerospike/version.h index 8f015d69b..e9319207c 100644 --- a/src/include/aerospike/version.h +++ b/src/include/aerospike/version.h @@ -3,6 +3,6 @@ // N: minor // P: patch // B: build id -#define AEROSPIKE_CLIENT_VERSION 604040000L +#define AEROSPIKE_CLIENT_VERSION 605000000L extern char* aerospike_client_version; diff --git a/src/main/aerospike/version.c b/src/main/aerospike/version.c index d2ac74cff..426d25ba9 100644 --- a/src/main/aerospike/version.c +++ b/src/main/aerospike/version.c @@ -1 +1 @@ -char* aerospike_client_version = "6.4.4"; +char* aerospike_client_version = "6.5.0"; diff --git a/vs/aerospike-client-c-libevent.nuspec b/vs/aerospike-client-c-libevent.nuspec index 9c97f0617..80a967152 100644 --- a/vs/aerospike-client-c-libevent.nuspec +++ b/vs/aerospike-client-c-libevent.nuspec @@ -2,7 +2,7 @@ aerospike-client-c-libevent - 6.4.4 + 6.5.0 Aerospike C Client with libevent Aerospike Aerospike diff --git a/vs/aerospike-client-c-libuv.nuspec b/vs/aerospike-client-c-libuv.nuspec index 574d11bae..405a5af6f 100644 --- a/vs/aerospike-client-c-libuv.nuspec +++ b/vs/aerospike-client-c-libuv.nuspec @@ -2,7 +2,7 @@ aerospike-client-c-libuv - 6.4.4 + 6.5.0 Aerospike C Client with libuv Aerospike Aerospike diff --git a/vs/aerospike-client-c.nuspec b/vs/aerospike-client-c.nuspec index 9fb13b879..c3d1b8220 100644 --- a/vs/aerospike-client-c.nuspec +++ b/vs/aerospike-client-c.nuspec @@ -2,7 +2,7 @@ aerospike-client-c - 6.4.4 + 6.5.0 Aerospike C Client Aerospike Aerospike From 600d2d2e73118a8b7bc1056777bdf2ad6e7ea3c7 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 30 Oct 2023 17:56:03 -0700 Subject: [PATCH 24/35] CLIENT-2647 Support default ttl in as_policy_write, as_policy_batch_write, as_policy_operate and as_policy_scan. If "as_record.ttl", "as_operations.ttl", "as_scan.ttl" or "as_query.ttl" is AS_RECORD_CLIENT_DEFAULT_TTL, the corresponding default client policy ttl will be used. --- src/include/aerospike/as_operations.h | 10 ++- src/include/aerospike/as_policy.h | 99 +++++++++++++++++------ src/include/aerospike/as_query.h | 20 +++-- src/include/aerospike/as_record.h | 28 ++++--- src/include/aerospike/as_scan.h | 20 +++-- src/main/aerospike/aerospike_batch.c | 8 +- src/main/aerospike/aerospike_key.c | 6 +- src/main/aerospike/aerospike_query.c | 9 ++- src/main/aerospike/aerospike_scan.c | 9 ++- src/test/aerospike_batch/batch.c | 9 ++- src/test/aerospike_key/key_basics.c | 2 + src/test/aerospike_key/key_basics_async.c | 2 + 12 files changed, 154 insertions(+), 68 deletions(-) diff --git a/src/include/aerospike/as_operations.h b/src/include/aerospike/as_operations.h index 85ea6b5a8..de73b8d90 100644 --- a/src/include/aerospike/as_operations.h +++ b/src/include/aerospike/as_operations.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -260,6 +260,14 @@ typedef struct as_operations_s { /** * The time-to-live (expiration) of the record in seconds. + * + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
  • AS_RECORD_CLIENT_DEFAULT_TTL: Use the default client ttl in as_policy_operate.
  • + *
*/ uint32_t ttl; diff --git a/src/include/aerospike/as_policy.h b/src/include/aerospike/as_policy.h index 46807b8f8..61a4983ef 100644 --- a/src/include/aerospike/as_policy.h +++ b/src/include/aerospike/as_policy.h @@ -591,6 +591,20 @@ typedef struct as_policy_write_s { */ as_policy_exists exists; + /** + * The default time-to-live (expiration) of the record in seconds. This field will + * only be used if "as_record.ttl" is set to AS_RECORD_CLIENT_DEFAULT_TTL. The + * as_record instance is passed in to write functions along with as_policy_write. + * + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
+ */ + uint32_t ttl; + /** * Minimum record size beyond which it is compressed and sent to the server. */ @@ -636,18 +650,15 @@ typedef struct as_policy_apply_s { as_policy_commit_level commit_level; /** - * The time-to-live (expiration) of the record in seconds. - * There are also special values that can be set in the record TTL: - * (*) ZERO (defined as AS_RECORD_DEFAULT_TTL), which means that the - * record will adopt the default TTL value from the namespace. - * (*) 0xFFFFFFFF (also, -1 in a signed 32 bit int) - * (defined as AS_RECORD_NO_EXPIRE_TTL), which means that the record - * will get an internal "void_time" of zero, and thus will never expire. - * (*) 0xFFFFFFFE (also, -2 in a signed 32 bit int) - * (defined as AS_RECORD_NO_CHANGE_TTL), which means that the record - * ttl will not change when the record is updated. + * The time-to-live (expiration) of the record in seconds. Note that ttl + * is only used on write/update calls. * - * Note that the TTL value will be employed ONLY on write/update calls. + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
*/ uint32_t ttl; @@ -712,6 +723,20 @@ typedef struct as_policy_operate_s { */ as_policy_exists exists; + /** + * The default time-to-live (expiration) of the record in seconds. This field will + * only be used if "as_operations.ttl" is set to AS_RECORD_CLIENT_DEFAULT_TTL. The + * as_operations instance is passed in to operate functions along with as_policy_operate. + * + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
+ */ + uint32_t ttl; + /** * Should raw bytes representing a list or map be deserialized to as_list or as_map. * Set to false for backup programs that just need access to raw bytes. @@ -980,6 +1005,20 @@ typedef struct as_policy_batch_write_s { */ as_policy_exists exists; + /** + * The default time-to-live (expiration) of the record in seconds. This field will only be + * used if "as_operations.ttl" is set to AS_RECORD_CLIENT_DEFAULT_TTL. The as_operations + * instance is passed in to batch write functions along with as_policy_batch_write. + * + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
+ */ + uint32_t ttl; + /** * If the transaction results in a record deletion, leave a tombstone for the record. * This prevents deleted records from reappearing after node failures. @@ -1021,18 +1060,15 @@ typedef struct as_policy_batch_apply_s { as_policy_commit_level commit_level; /** - * The time-to-live (expiration) of the record in seconds. - * There are also special values that can be set in the record TTL: - * (*) ZERO (defined as AS_RECORD_DEFAULT_TTL), which means that the - * record will adopt the default TTL value from the namespace. - * (*) 0xFFFFFFFF (also, -1 in a signed 32 bit int) - * (defined as AS_RECORD_NO_EXPIRE_TTL), which means that the record - * will get an internal "void_time" of zero, and thus will never expire. - * (*) 0xFFFFFFFE (also, -2 in a signed 32 bit int) - * (defined as AS_RECORD_NO_CHANGE_TTL), which means that the record - * ttl will not change when the record is updated. + * The time-to-live (expiration) of the record in seconds. Note that ttl + * is only used on write/update calls. * - * Note that the TTL value will be employed ONLY on write/update calls. + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
*/ uint32_t ttl; @@ -1185,6 +1221,19 @@ typedef struct as_policy_scan_s { */ as_policy_replica replica; + /** + * The default time-to-live (expiration) of the record in seconds. This field will only be + * used on background scan writes if "as_scan.ttl" is set to AS_RECORD_CLIENT_DEFAULT_TTL. + * + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
+ */ + uint32_t ttl; + /** * If the transaction results in a record deletion, leave a tombstone for the record. * This prevents deleted records from reappearing after node failures. @@ -1426,6 +1475,7 @@ as_policy_write_init(as_policy_write* p) p->commit_level = AS_POLICY_COMMIT_LEVEL_DEFAULT; p->gen = AS_POLICY_GEN_DEFAULT; p->exists = AS_POLICY_EXISTS_DEFAULT; + p->ttl = 0; // AS_RECORD_DEFAULT_TTL p->compression_threshold = AS_POLICY_COMPRESSION_THRESHOLD_DEFAULT; p->durable_delete = false; return p; @@ -1464,6 +1514,7 @@ as_policy_operate_init(as_policy_operate* p) p->commit_level = AS_POLICY_COMMIT_LEVEL_DEFAULT; p->gen = AS_POLICY_GEN_DEFAULT; p->exists = AS_POLICY_EXISTS_DEFAULT; + p->ttl = 0; // AS_RECORD_DEFAULT_TTL p->deserialize = true; p->durable_delete = false; p->async_heap_rec = false; @@ -1632,6 +1683,7 @@ as_policy_batch_write_init(as_policy_batch_write* p) p->commit_level = AS_POLICY_COMMIT_LEVEL_DEFAULT; p->gen = AS_POLICY_GEN_DEFAULT; p->exists = AS_POLICY_EXISTS_DEFAULT; + p->ttl = 0; // AS_RECORD_DEFAULT_TTL p->durable_delete = false; return p; } @@ -1646,7 +1698,7 @@ as_policy_batch_apply_init(as_policy_batch_apply* p) p->filter_exp = NULL; p->key = AS_POLICY_KEY_DEFAULT; p->commit_level = AS_POLICY_COMMIT_LEVEL_DEFAULT; - p->ttl = 0; + p->ttl = 0; // AS_RECORD_DEFAULT_TTL p->durable_delete = false; return p; } @@ -1682,6 +1734,7 @@ as_policy_scan_init(as_policy_scan* p) p->max_records = 0; p->records_per_second = 0; p->replica = AS_POLICY_REPLICA_SEQUENCE; + p->ttl = 0; // AS_RECORD_DEFAULT_TTL p->durable_delete = false; return p; } diff --git a/src/include/aerospike/as_query.h b/src/include/aerospike/as_query.h index 6e4436c24..d38860bf4 100644 --- a/src/include/aerospike/as_query.h +++ b/src/include/aerospike/as_query.h @@ -544,18 +544,16 @@ typedef struct as_query_s { uint32_t records_per_second; /** - * The time-to-live (expiration) of the record in seconds. - * There are also special values that can be set in the record TTL: - * (*) ZERO (defined as AS_RECORD_DEFAULT_TTL), which means that the - * record will adopt the default TTL value from the namespace. - * (*) 0xFFFFFFFF (also, -1 in a signed 32 bit int) - * (defined as AS_RECORD_NO_EXPIRE_TTL), which means that the record - * will get an internal "void_time" of zero, and thus will never expire. - * (*) 0xFFFFFFFE (also, -2 in a signed 32 bit int) - * (defined as AS_RECORD_NO_CHANGE_TTL), which means that the record - * ttl will not change when the record is updated. + * The time-to-live (expiration) of the record in seconds. Note that ttl + * is only used on background query writes. * - * Note that the TTL value will be employed ONLY on background query writes. + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
  • AS_RECORD_CLIENT_DEFAULT_TTL: Use the default client ttl in as_policy_write.
  • + *
*/ uint32_t ttl; diff --git a/src/include/aerospike/as_record.h b/src/include/aerospike/as_record.h index 71460137e..825cfe27a 100644 --- a/src/include/aerospike/as_record.h +++ b/src/include/aerospike/as_record.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -186,17 +186,14 @@ typedef struct as_record_s { /** * The time-to-live (expiration) of the record in seconds. - * There are also special values that can be set in the record TTL: - * (*) ZERO (defined as AS_RECORD_DEFAULT_TTL), which means that the - * record will adopt the default TTL value from the namespace. - * (*) 0xFFFFFFFF (also, -1 in a signed 32 bit int) - * (defined as AS_RECORD_NO_EXPIRE_TTL), which means that the record - * will get an internal "void_time" of zero, and thus will never expire. - * (*) 0xFFFFFFFE (also, -2 in a signed 32 bit int) - * (defined as AS_RECORD_NO_CHANGE_TTL), which means that the record - * ttl will not change when the record is updated. * - * Note that the TTL value will be employed ONLY on write/update calls. + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
  • AS_RECORD_CLIENT_DEFAULT_TTL: Use the default client ttl in as_policy_write.
  • + *
*/ uint32_t ttl; @@ -209,7 +206,7 @@ typedef struct as_record_s { /** * When the record is given a TTL value of ZERO, it will adopt the TTL value - * that is the default TTL value for the namespace (defined in the config file). + * that is the server default TTL value for the namespace (defined in the config file). */ #define AS_RECORD_DEFAULT_TTL 0 @@ -226,6 +223,13 @@ typedef struct as_record_s { */ #define AS_RECORD_NO_CHANGE_TTL 0xFFFFFFFE +/** + * When the record is given a TTL value of 0xFFFFFFFD, the default client ttl in + * in as_policy_write or as_policy_operate will be used. This value must only be + * used in as_record.ttl or as_operations.ttl. + */ +#define AS_RECORD_CLIENT_DEFAULT_TTL 0xFFFFFFFD + /****************************************************************************** * MACROS *****************************************************************************/ diff --git a/src/include/aerospike/as_scan.h b/src/include/aerospike/as_scan.h index fe6676d44..d53cff4f2 100644 --- a/src/include/aerospike/as_scan.h +++ b/src/include/aerospike/as_scan.h @@ -305,18 +305,16 @@ typedef struct as_scan_s { as_partitions_status* parts_all; /** - * The time-to-live (expiration) of the record in seconds. - * There are also special values that can be set in the record TTL: - * (*) ZERO (defined as AS_RECORD_DEFAULT_TTL), which means that the - * record will adopt the default TTL value from the namespace. - * (*) 0xFFFFFFFF (also, -1 in a signed 32 bit int) - * (defined as AS_RECORD_NO_EXPIRE_TTL), which means that the record - * will get an internal "void_time" of zero, and thus will never expire. - * (*) 0xFFFFFFFE (also, -2 in a signed 32 bit int) - * (defined as AS_RECORD_NO_CHANGE_TTL), which means that the record - * ttl will not change when the record is updated. + * The time-to-live (expiration) of the record in seconds. Note that ttl + * is only used on background scan writes. * - * Note that the TTL value will be employed ONLY on background scan writes. + * There are also special values that can be set in the record ttl: + *
    + *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • + *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • + *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • + *
  • AS_RECORD_CLIENT_DEFAULT_TTL: Use the default client ttl in as_policy_write.
  • + *
*/ uint32_t ttl; diff --git a/src/main/aerospike/aerospike_batch.c b/src/main/aerospike/aerospike_batch.c index 5c3bae809..5a52008da 100644 --- a/src/main/aerospike/aerospike_batch.c +++ b/src/main/aerospike/aerospike_batch.c @@ -1141,7 +1141,7 @@ as_batch_attr_read_adjust(as_batch_attr* attr, bool read_all_bins) } static void -as_batch_attr_write_header(as_batch_attr* attr, as_operations* ops) +as_batch_attr_write_header(as_batch_attr* attr, const as_policy_batch_write* p, as_operations* ops) { attr->filter_exp = NULL; attr->read_attr = 0; @@ -1162,7 +1162,7 @@ as_batch_attr_write_header(as_batch_attr* attr, as_operations* ops) } attr->info_attr = 0; - attr->ttl = ops->ttl; + attr->ttl = (ops->ttl == AS_RECORD_CLIENT_DEFAULT_TTL && p)? p->ttl : ops->ttl; attr->gen = 0; attr->has_write = true; attr->send_key = false; @@ -1171,7 +1171,7 @@ as_batch_attr_write_header(as_batch_attr* attr, as_operations* ops) static void as_batch_attr_write_row(as_batch_attr* attr, const as_policy_batch_write* p, as_operations* ops) { - as_batch_attr_write_header(attr, ops); + as_batch_attr_write_header(attr, p, ops); attr->filter_exp = p->filter_exp; attr->send_key = (p->key == AS_POLICY_KEY_SEND); @@ -1466,7 +1466,7 @@ as_batch_records_write_new( as_batch_attr_write_row(&attr, bw->policy, bw->ops); } else { - as_batch_attr_write_header(&attr, bw->ops); + as_batch_attr_write_header(&attr, NULL, bw->ops); } p = as_batch_write_operations(p, &bw->key, &attr, attr.filter_exp, bw->ops, bb->buffers); diff --git a/src/main/aerospike/aerospike_key.c b/src/main/aerospike/aerospike_key.c index 271888a14..927f1c80b 100644 --- a/src/main/aerospike/aerospike_key.c +++ b/src/main/aerospike/aerospike_key.c @@ -533,9 +533,10 @@ as_put_write(void* udata, uint8_t* buf) as_put* put = udata; const as_policy_write* policy = put->policy; as_record* rec = put->rec; + uint32_t ttl = (rec->ttl == AS_RECORD_CLIENT_DEFAULT_TTL)? policy->ttl : rec->ttl; uint8_t* p = as_command_write_header_write(buf, &policy->base, policy->commit_level, - policy->exists, policy->gen, rec->gen, rec->ttl, put->n_fields, put->n_bins, + policy->exists, policy->gen, rec->gen, ttl, put->n_fields, put->n_bins, policy->durable_delete, 0, AS_MSG_INFO2_WRITE, 0); p = as_command_write_key(p, policy->key, put->key); @@ -917,9 +918,10 @@ as_operate_write(void* udata, uint8_t* buf) as_operate* oper = udata; const as_policy_operate* policy = oper->policy; const as_operations* ops = oper->ops; + uint32_t ttl = (ops->ttl == AS_RECORD_CLIENT_DEFAULT_TTL)? policy->ttl : ops->ttl; uint8_t* p = as_command_write_header_write(buf, &policy->base, policy->commit_level, - policy->exists, policy->gen, ops->gen, ops->ttl, oper->n_fields, + policy->exists, policy->gen, ops->gen, ttl, oper->n_fields, oper->n_operations, policy->durable_delete, oper->read_attr, oper->write_attr, oper->info_attr); diff --git a/src/main/aerospike/aerospike_query.c b/src/main/aerospike/aerospike_query.c index 5c6359115..7efac4333 100644 --- a/src/main/aerospike/aerospike_query.c +++ b/src/main/aerospike/aerospike_query.c @@ -878,14 +878,21 @@ as_query_command_init( else if (query->ops) { // Background query with operations. uint32_t ttl = (query->ttl)? query->ttl : query->ops->ttl; + + if (ttl == AS_RECORD_CLIENT_DEFAULT_TTL) { + ttl = write_policy->ttl; + } + p = as_command_write_header_write(cmd, base_policy, write_policy->commit_level, write_policy->exists, AS_POLICY_GEN_IGNORE, 0, ttl, qb->n_fields, qb->n_ops, write_policy->durable_delete, 0, AS_MSG_INFO2_WRITE, 0); } else { // Background query with UDF. + uint32_t ttl = (query->ttl == AS_RECORD_CLIENT_DEFAULT_TTL)? write_policy->ttl : query->ttl; + p = as_command_write_header_write(cmd, base_policy, write_policy->commit_level, - write_policy->exists, AS_POLICY_GEN_IGNORE, 0, query->ttl, qb->n_fields, qb->n_ops, + write_policy->exists, AS_POLICY_GEN_IGNORE, 0, ttl, qb->n_fields, qb->n_ops, write_policy->durable_delete, 0, AS_MSG_INFO2_WRITE, 0); } diff --git a/src/main/aerospike/aerospike_scan.c b/src/main/aerospike/aerospike_scan.c index 54c72b901..15334c05d 100644 --- a/src/main/aerospike/aerospike_scan.c +++ b/src/main/aerospike/aerospike_scan.c @@ -500,14 +500,21 @@ as_scan_command_init( if (scan->ops) { // Background scan with operations. uint32_t ttl = (scan->ttl)? scan->ttl : scan->ops->ttl; + + if (ttl == AS_RECORD_CLIENT_DEFAULT_TTL) { + ttl = policy->ttl; + } + p = as_command_write_header_write(cmd, &policy->base, AS_POLICY_COMMIT_LEVEL_ALL, AS_POLICY_EXISTS_IGNORE, AS_POLICY_GEN_IGNORE, 0, ttl, sb->n_fields, n_ops, policy->durable_delete, 0, AS_MSG_INFO2_WRITE, 0); } else if (scan->apply_each.function[0]) { // Background scan with UDF. + uint32_t ttl = (scan->ttl == AS_RECORD_CLIENT_DEFAULT_TTL)? policy->ttl : scan->ttl; + p = as_command_write_header_write(cmd, &policy->base, AS_POLICY_COMMIT_LEVEL_ALL, - AS_POLICY_EXISTS_IGNORE, AS_POLICY_GEN_IGNORE, 0, scan->ttl, sb->n_fields, n_ops, + AS_POLICY_EXISTS_IGNORE, AS_POLICY_GEN_IGNORE, 0, ttl, sb->n_fields, n_ops, policy->durable_delete, 0, AS_MSG_INFO2_WRITE, 0); } else { diff --git a/src/test/aerospike_batch/batch.c b/src/test/aerospike_batch/batch.c index fdc0b182e..4b9c6b5f2 100644 --- a/src/test/aerospike_batch/batch.c +++ b/src/test/aerospike_batch/batch.c @@ -563,7 +563,7 @@ batch_write_operate_cb(const as_batch_result* results, uint32_t n, void* udata) return true; } -TEST(batch_write_list_operate, "Batch write list operate") +TEST(batch_write_list_operate, "Batch write list operate with default ttl") { as_batch batch; as_batch_inita(&batch, N_KEYS); @@ -581,10 +581,15 @@ TEST(batch_write_list_operate, "Batch write list operate") as_operations_list_insert(&ops, LIST_BIN, NULL, NULL, 0, (as_val*)&val); as_operations_list_size(&ops, LIST_BIN, NULL); as_operations_list_get_by_index(&ops, LIST_BIN, NULL, -1, AS_LIST_RETURN_VALUE); + ops.ttl = AS_RECORD_CLIENT_DEFAULT_TTL; + + as_policy_batch_write p; + as_policy_batch_write_init(&p); + p.ttl = 5000; batch_stats data = {0}; as_error err; - as_status status = aerospike_batch_operate(as, &err, NULL, NULL, &batch, &ops, + as_status status = aerospike_batch_operate(as, &err, NULL, &p, &batch, &ops, batch_write_operate_cb, &data); as_operations_destroy(&ops); diff --git a/src/test/aerospike_key/key_basics.c b/src/test/aerospike_key/key_basics.c index 9ef0e07c4..da2225a2b 100644 --- a/src/test/aerospike_key/key_basics.c +++ b/src/test/aerospike_key/key_basics.c @@ -347,8 +347,10 @@ TEST( key_basics_put_generation , "put generation: (test,test,foo)" ) { as_policy_write wpol; as_policy_write_init(&wpol); wpol.gen = AS_POLICY_GEN_EQ; // perform generation equality check on writes + wpol.ttl = 5000; rec->gen = 2; // generation in database should be 1, so this should fail + rec->ttl = AS_RECORD_CLIENT_DEFAULT_TTL; rc = aerospike_key_put(as, &err, &wpol, &key, rec); diff --git a/src/test/aerospike_key/key_basics_async.c b/src/test/aerospike_key/key_basics_async.c index 535507199..11b1eea73 100644 --- a/src/test/aerospike_key/key_basics_async.c +++ b/src/test/aerospike_key/key_basics_async.c @@ -410,6 +410,7 @@ as_put_operate_callback_heap(as_error* err, void* udata, as_event_loop* event_lo as_policy_operate p; as_policy_operate_init(&p); p.async_heap_rec = true; + p.ttl = 10000; as_key key; as_key_init(&key, NAMESPACE, SET, "paheap5"); @@ -421,6 +422,7 @@ as_put_operate_callback_heap(as_error* err, void* udata, as_event_loop* event_lo as_operations_add_prepend_str(&ops, "b", "abc"); as_operations_add_read(&ops, "a"); as_operations_add_read(&ops, "b"); + ops.ttl = AS_RECORD_CLIENT_DEFAULT_TTL; as_error e; as_status status = aerospike_key_operate_async(as, &e, &p, &key, &ops, as_operate_callback_heap, __result__, event_loop, NULL); From 29860294a714d254c71d4325d8242b66f7a773eb Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 6 Nov 2023 19:15:24 -0800 Subject: [PATCH 25/35] CLIENT-2647 Use default ttl in as_batch_records_write_new() as well. --- src/main/aerospike/aerospike_batch.c | 40 +++++++++++++++------------- src/test/aerospike_batch/batch.c | 9 +++++++ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/main/aerospike/aerospike_batch.c b/src/main/aerospike/aerospike_batch.c index 5a52008da..5ea035504 100644 --- a/src/main/aerospike/aerospike_batch.c +++ b/src/main/aerospike/aerospike_batch.c @@ -103,6 +103,7 @@ typedef struct as_batch_task_s { typedef struct as_batch_task_records_s { as_batch_task base; + as_policies* defs; as_vector* records; } as_batch_task_records; @@ -1401,7 +1402,7 @@ as_batch_write_udf( static size_t as_batch_records_write_new( - const as_policy_batch* policy, as_vector* records, as_vector* offsets, as_batch_builder* bb, + const as_policy_batch* policy, as_policies* defs, as_vector* records, as_vector* offsets, as_batch_builder* bb, uint8_t* cmd ) { @@ -1466,7 +1467,7 @@ as_batch_records_write_new( as_batch_attr_write_row(&attr, bw->policy, bw->ops); } else { - as_batch_attr_write_header(&attr, NULL, bw->ops); + as_batch_attr_write_header(&attr, &defs->batch_write, bw->ops); } p = as_batch_write_operations(p, &bw->key, &attr, attr.filter_exp, bw->ops, bb->buffers); @@ -1507,12 +1508,12 @@ as_batch_records_write_new( static inline size_t as_batch_records_write( - const as_policy_batch* policy, as_vector* records, as_vector* offsets, as_batch_builder* bb, + const as_policy_batch* policy, as_policies* defs, as_vector* records, as_vector* offsets, as_batch_builder* bb, uint8_t* cmd ) { if (bb->batch_any) { - return as_batch_records_write_new(policy, records, offsets, bb, cmd); + return as_batch_records_write_new(policy, defs, records, offsets, bb, cmd); } else { return as_batch_records_write_old(policy, records, offsets, bb, cmd); @@ -1709,7 +1710,7 @@ as_batch_execute_records(as_batch_task_records* btr, as_error* err, as_command* // Write command size_t capacity = bb.size; uint8_t* buf = as_command_buffer_init(capacity); - size_t size = as_batch_records_write(policy, btr->records, &task->offsets, &bb, buf); + size_t size = as_batch_records_write(policy, btr->defs, btr->records, &task->offsets, &bb, buf); as_batch_builder_destroy(&bb); if (policy->base.compress && size > AS_COMPRESS_THRESHOLD) { @@ -2276,9 +2277,9 @@ as_batch_keys_execute( static as_status as_batch_execute_sync( - as_cluster* cluster, as_error* err, const as_policy_batch* policy, bool has_write, - as_batch_replica* rep, as_vector* records, uint32_t n_keys, as_vector* batch_nodes, - as_command* parent, bool* error_row + as_cluster* cluster, as_error* err, const as_policy_batch* policy, as_policies* defs, + bool has_write, as_batch_replica* rep, as_vector* records, uint32_t n_keys, + as_vector* batch_nodes, as_command* parent, bool* error_row ) { as_status status = AEROSPIKE_OK; @@ -2300,6 +2301,7 @@ as_batch_execute_sync( btr.base.has_write = has_write; btr.base.replica_index = rep->replica_index; btr.base.replica_index_sc = rep->replica_index_sc; + btr.defs = defs; btr.records = records; if (policy->concurrent && n_batch_nodes > 1 && parent == NULL) { @@ -2428,8 +2430,9 @@ as_batch_command_create( static as_status as_batch_execute_async( - as_cluster* cluster, as_error* err, const as_policy_batch* policy, as_batch_replica* rep, - as_vector* records, as_vector* batch_nodes, as_async_batch_executor* executor + as_cluster* cluster, as_error* err, const as_policy_batch* policy, as_policies* defs, + as_batch_replica* rep, as_vector* records, as_vector* batch_nodes, + as_async_batch_executor* executor ) { uint32_t n_batch_nodes = batch_nodes->size; @@ -2476,8 +2479,8 @@ as_batch_execute_async( as_event_command* cmd = &bc->command; - cmd->write_len = (uint32_t)as_batch_records_write(policy, records, &batch_node->offsets, - &bb, cmd->buf); + cmd->write_len = (uint32_t)as_batch_records_write(policy, defs, records, + &batch_node->offsets, &bb, cmd->buf); status = as_event_command_execute(cmd, err); } @@ -2486,7 +2489,8 @@ as_batch_execute_async( // First write uncompressed buffer. size_t capacity = bb.size; uint8_t* ubuf = cf_malloc(capacity); - size_t size = as_batch_records_write(policy, records, &batch_node->offsets, &bb, ubuf); + size_t size = as_batch_records_write(policy, defs, records, &batch_node->offsets, &bb, + ubuf); // Allocate command with compressed upper bound. size_t comp_size = as_command_compress_max_size(size); @@ -2636,12 +2640,12 @@ as_batch_records_execute( if (async_executor) { async_executor->error_row = error_row; - return as_batch_execute_async(cluster, err, policy, &rep, list, &batch_nodes, - async_executor); + return as_batch_execute_async(cluster, err, policy, &as->config.policies, &rep, list, + &batch_nodes, async_executor); } else { - status = as_batch_execute_sync(cluster, err, policy, has_write, &rep, list, n_keys, - &batch_nodes, NULL, &error_row); + status = as_batch_execute_sync(cluster, err, policy, &as->config.policies, has_write, &rep, + list, n_keys, &batch_nodes, NULL, &error_row); if (status != AEROSPIKE_OK) { return status; @@ -2783,7 +2787,7 @@ as_batch_retry_records(as_batch_task_records* btr, as_command* parent, as_error* } parent->flags |= AS_COMMAND_FLAGS_SPLIT_RETRY; - return as_batch_execute_sync(cluster, err, task->policy, task->has_write, &rep, + return as_batch_execute_sync(cluster, err, task->policy, btr->defs, task->has_write, &rep, list, task->n_keys, &batch_nodes, parent, task->error_row); } diff --git a/src/test/aerospike_batch/batch.c b/src/test/aerospike_batch/batch.c index 4b9c6b5f2..b868bebdb 100644 --- a/src/test/aerospike_batch/batch.c +++ b/src/test/aerospike_batch/batch.c @@ -605,14 +605,17 @@ TEST(batch_write_complex, "Batch write complex") as_operations wops1; as_operations_inita(&wops1, 1); as_operations_add_write_int64(&wops1, bin2, 100); + wops1.ttl = AS_RECORD_CLIENT_DEFAULT_TTL; as_operations wops2; as_operations_inita(&wops2, 1); as_operations_exp_write(&wops2, bin3, wexp1, AS_EXP_WRITE_DEFAULT); + wops2.ttl = AS_RECORD_CLIENT_DEFAULT_TTL; as_policy_batch_write wp; as_policy_batch_write_init(&wp); wp.key = AS_POLICY_KEY_SEND; + wp.ttl = 500; as_batch_records recs; as_batch_records_inita(&recs, 3); @@ -629,9 +632,15 @@ TEST(batch_write_complex, "Batch write complex") as_batch_remove_record* rm = as_batch_remove_reserve(&recs); as_key_init_int64(&rm->key, NAMESPACE, SET, 10002); + // Test default ttl. + as->config.policies.batch_write.ttl = 1000; + as_error err; as_status status = aerospike_batch_write(as, &err, NULL, &recs); + // Reset default ttl. + as->config.policies.batch_write.ttl = 0; + assert_int_eq(status, AEROSPIKE_OK); assert_int_eq(wr1->result, AEROSPIKE_OK); From 60ee9b86e56f690299a9b750bb01d8d5b0ce769f Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Wed, 8 Nov 2023 11:14:02 -0800 Subject: [PATCH 26/35] CLIENT-2647 Update docs for ttl special values. Use void argument in function declaration when the function has no arguments. Fix lua library search path. --- src/include/aerospike/as_command.h | 2 +- src/include/aerospike/as_record.h | 17 +++++++---------- src/include/aerospike/as_scan.h | 2 +- src/main/aerospike/as_command.c | 2 +- xcode/aerospike-test.xcodeproj/project.pbxproj | 10 +++++++--- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/include/aerospike/as_command.h b/src/include/aerospike/as_command.h index effe1a455..c81806197 100644 --- a/src/include/aerospike/as_command.h +++ b/src/include/aerospike/as_command.h @@ -668,7 +668,7 @@ as_task_id_resolve(uint64_t* task_id_ptr) * Return command's starting replica index for AS_POLICY_REPLICA_ANY. */ uint8_t -as_replica_index_any(); +as_replica_index_any(void); /** * @private diff --git a/src/include/aerospike/as_record.h b/src/include/aerospike/as_record.h index 825cfe27a..e00c52116 100644 --- a/src/include/aerospike/as_record.h +++ b/src/include/aerospike/as_record.h @@ -205,28 +205,25 @@ typedef struct as_record_s { } as_record; /** - * When the record is given a TTL value of ZERO, it will adopt the TTL value - * that is the server default TTL value for the namespace (defined in the config file). + * Use the server default ttl for the namespace in the aerospke server config file. */ #define AS_RECORD_DEFAULT_TTL 0 /** - * When the record is given a TTL value of 0xFFFFFFFF, it will set the internal - * void_time value (the absolute clock time value that shows when a record - * will expire) to zero, which means the record will never expire + * Set the internal void_time value (the absolute clock time value that shows when a record + * will expire) to zero, which means the record will never expire. */ #define AS_RECORD_NO_EXPIRE_TTL 0xFFFFFFFF /** - * When the record is given a TTL value of 0xFFFFFFFE, the TTL will not change - * when a record is updated. + * Do not change the ttl when the record is updated. */ #define AS_RECORD_NO_CHANGE_TTL 0xFFFFFFFE /** - * When the record is given a TTL value of 0xFFFFFFFD, the default client ttl in - * in as_policy_write or as_policy_operate will be used. This value must only be - * used in as_record.ttl or as_operations.ttl. + * Use the applicable client policy ttl in as_policy_write, as_policy_operate or + * as_policy_scan. If the policy is not defined for the transaction, use the default + * in as_config.policies. */ #define AS_RECORD_CLIENT_DEFAULT_TTL 0xFFFFFFFD diff --git a/src/include/aerospike/as_scan.h b/src/include/aerospike/as_scan.h index d53cff4f2..64475e177 100644 --- a/src/include/aerospike/as_scan.h +++ b/src/include/aerospike/as_scan.h @@ -313,7 +313,7 @@ typedef struct as_scan_s { *
  • AS_RECORD_DEFAULT_TTL: Use the server default ttl from the namespace.
  • *
  • AS_RECORD_NO_EXPIRE_TTL: Do not expire the record.
  • *
  • AS_RECORD_NO_CHANGE_TTL: Keep the existing record ttl when the record is updated.
  • - *
  • AS_RECORD_CLIENT_DEFAULT_TTL: Use the default client ttl in as_policy_write.
  • + *
  • AS_RECORD_CLIENT_DEFAULT_TTL: Use the default client ttl in as_policy_scan.
  • * */ uint32_t ttl; diff --git a/src/main/aerospike/as_command.c b/src/main/aerospike/as_command.c index 1dc48cf23..5c80e014d 100644 --- a/src/main/aerospike/as_command.c +++ b/src/main/aerospike/as_command.c @@ -46,7 +46,7 @@ static uint32_t g_replica_rr = 0; *****************************************************************************/ uint8_t -as_replica_index_any() +as_replica_index_any(void) { uint32_t seq = as_faa_uint32(&g_replica_rr, 1); return (uint8_t)(seq % AS_MAX_REPLICATION_FACTOR); diff --git a/xcode/aerospike-test.xcodeproj/project.pbxproj b/xcode/aerospike-test.xcodeproj/project.pbxproj index f863b5b18..1ee342759 100644 --- a/xcode/aerospike-test.xcodeproj/project.pbxproj +++ b/xcode/aerospike-test.xcodeproj/project.pbxproj @@ -424,7 +424,7 @@ BFB7BC6618CAA88000F0D4A0 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1340; + LastUpgradeCheck = 1420; ORGANIZATIONNAME = Aerospike; }; buildConfigurationList = BFB7BC6918CAA88000F0D4A0 /* Build configuration list for PBXProject "aerospike-test" */; @@ -550,6 +550,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -612,6 +613,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -642,6 +644,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = "-"; + DEAD_CODE_STRIPPING = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, @@ -653,7 +656,7 @@ ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", - ../modules/lua/src, + ../modules/lua, "$(OpenSSL)/lib", "$(External)/lib", ); @@ -669,6 +672,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = "-"; + DEAD_CODE_STRIPPING = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, @@ -680,7 +684,7 @@ ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", - ../modules/lua/src, + ../modules/lua, "$(OpenSSL)/lib", "$(External)/lib", ); From 916acf7905185f02c4296801e6fc792078d3a0bf Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Wed, 8 Nov 2023 12:32:50 -0800 Subject: [PATCH 27/35] Add as_policy_batch_write to AS_RECORD_CLIENT_DEFAULT_TTL doc. --- src/include/aerospike/as_record.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/aerospike/as_record.h b/src/include/aerospike/as_record.h index e00c52116..ba4d9923b 100644 --- a/src/include/aerospike/as_record.h +++ b/src/include/aerospike/as_record.h @@ -221,8 +221,8 @@ typedef struct as_record_s { #define AS_RECORD_NO_CHANGE_TTL 0xFFFFFFFE /** - * Use the applicable client policy ttl in as_policy_write, as_policy_operate or - * as_policy_scan. If the policy is not defined for the transaction, use the default + * Use the applicable client policy ttl (as_policy_write, as_policy_operate, as_policy_scan, + * as_policy_batch_write, ...). If the policy is not defined for the transaction, use the default * in as_config.policies. */ #define AS_RECORD_CLIENT_DEFAULT_TTL 0xFFFFFFFD From 94b218363c797448593f1b799c5b6852d786d67c Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Fri, 1 Dec 2023 15:53:31 -0800 Subject: [PATCH 28/35] =?UTF-8?q?CLIENT-2706=20In=20scan/query=20with=20ma?= =?UTF-8?q?x=5Frecords=20set,=20count=20discarded=20records=20that=20would?= =?UTF-8?q?=20have=20exceeded=20max=5Frecords.=20This=20count=20is=20used?= =?UTF-8?q?=20to=20correctly=20determine=20if=20a=20node=E2=80=99s=20parti?= =?UTF-8?q?tions=20should=20be=20retried=20on=20the=20next=20scan/query=20?= =?UTF-8?q?page.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/aerospike/as_partition_tracker.h | 21 ++++++++++++++++---- src/main/aerospike/aerospike_query.c | 4 ++-- src/main/aerospike/aerospike_scan.c | 4 ++-- src/main/aerospike/as_partition_tracker.c | 4 ++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/include/aerospike/as_partition_tracker.h b/src/include/aerospike/as_partition_tracker.h index 6ea88216d..d5a3b2ecf 100644 --- a/src/include/aerospike/as_partition_tracker.h +++ b/src/include/aerospike/as_partition_tracker.h @@ -44,6 +44,7 @@ typedef struct as_node_partitions_s { as_vector parts_partial; uint64_t record_count; uint64_t record_max; + uint64_t disallowed_count; uint32_t parts_unavailable; } as_node_partitions; @@ -138,17 +139,29 @@ as_partition_tracker_set_last( } static inline bool -as_partition_tracker_reached_max_records_sync(as_partition_tracker* pt) +as_partition_tracker_reached_max_records_sync(as_partition_tracker* pt, as_node_partitions* np) { // Sync scan/query runs in multiple threads, so atomics are required. - return pt && pt->check_max && (as_aaf_uint64(&pt->record_count, 1) > pt->max_records); + if (pt && pt->check_max && (as_aaf_uint64(&pt->record_count, 1) > pt->max_records)) { + // Record was returned, but would exceed max_records. + // Discard record and increment disallowed_count. + np->disallowed_count++; + return true; + } + return false; } static inline bool -as_partition_tracker_reached_max_records_async(as_partition_tracker* pt) +as_partition_tracker_reached_max_records_async(as_partition_tracker* pt, as_node_partitions* np) { // Async scan/query runs in a single event loop thread, so atomics are not necessary. - return pt && pt->check_max && (++pt->record_count > pt->max_records); + if (pt && pt->check_max && (++pt->record_count > pt->max_records)) { + // Record was returned, but would exceed max_records. + // Discard record and increment disallowed_count. + np->disallowed_count++; + return true; + } + return false; } static inline uint16_t diff --git a/src/main/aerospike/aerospike_query.c b/src/main/aerospike/aerospike_query.c index 7efac4333..348d84d3d 100644 --- a/src/main/aerospike/aerospike_query.c +++ b/src/main/aerospike/aerospike_query.c @@ -336,7 +336,7 @@ as_query_parse_record_async( return status; } - if (as_partition_tracker_reached_max_records_async(qe->pt)) { + if (as_partition_tracker_reached_max_records_async(qe->pt, qc->np)) { as_record_destroy(&rec); return AEROSPIKE_OK; } @@ -471,7 +471,7 @@ as_query_parse_record(uint8_t** pp, as_msg* msg, as_query_task* task, as_error* return status; } - if (as_partition_tracker_reached_max_records_sync(task->pt)) { + if (as_partition_tracker_reached_max_records_sync(task->pt, task->np)) { as_record_destroy(&rec); return AEROSPIKE_OK; } diff --git a/src/main/aerospike/aerospike_scan.c b/src/main/aerospike/aerospike_scan.c index 15334c05d..b303819c9 100644 --- a/src/main/aerospike/aerospike_scan.c +++ b/src/main/aerospike/aerospike_scan.c @@ -201,7 +201,7 @@ as_scan_parse_record_async( return status; } - if (as_partition_tracker_reached_max_records_async(se->pt)) { + if (as_partition_tracker_reached_max_records_async(se->pt, sc->np)) { as_record_destroy(&rec); return AEROSPIKE_OK; } @@ -305,7 +305,7 @@ as_scan_parse_record(uint8_t** pp, as_msg* msg, as_scan_task* task, as_error* er return status; } - if (as_partition_tracker_reached_max_records_sync(task->pt)) { + if (as_partition_tracker_reached_max_records_sync(task->pt, task->np)) { as_record_destroy(&rec); return AEROSPIKE_OK; } diff --git a/src/main/aerospike/as_partition_tracker.c b/src/main/aerospike/as_partition_tracker.c index 2b3d00640..eff56fe07 100644 --- a/src/main/aerospike/as_partition_tracker.c +++ b/src/main/aerospike/as_partition_tracker.c @@ -446,7 +446,7 @@ as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, for (uint32_t i = 0; i < list->size; i++) { as_node_partitions* np = as_vector_get(list, i); - if (np->record_count >= np->record_max) { + if (np->record_count + np->disallowed_count >= np->record_max) { mark_retry(pt, np); is_done = false; } @@ -460,7 +460,7 @@ as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, for (uint32_t i = 0; i < list->size; i++) { as_node_partitions* np = as_vector_get(list, i); - if (np->record_count > 0) { + if (np->record_count + np->disallowed_count > 0) { mark_retry(pt, np); } } From bce5d569c931315f3d1eb571e1f700bf4f3a0b7e Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 4 Dec 2023 10:18:44 -0800 Subject: [PATCH 29/35] CLIENT-2706 In scan/query with max_records set, mark node's partitions for retry on next scan/query page when that node returns records that are discarded due to exceeding max_records. --- src/include/aerospike/as_partition_tracker.h | 14 +++++++------- src/main/aerospike/as_partition_tracker.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/include/aerospike/as_partition_tracker.h b/src/include/aerospike/as_partition_tracker.h index d5a3b2ecf..d7edddf5c 100644 --- a/src/include/aerospike/as_partition_tracker.h +++ b/src/include/aerospike/as_partition_tracker.h @@ -44,8 +44,8 @@ typedef struct as_node_partitions_s { as_vector parts_partial; uint64_t record_count; uint64_t record_max; - uint64_t disallowed_count; uint32_t parts_unavailable; + bool retry; } as_node_partitions; /** @@ -143,9 +143,9 @@ as_partition_tracker_reached_max_records_sync(as_partition_tracker* pt, as_node_ { // Sync scan/query runs in multiple threads, so atomics are required. if (pt && pt->check_max && (as_aaf_uint64(&pt->record_count, 1) > pt->max_records)) { - // Record was returned, but would exceed max_records. - // Discard record and increment disallowed_count. - np->disallowed_count++; + // Record was returned, but would exceed max_records. Discard record + // and mark node for retry on next scan/query page. + np->retry = true; return true; } return false; @@ -156,9 +156,9 @@ as_partition_tracker_reached_max_records_async(as_partition_tracker* pt, as_node { // Async scan/query runs in a single event loop thread, so atomics are not necessary. if (pt && pt->check_max && (++pt->record_count > pt->max_records)) { - // Record was returned, but would exceed max_records. - // Discard record and increment disallowed_count. - np->disallowed_count++; + // Record was returned, but would exceed max_records. Discard record + // and mark node for retry on next scan/query page. + np->retry = true; return true; } return false; diff --git a/src/main/aerospike/as_partition_tracker.c b/src/main/aerospike/as_partition_tracker.c index eff56fe07..fa414e4ea 100644 --- a/src/main/aerospike/as_partition_tracker.c +++ b/src/main/aerospike/as_partition_tracker.c @@ -446,7 +446,7 @@ as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, for (uint32_t i = 0; i < list->size; i++) { as_node_partitions* np = as_vector_get(list, i); - if (np->record_count + np->disallowed_count >= np->record_max) { + if (np->retry || np->record_count >= np->record_max) { mark_retry(pt, np); is_done = false; } @@ -460,7 +460,7 @@ as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, for (uint32_t i = 0; i < list->size; i++) { as_node_partitions* np = as_vector_get(list, i); - if (np->record_count + np->disallowed_count > 0) { + if (np->retry || np->record_count > 0) { mark_retry(pt, np); } } From 87ebf03a64de1534464ef01647cf73fc01277eb0 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 18 Dec 2023 22:23:42 -0500 Subject: [PATCH 30/35] CLIENT-2729 Use as_event_loop_size instead of as_event_loop_capacity to check if async commands are enabled. This fixes a memory leak that was caused when event_loops were created and closed and then aerospike_close() was called afterwards. --- src/main/aerospike/aerospike.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/aerospike/aerospike.c b/src/main/aerospike/aerospike.c index 164aada90..dc28dc19a 100644 --- a/src/main/aerospike/aerospike.c +++ b/src/main/aerospike/aerospike.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -251,7 +251,7 @@ aerospike_close(aerospike* as, as_error* err) as_cluster* cluster = as->cluster; if (cluster) { - if (as_event_loop_capacity > 0 && !as_event_single_thread) { + if (as_event_loop_size > 0 && !as_event_single_thread) { // Async configurations will attempt to wait till pending async commands have completed. as_event_close_cluster(cluster); } From 15450d50e110b5b5fcb5147917bf795c75eba7ae Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Wed, 3 Jan 2024 17:30:31 -0500 Subject: [PATCH 31/35] CLIENT-2720 Include all partition unavailable errors in the scan/query sub-error list. --- src/include/aerospike/as_partition_tracker.h | 13 +-- src/main/aerospike/as_partition_tracker.c | 105 +++++++++++++------ 2 files changed, 76 insertions(+), 42 deletions(-) diff --git a/src/include/aerospike/as_partition_tracker.h b/src/include/aerospike/as_partition_tracker.h index d7edddf5c..76a5372b0 100644 --- a/src/include/aerospike/as_partition_tracker.h +++ b/src/include/aerospike/as_partition_tracker.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2023 Aerospike, Inc. + * Copyright 2008-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -101,17 +101,10 @@ as_partition_tracker_assign( as_partition_tracker* pt, struct as_cluster_s* cluster, const char* ns, struct as_error_s* err ); -static inline void +void as_partition_tracker_part_unavailable( as_partition_tracker* pt, as_node_partitions* np, uint32_t part_id - ) -{ - as_partitions_status* ps = pt->parts_all; - as_partition_status* p = &ps->parts[part_id - ps->part_begin]; - p->retry = true; - p->replica_index++; - np->parts_unavailable++; -} + ); static inline void as_partition_tracker_set_digest( diff --git a/src/main/aerospike/as_partition_tracker.c b/src/main/aerospike/as_partition_tracker.c index fa414e4ea..8e4c31dd5 100644 --- a/src/main/aerospike/as_partition_tracker.c +++ b/src/main/aerospike/as_partition_tracker.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2023 Aerospike, Inc. + * Copyright 2008-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -19,9 +19,20 @@ #include #include -/****************************************************************************** - * Static Functions - *****************************************************************************/ +//--------------------------------- +// Types +//--------------------------------- + +typedef struct { + char node_address[AS_IP_ADDRESS_SIZE]; + as_status status; + uint32_t iteration; + uint32_t part_id; +} query_error; + +//--------------------------------- +// Static Functions +//--------------------------------- static as_partitions_status* parts_create(uint16_t part_begin, uint16_t part_count, const as_digest* digest) @@ -157,6 +168,25 @@ assign_partition(as_partition_tracker* pt, as_partition_status* ps, as_node* nod } } +static void +add_error(as_partition_tracker* pt, as_node* node, as_status status, uint32_t part_id) +{ + query_error e; + as_strncpy(e.node_address, as_node_get_address_string(node), sizeof(e.node_address)); + e.status = status; + e.iteration = pt->iteration; + e.part_id = part_id; + + // Multiple scan/query threads may call this function, so error + // list must be modified under lock. + pthread_mutex_lock(&pt->lock); + if (!pt->errors) { + pt->errors = as_vector_create(sizeof(query_error), 32); + } + as_vector_append(pt->errors, &e); + pthread_mutex_unlock(&pt->lock); +} + static void mark_retry_on_error(as_partition_tracker* pt, as_node_partitions* np) { @@ -212,9 +242,9 @@ release_node_partitions(as_vector* list) } } -/****************************************************************************** - * Functions - *****************************************************************************/ +//--------------------------------- +// Functions +//--------------------------------- void as_partition_tracker_init_nodes( @@ -403,6 +433,19 @@ as_partition_tracker_assign( return AEROSPIKE_OK; } +void +as_partition_tracker_part_unavailable( + as_partition_tracker* pt, as_node_partitions* np, uint32_t part_id + ) +{ + as_partitions_status* ps = pt->parts_all; + as_partition_status* p = &ps->parts[part_id - ps->part_begin]; + p->retry = true; + p->replica_index++; + np->parts_unavailable++; + add_error(pt, np->node, AEROSPIKE_ERR_CLUSTER, part_id); +} + as_status as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, as_error* err) { @@ -476,16 +519,10 @@ as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, // Check if limits have been reached. if (pt->iteration > pt->max_retries) { - if (!pt->errors || pt->errors->size <= 0) { - // The only retryable errors that are not added to the errors list is - // AEROSPIKE_ERR_CLUSTER (ie some partition(s) are unavailable). - return as_error_set_message(err, AEROSPIKE_ERR_CLUSTER, "Partition(s) unavailable"); - } - // Return last sub-error code received. uint32_t max = pt->errors->size; - as_status last_code = *(as_status*)as_vector_get(pt->errors, max - 1); - as_error_set_message(err, last_code, ""); + query_error* last_error = as_vector_get(pt->errors, max - 1); + as_error_set_message(err, last_error->status, ""); // Include all sub-errors in error message. as_string_builder sb; @@ -495,11 +532,23 @@ as_partition_tracker_is_complete(as_partition_tracker* pt, as_cluster* cluster, as_string_builder_append(&sb, "sub-errors:"); for (uint32_t i = 0; i < max; i++) { - as_status st = *(as_status*)as_vector_get(pt->errors, i); + query_error* qe = as_vector_get(pt->errors, i); as_string_builder_append_newline(&sb); - as_string_builder_append_int(&sb, st); - as_string_builder_append_char(&sb, ' '); - as_string_builder_append(&sb, as_error_string(st)); + as_string_builder_append_int(&sb, qe->status); + as_string_builder_append_char(&sb, ','); + as_string_builder_append_uint(&sb, qe->iteration); + as_string_builder_append_char(&sb, ','); + as_string_builder_append(&sb, qe->node_address); + as_string_builder_append_char(&sb, ','); + + if (qe->status == AEROSPIKE_ERR_CLUSTER) { + as_string_builder_append(&sb, "Partition "); + as_string_builder_append_uint(&sb, qe->part_id); + as_string_builder_append(&sb, " unavailable"); + } + else { + as_string_builder_append(&sb, as_error_string(qe->status)); + } } return err->code; } @@ -545,15 +594,7 @@ as_partition_tracker_should_retry( case AEROSPIKE_ERR_TIMEOUT: case AEROSPIKE_ERR_INDEX_NOT_FOUND: case AEROSPIKE_ERR_INDEX_NOT_READABLE: - // Multiple scan/query threads may call this function, so error - // list must be modified under lock. - pthread_mutex_lock(&pt->lock); - if (!pt->errors) { - pt->errors = as_vector_create(sizeof(as_status), 10); - } - as_vector_append(pt->errors, &status); - pthread_mutex_unlock(&pt->lock); - + add_error(pt, np->node, status, 0); mark_retry_on_error(pt, np); np->parts_unavailable = np->parts_full.size + np->parts_partial.size; return true; @@ -566,13 +607,13 @@ as_partition_tracker_should_retry( void as_partition_tracker_destroy(as_partition_tracker* pt) { - release_node_partitions(&pt->node_parts); - as_vector_destroy(&pt->node_parts); - as_partitions_status_release(pt->parts_all); - if (pt->errors) { as_vector_destroy(pt->errors); pt->errors = NULL; } + + release_node_partitions(&pt->node_parts); + as_vector_destroy(&pt->node_parts); + as_partitions_status_release(pt->parts_all); pthread_mutex_destroy(&pt->lock); } From 752b242a8c39b4987e52f602113c212edf3b01ce Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Thu, 4 Jan 2024 12:40:37 -0500 Subject: [PATCH 32/35] Update version 6.5.1 --- src/include/aerospike/version.h | 2 +- src/main/aerospike/version.c | 2 +- vs/aerospike-client-c-libevent.nuspec | 2 +- vs/aerospike-client-c-libuv.nuspec | 2 +- vs/aerospike-client-c.nuspec | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/aerospike/version.h b/src/include/aerospike/version.h index e9319207c..9289236a7 100644 --- a/src/include/aerospike/version.h +++ b/src/include/aerospike/version.h @@ -3,6 +3,6 @@ // N: minor // P: patch // B: build id -#define AEROSPIKE_CLIENT_VERSION 605000000L +#define AEROSPIKE_CLIENT_VERSION 605010000L extern char* aerospike_client_version; diff --git a/src/main/aerospike/version.c b/src/main/aerospike/version.c index 426d25ba9..118e24c06 100644 --- a/src/main/aerospike/version.c +++ b/src/main/aerospike/version.c @@ -1 +1 @@ -char* aerospike_client_version = "6.5.0"; +char* aerospike_client_version = "6.5.1"; diff --git a/vs/aerospike-client-c-libevent.nuspec b/vs/aerospike-client-c-libevent.nuspec index 80a967152..17a37ce26 100644 --- a/vs/aerospike-client-c-libevent.nuspec +++ b/vs/aerospike-client-c-libevent.nuspec @@ -2,7 +2,7 @@ aerospike-client-c-libevent - 6.5.0 + 6.5.1 Aerospike C Client with libevent Aerospike Aerospike diff --git a/vs/aerospike-client-c-libuv.nuspec b/vs/aerospike-client-c-libuv.nuspec index 405a5af6f..8d760f286 100644 --- a/vs/aerospike-client-c-libuv.nuspec +++ b/vs/aerospike-client-c-libuv.nuspec @@ -2,7 +2,7 @@ aerospike-client-c-libuv - 6.5.0 + 6.5.1 Aerospike C Client with libuv Aerospike Aerospike diff --git a/vs/aerospike-client-c.nuspec b/vs/aerospike-client-c.nuspec index c3d1b8220..f56cf7984 100644 --- a/vs/aerospike-client-c.nuspec +++ b/vs/aerospike-client-c.nuspec @@ -2,7 +2,7 @@ aerospike-client-c - 6.5.0 + 6.5.1 Aerospike C Client Aerospike Aerospike From 662f8d1cf586f65fed3ce7ad3d40a85dca29d7ae Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Thu, 4 Jan 2024 16:30:08 -0500 Subject: [PATCH 33/35] Update copyright year in license and nuspec files. --- LICENSE.md | 2 +- vs/aerospike-client-c-libevent.nuspec | 2 +- vs/aerospike-client-c-libuv.nuspec | 2 +- vs/aerospike-client-c.nuspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index a2a94ff81..19de8d98d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ Aerospike C Client License ========================== - Copyright 2008-2022 Aerospike, Inc. + Copyright 2008-2024 Aerospike, Inc. Portions may be licensed to Aerospike, Inc. under one or more contributor license agreements. diff --git a/vs/aerospike-client-c-libevent.nuspec b/vs/aerospike-client-c-libevent.nuspec index 17a37ce26..875f240dd 100644 --- a/vs/aerospike-client-c-libevent.nuspec +++ b/vs/aerospike-client-c-libevent.nuspec @@ -11,7 +11,7 @@ icon.png false Aerospike C client library for sync and async database commands using the libevent event framework. - Copyright 2008-2023 Aerospike, Inc. + Copyright 2008-2024 Aerospike, Inc. Aerospike database C client native libevent diff --git a/vs/aerospike-client-c-libuv.nuspec b/vs/aerospike-client-c-libuv.nuspec index 8d760f286..c231fa39b 100644 --- a/vs/aerospike-client-c-libuv.nuspec +++ b/vs/aerospike-client-c-libuv.nuspec @@ -11,7 +11,7 @@ icon.png false Aerospike C client library for sync and async database commands using the libuv event framework. - Copyright 2008-2023 Aerospike, Inc. + Copyright 2008-2024 Aerospike, Inc. Aerospike database C client native libuv diff --git a/vs/aerospike-client-c.nuspec b/vs/aerospike-client-c.nuspec index f56cf7984..37201b4fc 100644 --- a/vs/aerospike-client-c.nuspec +++ b/vs/aerospike-client-c.nuspec @@ -11,7 +11,7 @@ icon.png false Aerospike C client library for synchronous database commands. - Copyright 2008-2023 Aerospike, Inc. + Copyright 2008-2024 Aerospike, Inc. Aerospike database C client native From f4cb3b09ce79599a2a49bdeac786f3f8ce7daf0f Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 8 Jan 2024 20:28:56 -0500 Subject: [PATCH 34/35] CLIENT-2743 Upgrade to doxygen 1.10.0. - Modify config file to conform to new doxygen version. - Fix links on main html page. - Fix group classification errors identified by doxygen. - Use new section format doc standard in affected header files. - Update doxygen footer copyright year. --- modules/common | 2 +- project/doxyfile | 1182 ++++++++++++++------ src/apidocs/footer.html | 2 +- src/include/aerospike/aerospike.h | 22 +- src/include/aerospike/as_batch.h | 33 +- src/include/aerospike/as_cdt_ctx.h | 52 +- src/include/aerospike/as_config.h | 34 +- src/include/aerospike/as_error.h | 36 +- src/include/aerospike/as_key.h | 55 +- src/include/aerospike/as_operations.h | 134 +-- src/include/aerospike/as_policy.h | 22 +- src/include/aerospike/as_query.h | 106 +- src/include/aerospike/as_record_iterator.h | 21 +- src/include/aerospike/as_scan.h | 94 +- 14 files changed, 1135 insertions(+), 660 deletions(-) diff --git a/modules/common b/modules/common index 4d829e138..83add8e68 160000 --- a/modules/common +++ b/modules/common @@ -1 +1 @@ -Subproject commit 4d829e1380676cf19c0607f05234a13efaff0045 +Subproject commit 83add8e681b3e25ed467dc67488d68d4e197ee44 diff --git a/project/doxyfile b/project/doxyfile index ad7db3fcb..3f06c6d88 100644 --- a/project/doxyfile +++ b/project/doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.6 +# Doxyfile 1.10.0 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,16 +12,26 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -46,13 +56,19 @@ PROJECT_NUMBER = PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = +# With the PROJECT_ICON tag one can specify an icon that is included in the tabs +# when the HTML document is shown. Doxygen will copy the logo to the output +# directory. + +PROJECT_ICON = + # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If @@ -60,16 +76,28 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = target/docs -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes -# performance problems for the file system. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = YES +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode @@ -81,26 +109,26 @@ ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -135,7 +163,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -179,6 +207,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -199,15 +237,23 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -222,20 +268,19 @@ TAB_SIZE = 4 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -264,25 +309,40 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -290,10 +350,30 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -315,7 +395,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -333,13 +413,20 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -394,11 +481,32 @@ TYPEDEF_HIDES_STRUCT = YES LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = YES + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -408,35 +516,41 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = YES -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = YES -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -451,6 +565,13 @@ EXTRACT_LOCAL_METHODS = YES EXTRACT_ANON_NSPACES = YES +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -461,21 +582,22 @@ HIDE_UNDOC_MEMBERS = YES # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = YES # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -488,22 +610,43 @@ HIDE_IN_BODY_DOCS = YES INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -531,14 +674,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -583,27 +726,25 @@ SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = NO -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = NO -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = NO -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -628,8 +769,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -663,7 +804,8 @@ FILE_VERSION_FILTER = # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE @@ -674,11 +816,10 @@ LAYOUT_FILE = src/apidocs/layout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. +# search path. See also \cite for info how to create references. CITE_BIB_FILES = @@ -694,7 +835,7 @@ CITE_BIB_FILES = QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -702,7 +843,7 @@ QUIET = NO WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -710,34 +851,81 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard -# error (stderr). +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). WARN_LOGFILE = @@ -748,7 +936,7 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = $(TARGET_INCL)/aerospike @@ -756,20 +944,40 @@ INPUT = $(TARGET_INCL)/aerospike # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING # The default value is: UTF-8. INPUT_ENCODING = UTF-8 +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.ccm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, +# *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, +# *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to +# be provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.h @@ -808,10 +1016,7 @@ EXCLUDE_PATTERNS = # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* +# ANamespace::AClass, ANamespace::*Test EXCLUDE_SYMBOLS = _* @@ -855,6 +1060,15 @@ IMAGE_PATH = # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -864,11 +1078,15 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -889,6 +1107,15 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- @@ -903,7 +1130,8 @@ USE_MDFILE_AS_MAINPAGE = SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. +# multi-line macros, enums or list initialized variables directly into the +# documentation. # The default value is: NO. INLINE_SOURCES = NO @@ -916,7 +1144,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -928,7 +1156,7 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -948,12 +1176,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -986,17 +1214,11 @@ VERBATIM_HEADERS = YES ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = aerospike_ \ @@ -1008,7 +1230,7 @@ IGNORE_PREFIX = aerospike_ \ # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1070,13 +1292,20 @@ HTML_FOOTER = src/apidocs/footer.html HTML_STYLESHEET = src/apidocs/html/style.css -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -1092,10 +1321,23 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = src/apidocs/html/aerospike.css \ src/apidocs/html/aerospike_logo.png +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1104,7 +1346,7 @@ HTML_EXTRA_FILES = src/apidocs/html/aerospike.css \ HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A +# in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1122,13 +1364,16 @@ HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_TIMESTAMP = YES +HTML_DYNAMIC_MENUS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the @@ -1138,6 +1383,33 @@ HTML_TIMESTAMP = YES HTML_DYNAMIC_SECTIONS = YES +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + +# If the HTML_COPY_CLIPBOARD tag is set to YES then doxygen will show an icon in +# the top right corner of code and text fragments that allows the user to copy +# its content to the clipboard. Note this only works if supported by the browser +# and the web page is served via a secure context (see: +# https://www.w3.org/TR/secure-contexts/), i.e. using the https: or file: +# protocol. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COPY_CLIPBOARD = YES + +# Doxygen stores a couple of settings persistently in the browser (via e.g. +# cookies). By default these settings apply to all HTML pages generated by +# doxygen across all projects. The HTML_PROJECT_COOKIE tag can be used to store +# the settings under a project specific key, such that the user preferences will +# be stored separately. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_PROJECT_COOKIE = + # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to @@ -1149,17 +1421,18 @@ HTML_DYNAMIC_SECTIONS = YES # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_INDEX_NUM_ENTRIES = 100 +HTML_INDEX_NUM_ENTRIES = 0 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1173,6 +1446,13 @@ GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Aerospike API" +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. @@ -1198,8 +1478,12 @@ DOCSET_PUBLISHER_NAME = AerospikeInc. # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1221,28 +1505,29 @@ GENERATE_HTMLHELP = NO CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1255,6 +1540,16 @@ BINARY_TOC = NO TOC_EXPAND = NO +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help @@ -1273,7 +1568,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1281,8 +1577,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1290,30 +1586,30 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1347,7 +1643,7 @@ ECLIPSE_DOC_ID = com.aerospike # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = NO +DISABLE_INDEX = YES # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag @@ -1355,17 +1651,29 @@ DISABLE_INDEX = NO # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # @@ -1383,13 +1691,31 @@ ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1399,20 +1725,15 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. -FORMULA_TRANSPARENT = YES +FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1421,11 +1742,29 @@ FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1438,22 +1777,29 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1481,7 +1827,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1498,9 +1844,10 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1511,10 +1858,11 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1549,7 +1897,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO @@ -1565,22 +1913,36 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1598,39 +1960,57 @@ COMPACT_LATEX = NO PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will -# replace them by respectively the title of the page, the current date and time, -# only the current date, the version number of doxygen, the project name (see -# PROJECT_NAME), or the project number (see PROJECT_NUMBER). +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. See also section "Doxygen +# usage" for information on how to generate the default footer that doxygen +# normally uses. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1648,18 +2028,26 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. USE_PDFLATEX = YES -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode -# command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error. +# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch +# mode nothing is printed on the terminal, errors are scrolled as if is +# hit at every error; missing files that TeX tries to input or request from +# keyboard input (\read on a not open input stream) cause the job to abort, +# NON_STOP In nonstop mode the diagnostic message will appear on the terminal, +# but there is no possibility of user interaction just like in batch mode, +# SCROLL In scroll mode, TeX will stop only for missing files to input or if +# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at +# each error, asking for user intervention. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1672,29 +2060,27 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1709,7 +2095,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1729,9 +2115,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1740,8 +2126,8 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = @@ -1750,7 +2136,7 @@ RTF_EXTENSIONS_FILE = # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1794,7 +2180,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1808,7 +2194,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1817,11 +2203,18 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1839,19 +2232,45 @@ DOCBOOK_OUTPUT = docbook # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- + +# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3 +# database with symbols found by doxygen stored in tables. +# The default value is: NO. + +GENERATE_SQLITE3 = NO + +# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database will be +# put. If a relative path is entered the value of OUTPUT_DIRECTORY will be put +# in front of it. +# The default directory is: sqlite3. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_OUTPUT = sqlite3 + +# The SQLITE3_RECREATE_DB tag is set to YES, the existing doxygen_sqlite3.db +# database file will be recreated with each doxygen run. If set to NO, doxygen +# will warn if a database file is already found and not modify it. +# The default value is: YES. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_RECREATE_DB = YES + #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1859,7 +2278,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1867,9 +2286,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1889,14 +2308,14 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1912,7 +2331,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1921,7 +2340,8 @@ SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = @@ -1988,62 +2408,32 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces +# will be listed in the class and namespace index. If set to NO, only the +# inherited external classes will be listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the topic index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2051,7 +2441,7 @@ HIDE_UNDOC_RELATIONS = NO # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: NO. @@ -2068,55 +2458,83 @@ HAVE_DOT = YES DOT_NUM_THREADS = 0 -# When you want a differently looking font n the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. +# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of +# subgraphs. When you want a differently looking font in the dot files that +# doxygen generates you can specify fontname, fontcolor and fontsize attributes. +# For details please see Node, +# Edge and Graph Attributes specification You need to make sure dot is able +# to find the font, which can be done by putting it in a standard location or by +# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. Default graphviz fontsize is 14. +# The default value is: fontname=Helvetica,fontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. +# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can +# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. Complete documentation about +# arrows shapes. +# The default value is: labelfontname=Helvetica,labelfontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. +# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes +# around nodes set 'shape=plain' or 'shape=plaintext' Shapes specification +# The default value is: shape=box,height=0.2,width=0.4. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" + +# You can set the path where dot can find font specified with fontname in +# DOT_COMMON_ATTR and others dot attributes. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will +# generate a graph for each documented class showing the direct and indirect +# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and +# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case +# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the +# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used. +# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance +# relations will be shown as texts / links. Explicit enabling an inheritance +# graph or choosing a different representation for an inheritance graph of a +# specific class, can be accomplished by means of the command \inheritancegraph. +# Disabling an inheritance graph can be accomplished by means of the command +# \hideinheritancegraph. +# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation # dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. +# class with other documented classes. Explicit enabling a collaboration graph, +# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the +# command \collaborationgraph. Disabling a collaboration graph can be +# accomplished by means of the command \hidecollaborationgraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. Explicit enabling a group +# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means +# of the command \groupgraph. Disabling a directory graph can be accomplished by +# means of the command \hidegroupgraph. See also the chapter Grouping in the +# manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2133,10 +2551,32 @@ UML_LOOK = YES # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will be wrapped across multiple lines. Some heuristics are +# applied to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2148,7 +2588,9 @@ TEMPLATE_RELATIONS = NO # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the # direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO, +# can be accomplished by means of the command \includegraph. Disabling an +# include graph can be accomplished by means of the command \hideincludegraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2157,7 +2599,10 @@ INCLUDE_GRAPH = YES # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set +# to NO, can be accomplished by means of the command \includedbygraph. Disabling +# an included by graph can be accomplished by means of the command +# \hideincludedbygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2168,7 +2613,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2179,7 +2625,8 @@ CALL_GRAPH = NO # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2195,18 +2642,32 @@ GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The # dependency relations are determined by the #include relations between the -# files in the directories. +# files in the directories. Explicit enabling a directory graph, when +# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command +# \directorygraph. Disabling a directory graph can be accomplished by means of +# the command \hidedirectorygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. DIRECTORY_GRAPH = YES +# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels +# of child directories generated in directory dependency graphs by dot. +# Minimum value: 1, maximum value: 25, default value: 1. +# This tag requires that the tag DIRECTORY_GRAPH is set to YES. + +DIR_GRAPH_MAX_DEPTH = 1 + # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2237,11 +2698,12 @@ DOT_PATH = DOTFILE_DIRS = -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the \mscfile -# command). +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. -MSCFILE_DIRS = +DIA_PATH = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile @@ -2249,6 +2711,24 @@ MSCFILE_DIRS = DIAFILE_DIRS = +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file or to the filename of jar file +# to be used. If left blank, it is assumed PlantUML is not used or called during +# a preprocessing step. Doxygen will generate a warning when it encounters a +# \startuml command in this case and will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2273,19 +2753,7 @@ DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2297,14 +2765,34 @@ DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. +# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal +# graphical representation for inheritance and collaboration diagrams is used. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will +# use a built-in version of mscgen tool to produce the charts. Alternatively, +# the MSCGEN_TOOL tag can also specify the name an external tool. For instance, +# specifying prog as the value, doxygen will call the tool as prog -T +# -o . The external tool should support +# output file formats "png", "eps", "svg", and "ismap". + +MSCGEN_TOOL = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = diff --git a/src/apidocs/footer.html b/src/apidocs/footer.html index cec065e4f..b31332c4e 100644 --- a/src/apidocs/footer.html +++ b/src/apidocs/footer.html @@ -1,6 +1,6 @@