Skip to content

Commit

Permalink
[CLIENT-218] Remove unfinished async functions
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Jul 5, 2023
1 parent fc28088 commit caffbe3
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 1,852 deletions.
4 changes: 0 additions & 4 deletions aerospike-stubs/aerospike.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ class Client:
def exists(self, key: tuple, policy: dict = ...) -> tuple: ...
def exists_many(self, keys: list, policy: dict = ...) -> list: ...
def get(self, key: tuple, policy: dict = ...) -> tuple: ...
# def get_async(self, *args, **kwargs) -> Any: ...
def get_cdtctx_base64(self, ctx: list) -> str: ...
def get_expression_base64(self, expression) -> str: ...
def get_key_digest(self, ns: str, set: str, key) -> bytearray: ...
Expand Down Expand Up @@ -406,7 +405,6 @@ class Client:
def operate_ordered(self, key: tuple, list: list, meta: dict = ..., policy: dict = ...) -> list: ...
def prepend(self, key: tuple, bin: str, val: str, meta: dict = ..., policy: dict = ...) -> None: ...
def put(self, key: tuple, bins: dict, meta: dict = ..., policy: dict = ..., serializer = ...) -> None: ...
# def put_async(self, *args, **kwargs) -> Any: ...
def query(self, namespace: str, set: str = ...) -> Query: ...
def query_apply(self, ns: str, set: str, predicate: tuple, module: str, function: str, args: list = ..., policy: dict = ...) -> int: ...
def remove(self, key: tuple, meta: dict = ..., policy: dict = ...) -> None: ...
Expand Down Expand Up @@ -477,8 +475,6 @@ def geojson(geojson_str: str) -> GeoJSON: ...
def get_cdtctx_base64(ctx: list) -> str: ...
def get_expression_base64(expression) -> str: ...
def get_partition_id(*args, **kwargs) -> Any: ...
# def init_async() -> Any: ...
# def is_async_supoorted(*args, **kwargs) -> Any: ...
def set_deserializer(callback: Callable) -> None: ...
def set_log_handler(callback: Callable = ...) -> None: ...
def set_log_level(log_level: int) -> None: ...
Expand Down
15 changes: 0 additions & 15 deletions aerospike_helpers/awaitable/__init__.py

This file was deleted.

126 changes: 0 additions & 126 deletions aerospike_helpers/awaitable/io.py

This file was deleted.

30 changes: 1 addition & 29 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
CWD = os.path.abspath(os.path.dirname(__file__))
STATIC_SSL = os.getenv('STATIC_SSL')
SSL_LIB_PATH = os.getenv('SSL_LIB_PATH')
EVENT_LIB = os.getenv('EVENT_LIB')
# COVERAGE environment variable only meant for CI/CD workflow to generate C coverage data
# Not for developers to use, unless you know what the workflow is doing!
COVERAGE = os.getenv('COVERAGE')
Expand Down Expand Up @@ -155,25 +154,6 @@
BASEPATH = os.path.dirname(os.path.abspath(__file__))
CCLIENT_PATH = os.path.join(BASEPATH, 'aerospike-client-c')

# if EVENT_LIB is None or EVENT_LIB == "":
# EVENT_LIB = "libevent"

if EVENT_LIB is not None:
if EVENT_LIB == "libuv":
extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
library_dirs = library_dirs + ['/usr/local/lib/']
libraries = libraries + ['uv']
elif EVENT_LIB == "libevent":
extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
library_dirs = library_dirs + ['/usr/local/lib/']
libraries = libraries + ['event_core', 'event_pthreads']
elif EVENT_LIB == "libev":
extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
library_dirs = library_dirs + ['/usr/local/lib/']
libraries = libraries + ['ev']
else:
print("Building aerospike with no-async support\n")

class CClientBuild(build):

def run(self):
Expand All @@ -197,12 +177,6 @@ def clean():
'make',
'V=' + str(self.verbose),
]
if EVENT_LIB is not None:
cmd = [
'make',
'V=' + str(self.verbose),
'EVENT_LIB='+EVENT_LIB,
]

def compile():
print(cmd, library_dirs, libraries)
Expand Down Expand Up @@ -255,8 +229,6 @@ def clean():
'src/main/client/exists.c',
'src/main/client/exists_many.c',
'src/main/client/get.c',
'src/main/client/get_async.c',
'src/main/client/put_async.c',
'src/main/client/get_many.c',
'src/main/client/batch_get_ops.c',
'src/main/client/select_many.c',
Expand Down Expand Up @@ -347,7 +319,7 @@ def clean():
]
},
packages=['aerospike_helpers', 'aerospike_helpers.operations', 'aerospike_helpers.batch',
'aerospike_helpers.expressions', 'aerospike_helpers.awaitable',
'aerospike_helpers.expressions',
'aerospike-stubs'],

