[OPTIMIZE]reduce config memory usage

This commit is contained in:
liuwentan
2023-06-16 15:59:30 +08:00
parent 28dc76e987
commit 0b73681bd1
27 changed files with 1902 additions and 1862 deletions

View File

@@ -49,8 +49,7 @@ void *compile_runtime_new(void *compile_schema, size_t max_thread_num,
struct log_handle *logger);
void compile_runtime_free(void *compile_runtime);
void compile_runtime_init(void *compile_runtime, struct maat_runtime *maat_rt,
void *g2c_runtime);
void compile_runtime_init(void *compile_runtime, struct maat_runtime *maat_rt);
int compile_runtime_update(void *compile_runtime, void *compile_schema,
const char *table_name, const char *line,
@@ -81,7 +80,9 @@ void compile_runtime_ex_data_iterate(struct compile_runtime *compile_rt,
void *group2compile_runtime_new(void *g2c_schema, size_t max_thread_num,
struct maat_garbage_bin *garbage_bin,
struct log_handle *logger);
void group2compile_runtime_init(void *g2c_runtime, void *compile_runtime);
void group2compile_runtime_free(void *g2c_runtime);
int group2compile_runtime_update(void *g2c_runtime, void *g2c_schema,

View File

@@ -17,9 +17,13 @@ extern "C"
#endif
#define MAX_KEYWORDS_STR 1024
#define MAX_MAAT_STAT_NUM 64
#define MAX_NAME_STR_LEN 64
#define MAX_INSTANCE_NAME_LEN 15
#ifdef __cplusplus
}
#endif

View File

@@ -36,7 +36,6 @@ extern "C"
#include "hiredis/hiredis.h"
#define MAX_TABLE_NUM 1024
#define MAX_COMPILE_TABLE_NUM 16
#define DISTRICT_ANY -1
#define DISTRICT_UNKNOWN -2
@@ -109,13 +108,13 @@ struct source_redis_ctx {
};
struct maat_options {
char instance_name[NAME_MAX];
char inst_name[MAX_INSTANCE_NAME_LEN + 1];
char foreign_cont_dir[NAME_MAX];
char decrypt_algo[MAX_KEYWORDS_STR];
char decrypt_key[MAX_KEYWORDS_STR];
char log_path[PATH_MAX];
int log_level;
char stat_file[PATH_MAX];
char stat_file[NAME_MAX];
size_t nr_worker_thread;
char *accept_tags;
@@ -194,7 +193,7 @@ enum last_scan_flag {
};
struct maat_state {
struct maat *maat_instance;
struct maat *maat_inst;
struct maat_compile_state *compile_state;
int scan_cnt;
int district_id; //-1: Any District; -2: Unkonwn District;