in legacy/src/server/rds/data/process.c [17:70]
typedef void (* command_fn)(struct response *, const struct request *, const
struct command *cmd);
static command_fn command_registry[REQ_SENTINEL];
static bool process_init = false;
process_metrics_st *process_metrics = NULL;
void
process_setup(process_options_st *options, process_metrics_st *metrics)
{
log_info("set up the %s module", RDS_PROCESS_MODULE_NAME);
if (process_init) {
log_warn("%s has already been setup, overwrite",
RDS_PROCESS_MODULE_NAME);
}
process_metrics = metrics;
if (options != NULL) {
allow_flush = option_bool(&options->allow_flush);
}
command_registry[REQ_LIST_CREATE] = cmd_list_create;
command_registry[REQ_LIST_DELETE] = cmd_list_delete;
command_registry[REQ_LIST_TRIM] = cmd_list_trim;
command_registry[REQ_LIST_LEN] = cmd_list_len;
command_registry[REQ_LIST_FIND] = cmd_list_find;
command_registry[REQ_LIST_GET] = cmd_list_get;
command_registry[REQ_LIST_INSERT] = cmd_list_insert;
command_registry[REQ_LIST_PUSH] = cmd_list_push;
command_registry[REQ_SARRAY_CREATE] = cmd_sarray_create;
command_registry[REQ_SARRAY_DELETE] = cmd_sarray_delete;
command_registry[REQ_SARRAY_TRUNCATE] = cmd_sarray_truncate;
command_registry[REQ_SARRAY_LEN] = cmd_sarray_len;
command_registry[REQ_SARRAY_FIND] = cmd_sarray_find;
command_registry[REQ_SARRAY_GET] = cmd_sarray_get;
command_registry[REQ_SARRAY_INSERT] = cmd_sarray_insert;
command_registry[REQ_SARRAY_REMOVE] = cmd_sarray_remove;
command_registry[REQ_SMAP_CREATE] = cmd_smap_create;
command_registry[REQ_SMAP_DELETE] = cmd_smap_delete;
command_registry[REQ_SMAP_TRUNCATE] = cmd_smap_truncate;
command_registry[REQ_SMAP_LEN] = cmd_smap_len;
command_registry[REQ_SMAP_FIND] = cmd_smap_find;
command_registry[REQ_SMAP_GET] = cmd_smap_get;
command_registry[REQ_SMAP_INSERT] = cmd_smap_insert;
command_registry[REQ_SMAP_REMOVE] = cmd_smap_remove;
command_registry[REQ_PING] = cmd_ping;
process_init = true;
}