From 08ccb051f8e41d87b6b531925eb7d86f5323dc94 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Sun, 23 Dec 2018 18:18:19 +0600 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E5=9C=A8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=B8=AD=E6=89=93=E5=8D=B0accept=20tags?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_api.cpp | 9 +++++++-- src/entry/Maat_rule.cpp | 3 ++- src/inc_internal/Maat_rule_internal.h | 2 ++ test/reset_redis4maat.sh | 13 +++++++------ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/entry/Maat_api.cpp b/src/entry/Maat_api.cpp index 4bda790..107f139 100644 --- a/src/entry/Maat_api.cpp +++ b/src/entry/Maat_api.cpp @@ -689,6 +689,7 @@ int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const vo { return -1; } + _feather->accept_tags_raw=_maat_strdup((const char*) value); break; case MAAT_OPT_FOREIGN_CONT_DIR: memset(_feather->foreign_cont_dir, 0, sizeof(_feather->foreign_cont_dir)); @@ -809,10 +810,14 @@ int Maat_initiate_feather(Maat_feather_t feather) } if(_feather->cumulative_update_off==1) { - MESA_handle_runtime_log(_feather->logger,RLOG_LV_INFO,maat_module , + MESA_handle_runtime_log(_feather->logger,RLOG_LV_INFO,maat_module , "Update with cumulative version OFF."); } - + if(_feather->n_tags>0) + { + MESA_handle_runtime_log(_feather->logger,RLOG_LV_INFO,maat_module , + "Accept tags: %s", _feather->accept_tags_raw); + } if(_feather->stat_on==1) { maat_stat_init(_feather); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 04048c9..cc688da 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -32,7 +32,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_2_5_20181221=1; +int MAAT_FRAME_VERSION_2_5_20181223=1; const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", "unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""}; @@ -3744,6 +3744,7 @@ void *thread_rule_monitor(void *arg) free(feather->accept_tags[i].tag_val); } free(feather->accept_tags); + free(feather->accept_tags_raw); if(feather->stat_on&& feather->stat_handle) { FS_stop(&(feather->stat_handle)); diff --git a/src/inc_internal/Maat_rule_internal.h b/src/inc_internal/Maat_rule_internal.h index c73afe9..0c783fc 100644 --- a/src/inc_internal/Maat_rule_internal.h +++ b/src/inc_internal/Maat_rule_internal.h @@ -363,8 +363,10 @@ struct _Maat_feather_t long long base_rgn_seq,base_grp_seq,server_time; long long load_version_from; + char* accept_tags_raw; struct rule_tag *accept_tags; int n_tags; + char foreign_cont_dir[MAX_TABLE_NAME_LEN]; int foreign_cont_linger; //internal states diff --git a/test/reset_redis4maat.sh b/test/reset_redis4maat.sh index 3f3e01e..8fac015 100644 --- a/test/reset_redis4maat.sh +++ b/test/reset_redis4maat.sh @@ -1,10 +1,11 @@ #!/bin/sh host="127.0.0.1" port="6379" +db="0" echo "Reseting Redis For Maat..." -redis-cli -h $host -p $port GET MAAT_VERSION -redis-cli -h $host -p $port FLUSHALL -redis-cli -h $host -p $port SET MAAT_VERSION "0" -redis-cli -h $host -p $port SET MAAT_PRE_VER "0" -redis-cli -h $host -p $port SET SEQUENCE_REGION "1" -redis-cli -h $host -p $port SET SEQUENCE_GROUP "1" +redis-cli -h $host -p $port -n $db GET MAAT_VERSION +redis-cli -h $host -p $port -n $db FLUSHALL +redis-cli -h $host -p $port -n $db SET MAAT_VERSION "0" +redis-cli -h $host -p $port -n $db SET MAAT_PRE_VER "0" +redis-cli -h $host -p $port -n $db SET SEQUENCE_REGION "1" +redis-cli -h $host -p $port -n $db SET SEQUENCE_GROUP "1"