Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLIENT-3106] Refactor aerospike module initialization code and check if error indicator is set after every C-API call #667

Merged
merged 45 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9849d65
wip
juliannguyen4 Sep 9, 2024
541cdec
wip
juliannguyen4 Sep 10, 2024
9108e72
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-aerospike-…
juliannguyen4 Sep 10, 2024
9ce9f15
wip
juliannguyen4 Sep 10, 2024
6ed50e3
wip
juliannguyen4 Sep 11, 2024
cf9ff7e
some reordering
juliannguyen4 Sep 11, 2024
f4c264b
finish
juliannguyen4 Sep 13, 2024
0cf3046
Fix:
juliannguyen4 Sep 13, 2024
f66985c
fix
juliannguyen4 Sep 13, 2024
e8669fe
Try using only name without parent module
juliannguyen4 Sep 13, 2024
64587f8
use alternate names if applicable
juliannguyen4 Sep 13, 2024
506b28b
Revert "Try using only name without parent module"
juliannguyen4 Sep 13, 2024
fb0f953
fix
juliannguyen4 Sep 13, 2024
9932a34
add missing classes
juliannguyen4 Sep 13, 2024
b8a1f27
fix
juliannguyen4 Sep 13, 2024
16b4c5d
try to fix mem issue
juliannguyen4 Sep 13, 2024
1ea9000
Just avoid using unicode to const char altogether
juliannguyen4 Sep 13, 2024
f3d2e63
disable basic sanity test
juliannguyen4 Sep 13, 2024
2a8f3e1
rm testing
juliannguyen4 Sep 16, 2024
0439e2c
Revert "disable basic sanity test"
juliannguyen4 Sep 16, 2024
fc69db9
rm testing
juliannguyen4 Sep 16, 2024
c56605e
rm all types
juliannguyen4 Sep 16, 2024
8ee6d5a
dont add anything
juliannguyen4 Sep 16, 2024
b39f974
add back
juliannguyen4 Sep 16, 2024
443d9d3
fix ref cnt error
juliannguyen4 Sep 16, 2024
a0e25fd
add all back
juliannguyen4 Sep 16, 2024
b7cee3d
Mv, remove unused stuff
juliannguyen4 Sep 16, 2024
f4eb16b
rm
juliannguyen4 Sep 16, 2024
b14c1fe
rm useless comment
juliannguyen4 Sep 16, 2024
cad776d
Don't need to initialize to false. Omitted fields are set to 0
juliannguyen4 Sep 16, 2024
4befcba
be explicit
juliannguyen4 Sep 16, 2024
7a9a487
wip macro
juliannguyen4 Sep 16, 2024
4c21c0d
wip
juliannguyen4 Sep 16, 2024
4a324ef
fix
juliannguyen4 Sep 16, 2024
d95bd5f
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-aerospike-…
juliannguyen4 Sep 16, 2024
3dcfbb6
rm enum when it already exists in common
juliannguyen4 Sep 16, 2024
2aaef07
just include back to be safe
juliannguyen4 Sep 16, 2024
ce7fef1
Fix compiler error
juliannguyen4 Sep 16, 2024
3655e62
Cleanup
juliannguyen4 Sep 16, 2024
8367b4f
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-aerospike-…
juliannguyen4 Sep 17, 2024
9469959
Merge remote-tracking branch 'origin/dev' into CLIENT-3106-aerospike-…
juliannguyen4 Sep 17, 2024
8e512bc
Prevent ref count error
juliannguyen4 Sep 24, 2024
0f09f40
dont cause undefined behavior
juliannguyen4 Sep 24, 2024
3409b7a
Clear up comments
juliannguyen4 Sep 24, 2024
216969f
mv variable name
juliannguyen4 Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/include/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,13 @@
#include <Python.h>
#include <aerospike/as_status.h>

/*
* Enum to declare log level constants
*/
typedef enum Aerospike_log_level_e {

LOG_LEVEL_OFF = -1,
LOG_LEVEL_ERROR,
LOG_LEVEL_WARN,
LOG_LEVEL_INFO,
LOG_LEVEL_DEBUG,
LOG_LEVEL_TRACE

} aerospike_log_level;

/*
* Structure to hold user's log_callback object
*/
typedef struct Aerospike_log_callback {
PyObject *callback;
} AerospikeLogCallback;

/**
* Add log level constants to aerospike module
* aerospike.set_log_level(aerospike.LOG_LEVEL_DEBUG)
*/
as_status declare_log_constants(PyObject *aerospike);

/**
* Set log level for C-SDK
* aerospike.set_log_level( aerospike.LOG_LEVEL_WARN )
Expand Down
24 changes: 0 additions & 24 deletions src/include/policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
#include <aerospike/as_partition_filter.h>
#include <aerospike/as_metrics.h>

#define MAX_CONSTANT_STR_SIZE 512

/*
*******************************************************************************************************
*Structure to map constant number to constant name string for Aerospike constants.
*******************************************************************************************************
*/

enum Aerospike_serializer_values {
SERIALIZER_NONE, /* default handler for serializer type */
SERIALIZER_PYTHON,
Expand Down Expand Up @@ -193,20 +185,6 @@ enum aerospike_cdt_ctx_identifiers {
CDT_CTX_MAP_KEY_CREATE = 0x24
};

typedef struct Aerospike_Constants {
long constantno;
char constant_str[MAX_CONSTANT_STR_SIZE];
} AerospikeConstants;

typedef struct Aerospike_JobConstants {
char job_str[MAX_CONSTANT_STR_SIZE];
char exposed_job_str[MAX_CONSTANT_STR_SIZE];
} AerospikeJobConstants;
#define AEROSPIKE_CONSTANTS_ARR_SIZE \
(sizeof(aerospike_constants) / sizeof(AerospikeConstants))
#define AEROSPIKE_JOB_CONSTANTS_ARR_SIZE \
(sizeof(aerospike_job_constants) / sizeof(AerospikeJobConstants))

as_status pyobject_to_policy_admin(AerospikeClient *self, as_error *err,
PyObject *py_policy, as_policy_admin *policy,
as_policy_admin **policy_p,
Expand Down Expand Up @@ -270,8 +248,6 @@ as_status pyobject_to_policy_batch(AerospikeClient *self, as_error *err,
as_status pyobject_to_map_policy(as_error *err, PyObject *py_policy,
as_map_policy *policy);

as_status declare_policy_constants(PyObject *aerospike);

void set_scan_options(as_error *err, as_scan *scan_p, PyObject *py_options);

as_status set_query_options(as_error *err, PyObject *query_options,
Expand Down
3 changes: 3 additions & 0 deletions src/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include <aerospike/as_operations.h>
#include "pool.h"

#define AEROSPIKE_MODULE_NAME "aerospike"
#define FULLY_QUALIFIED_TYPE_NAME(name) AEROSPIKE_MODULE_NAME "." name

// Bin names can be of type Unicode in Python
// DB supports 32767 maximum number of bins
#define MAX_UNICODE_OBJECTS 32767
Expand Down
Loading
Loading