初始化maat时设置accept tags,以便支持配置分区域生效。
This commit is contained in:
@@ -107,20 +107,22 @@ static Maat_feather_t create_maat_feather(const char * instance_name, const char
|
||||
char table_info[TFE_STRING_MAX] = {0}, inc_cfg_dir[TFE_STRING_MAX] = {0}, ful_cfg_dir[TFE_STRING_MAX] = {0};
|
||||
char redis_server[TFE_STRING_MAX] = {0};
|
||||
char redis_port_range[TFE_STRING_MAX] = {0};
|
||||
char accept_tags[TFE_STRING_MAX] = {0};
|
||||
int redis_port_begin=0, redis_port_end=0;
|
||||
int redis_port_select=0;
|
||||
int redis_db_idx = 0;
|
||||
char json_cfg_file[TFE_STRING_MAX] = {0}, maat_stat_file[TFE_STRING_MAX] = {0};
|
||||
MESA_load_profile_int_def(profile, section, "MAAT_INPUT_MODE", &(input_mode), 0);
|
||||
MESA_load_profile_int_def(profile, section, "STAT_SWITCH", &(maat_stat_on), 1);
|
||||
MESA_load_profile_int_def(profile, section, "PERF_SWITCH", &(maat_perf_on), 1);
|
||||
MESA_load_profile_int_def(profile, section, "maat_input_mode", &(input_mode), 0);
|
||||
MESA_load_profile_int_def(profile, section, "stat_switch", &(maat_stat_on), 1);
|
||||
MESA_load_profile_int_def(profile, section, "perf_switch", &(maat_perf_on), 1);
|
||||
|
||||
MESA_load_profile_string_def(profile, section, "TABLE_INFO", table_info, sizeof(table_info), "");
|
||||
MESA_load_profile_string_def(profile, section, "table_info", table_info, sizeof(table_info), "");
|
||||
MESA_load_profile_string_def(profile, section, "accept_tags", accept_tags, sizeof(accept_tags), "");
|
||||
|
||||
MESA_load_profile_string_def(profile, section, "JSON_CFG_FILE", json_cfg_file, sizeof(json_cfg_file), "");
|
||||
MESA_load_profile_string_def(profile, section, "json_cfg_file", json_cfg_file, sizeof(json_cfg_file), "");
|
||||
|
||||
MESA_load_profile_string_def(profile, section, "MAAT_REDIS_SERVER", redis_server, sizeof(redis_server), "");
|
||||
MESA_load_profile_string_def(profile, section, "MAAT_REDIS_PORT_RANGE", redis_port_range, sizeof(redis_server), "6379");
|
||||
MESA_load_profile_string_def(profile, section, "maat_redis_server", redis_server, sizeof(redis_server), "");
|
||||
MESA_load_profile_string_def(profile, section, "maat_redis_port_range", redis_port_range, sizeof(redis_server), "6379");
|
||||
ret=sscanf(redis_port_range,"%d-%d", &redis_port_begin, &redis_port_end);
|
||||
if(ret==1)
|
||||
{
|
||||
@@ -135,13 +137,13 @@ static Maat_feather_t create_maat_feather(const char * instance_name, const char
|
||||
{
|
||||
TFE_LOG_ERROR(logger, "Invalid redis port range %s, MAAT init failed.", redis_port_range);
|
||||
}
|
||||
MESA_load_profile_int_def(profile, section, "MAAT_REDIS_DB_INDEX", &(redis_db_idx), 0);
|
||||
MESA_load_profile_int_def(profile, section, "maat_redis_db_index", &(redis_db_idx), 0);
|
||||
|
||||
MESA_load_profile_string_def(profile, section, "INC_CFG_DIR", inc_cfg_dir, sizeof(inc_cfg_dir), "");
|
||||
MESA_load_profile_string_def(profile, section, "FULL_CFG_DIR", ful_cfg_dir, sizeof(ful_cfg_dir), "");
|
||||
MESA_load_profile_string_def(profile, section, "inc_cfg_dir", inc_cfg_dir, sizeof(inc_cfg_dir), "");
|
||||
MESA_load_profile_string_def(profile, section, "full_cfg_dir", ful_cfg_dir, sizeof(ful_cfg_dir), "");
|
||||
|
||||
MESA_load_profile_string_def(profile, section, "STAT_FILE", maat_stat_file, sizeof(maat_stat_file), "");
|
||||
MESA_load_profile_int_def(profile, section, "EFFECT_INTERVAL_S", &(effect_interval), 60);
|
||||
MESA_load_profile_string_def(profile, section, "stat_file", maat_stat_file, sizeof(maat_stat_file), "");
|
||||
MESA_load_profile_int_def(profile, section, "effect_interval_s", &(effect_interval), 60);
|
||||
|
||||
effect_interval *= 1000;//convert s to ms
|
||||
assert(strlen(inc_cfg_dir) != 0 || strlen(ful_cfg_dir) != 0 || strlen(redis_server)!=0 || strlen(json_cfg_file)!=0);
|
||||
@@ -180,6 +182,10 @@ static Maat_feather_t create_maat_feather(const char * instance_name, const char
|
||||
|
||||
Maat_set_feather_opt(target, MAAT_OPT_EFFECT_INVERVAL_MS, &effect_interval, sizeof(effect_interval));
|
||||
Maat_set_feather_opt(target, MAAT_OPT_SCAN_DETAIL, &scan_detail, sizeof(scan_detail));
|
||||
if(strlen(accept_tags)>0)
|
||||
{
|
||||
Maat_set_feather_opt(target, MAAT_OPT_ACCEPT_TAGS, &accept_tags, sizeof(accept_tags));
|
||||
}
|
||||
|
||||
ret = Maat_initiate_feather(target);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user