cmdclass={
Expand Down
18 changes: 0 additions & 18 deletions src/include/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,6 @@ PyObject *AerospikeClient_Get(AerospikeClient *self, PyObject *args,
PyObject *AerospikeClient_Get_Invoke(AerospikeClient *self, PyObject *py_key,
PyObject *py_policy);

/**
* Async Read a record from the database.
*
* client.get((x,y,z))
*
*/
PyObject *AerospikeClient_Get_Async(AerospikeClient *self, PyObject *args,
PyObject *kwds);

/**
* Project specific bins of a record from the database.
*
Expand All @@ -147,15 +138,6 @@ PyObject *AerospikeClient_Put_Invoke(AerospikeClient *self, PyObject *py_key,
PyObject *py_policy,
long serializer_option);

/**
* Write a record async in the database.
*
* client.put((x,y,z), ...)
*
*/
PyObject *AerospikeClient_Put_Async(AerospikeClient *self, PyObject *args,
PyObject *kwds);

/**
* Remove a record from the database.
*
Expand Down
14 changes: 0 additions & 14 deletions src/include/module_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,3 @@ PyObject *Aerospike_Calc_Digest(PyObject *self, PyObject *args, PyObject *kwds);
*
*/
PyObject *Aerospike_Get_Partition_Id(PyObject *self, PyObject *args);

/**
* check whether async supported or not
*
* aerospike.is_async_supoorted()
*
*/
PyObject *Aerospike_Is_AsyncSupported(PyObject *self);

/*******************************************************************************
* Aerospike initialization
******************************************************************************/

PyObject *AerospikeInitAsync(PyObject *self, PyObject *args, PyObject *kwds);
1 change: 0 additions & 1 deletion src/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
extern int counter;
extern PyObject *py_global_hosts;
extern bool user_shm_key;
extern uint32_t async_support;

typedef struct {
PyObject_HEAD
Expand Down
30 changes: 0 additions & 30 deletions src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
PyObject *py_global_hosts;
int counter = 0xA8000000;
bool user_shm_key = false;
uint32_t async_support = 0;

PyDoc_STRVAR(client_doc, "client(config) -> client object\n\
\n\
Expand All @@ -51,10 +50,6 @@ config = {\n\
}\n\
client = aerospike.client(config)");

PyDoc_STRVAR(init_async_doc,
"init_async() -> initialize aerospike async eventloop library\n\
aerospike.init_async()");

static PyMethodDef Aerospike_Methods[] = {

//Serialization
Expand All @@ -65,8 +60,6 @@ static PyMethodDef Aerospike_Methods[] = {
{"unset_serializers", (PyCFunction)AerospikeClient_Unset_Serializers,
METH_VARARGS | METH_KEYWORDS, "Unsets the serializer and deserializer"},

{"init_async", (PyCFunction)AerospikeInitAsync,
METH_VARARGS | METH_KEYWORDS, init_async_doc},
{"client", (PyCFunction)AerospikeClient_New, METH_VARARGS | METH_KEYWORDS,
client_doc},
{"set_log_level", (PyCFunction)Aerospike_Set_Log_Level,
Expand All @@ -88,10 +81,6 @@ static PyMethodDef Aerospike_Methods[] = {
{"get_partition_id", (PyCFunction)Aerospike_Get_Partition_Id, METH_VARARGS,
"Get partition ID for given digest"},

//Is async supported
{"is_async_supoorted", (PyCFunction)Aerospike_Is_AsyncSupported,
METH_NOARGS, "check whether async supported or not"},

{NULL}};

static AerospikeConstants operator_constants[] = {
Expand Down Expand Up @@ -282,22 +271,3 @@ PyMODINIT_FUNC PyInit_aerospike(void)
Aerospike_Clear(aerospike);
return NULL;
}

PyObject *AerospikeInitAsync(PyObject *self, PyObject *args, PyObject *kwds)
{
#if AS_EVENT_LIB_DEFINED
as_log_info("AerospikeInitAsync");
as_event_destroy_loops();
as_event_create_loops(1);
async_support = true;
#else
as_error err;
as_error_init(&err);
as_error_update(
&err, AEROSPIKE_ERR,
"Support for async is disabled, build software with async option");
raise_exception(&err);
return NULL;
#endif
return PyLong_FromLong(0);
}
5 changes: 0 additions & 5 deletions src/main/calc_digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,3 @@ PyObject *Aerospike_Get_Partition_Id(PyObject *self, PyObject *args)
// Invoke Operation
return PyLong_FromLong(part_id);
}

PyObject *Aerospike_Is_AsyncSupported(PyObject *self)
{
return PyLong_FromLong(async_support);
}
Loading

0 comments on commit caffbe3

Please sign in to comment.