All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Enumerations | Functions
as_module.h File Reference
#include <aerospike/as_aerospike.h>
#include <aerospike/as_stream.h>
#include <aerospike/as_result.h>
#include <aerospike/as_std.h>
#include <aerospike/as_types.h>
#include <aerospike/as_udf_context.h>
+ Include dependency graph for as_module.h:

Go to the source code of this file.

Data Structures

struct  as_module
 
struct  as_module_error
 
struct  as_module_event
 
struct  as_module_event_data
 
struct  as_module_hooks
 

Enumerations

enum  as_module_event_type {
  AS_MODULE_EVENT_CONFIGURE = 0, AS_MODULE_EVENT_FILE_SCAN = 1, AS_MODULE_EVENT_FILE_ADD = 2, AS_MODULE_EVENT_FILE_REMOVE = 3,
  AS_MODULE_EVENT_CLEAR_CACHE = 4
}
 

Functions

int as_module_apply_record (as_module *m, as_udf_context *ctx, const char *filename, const char *function, as_rec *r, as_list *args, as_result *res)
 
int as_module_apply_stream (as_module *m, as_udf_context *ctx, const char *filename, const char *function, as_stream *istream, as_list *args, as_stream *ostream, as_result *res)
 
int as_module_configure (as_module *m, void *c)
 
int as_module_destroy (as_module *m)
 
char * as_module_err_string (int e)
 
void * as_module_source (as_module *m)
 
int as_module_update (as_module *m, as_module_event *e)
 
int as_module_validate (as_module *m, as_aerospike *as, const char *filename, const char *content, uint32_t size, as_module_error *error)
 

Enumeration Type Documentation

Module events.

as_module_event e; e.type = AS_MODULE_CONFIGURE; e.data.config = my_config;

Enumerator
AS_MODULE_EVENT_CONFIGURE 
AS_MODULE_EVENT_FILE_SCAN 
AS_MODULE_EVENT_FILE_ADD 
AS_MODULE_EVENT_FILE_REMOVE 
AS_MODULE_EVENT_CLEAR_CACHE 

Definition at line 43 of file as_module.h.

Function Documentation

int as_module_apply_record ( as_module m,
as_udf_context ctx,
const char *  filename,
const char *  function,
as_rec r,
as_list args,
as_result res 
)

Applies a UDF to a stream with provided arguments.

Parameters
mModule from which the fqn will be resolved.
ctxaerospike udf execution context
filenameThe name of the udf module containing the function to be executed.
functionThe name of the udf function to be executed.
rrecord to apply to the function.
argslist of arguments for the function represented as vals
respointer to a val that will be populated with the result.
Returns
0 on success, otherwise 1
int as_module_apply_stream ( as_module m,
as_udf_context ctx,
const char *  filename,
const char *  function,
as_stream istream,
as_list args,
as_stream ostream,
as_result res 
)

Applies function to a stream and set of arguments. Pushes the results into an output stream.

Proxies to m->hooks->apply_stream(m, ...)

Parameters
mModule from which the fqn will be resolved.
ctxaerospike udf execution context
filenameThe name of the udf module containing the function to be executed.
functionThe name of the udf function to be executed.
istreampointer to a readable stream, that will provides values.
argslist of arguments for the function represented as vals
ostreampointer to a writable stream, that will be populated with results.
respointer to a val that will be populated with the result.
Returns
0 on success, otherwise 1
int as_module_configure ( as_module m,
void *  c 
)

Module Configurator. This configures and reconfigures the module. This can be called an arbitrary number of times during the lifetime of the server.

Proxies to m->hooks->configure(m, ...)

Parameters
mthe module being configured.
cthe new configurations.
Returns
0 on success, otherwise 1
int as_module_destroy ( as_module m)

Module Destroyer. This frees up the resources used by the module.

Proxies to m->hooks->destroy(m, ...)

Parameters
mthe module being initialized.
Returns
0 on success, otherwise 1
char* as_module_err_string ( int  e)

Return lua error in string format when error code is passed in

Parameters
eThe error code
void* as_module_source ( as_module m)

Get the source of the module.

Parameters
mthe module to get the source from.
int as_module_update ( as_module m,
as_module_event e 
)

Update a Module.

Proxies to m->hooks->update(m, ...)

Parameters
mthe module being initialized.
ethe module event.
Returns
0 on success, otherwise 1
int as_module_validate ( as_module m,
as_aerospike *  as,
const char *  filename,
const char *  content,
uint32_t  size,
as_module_error error 
)

Validates a UDF provided by a string.

Parameters
mModule from which the fqn will be resolved.
asaerospike object to be used.
filenameThe name of the udf module to be validated.
contentThe content of the udf module to be validated.
sizeThe size of the udf module to be validated.
errorThe error string (1024 bytes). Should be preallocated. Will be an empty string if no error occurred.
Returns
0 on success, otherwise 1 on error.