[FEATURE]Compile table must register plugin table to get compile ex_data

This commit is contained in:
刘文坛
2023-10-30 08:00:49 +00:00
parent 732c709ac6
commit 5e907a171f
24 changed files with 920 additions and 709 deletions

View File

@@ -37,12 +37,6 @@ void *group2compile_schema_new(cJSON *json, struct table_manager *tbl_mgr,
void group2compile_schema_free(void *g2c_schema);
int group2compile_associated_compile_table_id(void *g2c_schema);
int compile_table_set_ex_data_schema(struct compile_schema *compile_schema, int table_id,
maat_ex_new_func_t *new_func,
maat_ex_free_func_t *free_func,
maat_ex_dup_func_t *dup_func,
long argl, void *argp);
/* compile runtime API */
void *compile_runtime_new(void *compile_schema, size_t max_thread_num,
struct maat_garbage_bin *garbage_bin,
@@ -70,14 +64,6 @@ size_t compile_runtime_get_hit_paths(struct compile_runtime *compile_rt, int thr
struct maat_hit_path *hit_path_array,
size_t array_size, size_t n_hit_path);
void *compile_runtime_get_ex_data(struct compile_runtime *compile_rt,
struct compile_schema *compile_schema,
long long compile_id);
void compile_runtime_ex_data_iterate(struct compile_runtime *compile_rt,
struct compile_schema *compile_schema);
void compile_runtime_garbage_collect_routine(void *compile_runtime);
/* group2compile runtime API */
void *group2compile_runtime_new(void *g2c_schema, size_t max_thread_num,
struct maat_garbage_bin *garbage_bin,
@@ -103,7 +89,7 @@ struct compile_state *compile_state_new(void);
void compile_state_reset(struct compile_state *compile_state);
void compile_state_free(struct compile_state *compile_state,
void compile_state_free(struct compile_state *compile_state,
struct maat *maat_instance, int thread_id);
int compile_state_update(int vtable_id, struct maat_item *hit_items,
@@ -116,15 +102,19 @@ size_t compile_state_get_internal_hit_paths(struct compile_state *compile_state,
size_t array_size);
size_t compile_state_get_direct_hit_groups(struct compile_state *compile_state,
enum maat_list_type type,
struct maat_hit_group *group_array,
size_t array_size);
size_t compile_state_get_direct_hit_group_cnt(struct compile_state *compile_state);
size_t compile_state_get_indirect_hit_groups(struct compile_state *compile_state,
struct maat_hit_group *group_array,
size_t array_size);
int compile_state_has_NOT_clause(struct compile_state *compile_state);
size_t compile_state_get_indirect_hit_group_cnt(struct compile_state *compile_state);
int compile_state_get_compile_table_id(struct compile_state *compile_state,
long long compile_id);
#ifdef __cplusplus
}

View File

@@ -26,12 +26,16 @@ void maat_kv_store_free(struct maat_kv_store *store);
int maat_kv_register(struct maat_kv_store *store, const char *key, long long value);
int maat_kv_read(struct maat_kv_store *store, const char *key, long long *value);
int maat_kv_read(struct maat_kv_store *store, const char *key,
long long *value_array, size_t n_array);
int maat_kv_read_unNull(struct maat_kv_store *store, const char *key, size_t key_sz, long long *value);
int maat_kv_read_unNull(struct maat_kv_store *store, const char *key, size_t key_sz,
long long *value_array, size_t n_array);
int maat_kv_write(struct maat_kv_store *store, const char *key, long long value);
int maat_kv_append(struct maat_kv_store *store, const char *key, long long value);
struct maat_kv_store *maat_kv_store_duplicate(struct maat_kv_store *store);
#ifdef __cplusplus

View File

@@ -60,7 +60,23 @@ void table_manager_destroy(struct table_manager *tbl_mgr);
size_t table_manager_table_size(struct table_manager *tbl_mgr);
size_t table_manager_table_count(struct table_manager *tbl_mgr);
int table_manager_get_table_id(struct table_manager *tbl_mgr, const char *name);
int table_manager_get_table_id(struct table_manager *tbl_mgr, const char *table_name);
/**
* @brief get table_name's all conjunction parents' table_id
*
* for example: "table_id": 1,
* "table_name":"COMPILE_CONJ"
* "db_tables":["COMPILE_DEFAULT", "COMPILE_ALIAS"]
*
* "table_id": 2,
* "table_name": "COMPILE_PLUGIN",
* "db_tables": ["COMPILE_DEFAULT"]
*
* so COMPILE_DEFAULT has two conjunction parents whose table_id is 1 and 2.
*/
int table_manager_get_conj_parent_table_ids(struct table_manager *tbl_mgr, const char *table_name,
long long *table_ids_array, size_t n_table_ids_array);
const char *table_manager_get_table_name(struct table_manager *tbl_mgr, int table_id);
enum table_type table_manager_get_table_type(struct table_manager *tbl_mgr, int table_id);