未完成:支持异步加载。
This commit is contained in:
@@ -605,16 +605,17 @@ int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const vo
|
||||
}
|
||||
_feather->AUTO_NUMBERING_ON=*((int*)value);
|
||||
break;
|
||||
case MAAT_OPT_DEFERRED_INIT:
|
||||
_feather->DEFERRED_INIT_ON=1;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int Maat_initiate_feather(Maat_feather_t feather)
|
||||
void maat_read_full_config(_Maat_feather_t* _feather)
|
||||
{
|
||||
_Maat_feather_t* _feather=(_Maat_feather_t*)feather;
|
||||
redisReply* reply=NULL;
|
||||
|
||||
if(strlen(_feather->redis_ip)>0&&_feather->redis_port!=0)
|
||||
{
|
||||
_feather->REDIS_MODE_ON=1;
|
||||
@@ -652,7 +653,7 @@ int Maat_initiate_feather(Maat_feather_t feather)
|
||||
MESA_handle_runtime_log(_feather->logger,RLOG_LV_FATAL,maat_module ,
|
||||
"At initiation: NO FULL_CFG_DIR or JSON_FILE_PATH. ");
|
||||
|
||||
return -1;
|
||||
return;
|
||||
}
|
||||
config_monitor_traverse(_feather->maat_version,
|
||||
_feather->full_dir,
|
||||
@@ -687,6 +688,15 @@ int Maat_initiate_feather(Maat_feather_t feather)
|
||||
_feather->maat_version=_feather->scanner->version;
|
||||
_feather->last_full_version=_feather->scanner->version;
|
||||
}
|
||||
return;
|
||||
}
|
||||
int Maat_initiate_feather(Maat_feather_t feather)
|
||||
{
|
||||
_Maat_feather_t* _feather=(_Maat_feather_t*)feather;
|
||||
if(_feather->DEFERRED_INIT_ON==0)
|
||||
{
|
||||
maat_read_full_config(_feather);
|
||||
}
|
||||
if(strlen(_feather->stat_file)==0)
|
||||
{
|
||||
if(_feather->stat_on==1)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "stream_fuzzy_hash.h"
|
||||
#include "gram_index_engine.h"
|
||||
|
||||
int MAAT_FRAME_VERSION_2_0_20170816=1;
|
||||
int MAAT_FRAME_VERSION_2_0_20170821=1;
|
||||
const char *maat_module="MAAT Frame";
|
||||
|
||||
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
||||
@@ -3168,6 +3168,10 @@ void *thread_rule_monitor(void *arg)
|
||||
//pthread_setname_np are introduced in glibc2.12
|
||||
//ret=pthread_setname_np(pthread_self(),maat_name);
|
||||
assert(ret>=0);
|
||||
if(feather->DEFERRED_INIT_ON!=0)
|
||||
{
|
||||
maat_read_full_config(feather);
|
||||
}
|
||||
while(feather->still_working)
|
||||
{
|
||||
usleep(feather->scan_interval_ms*1000);
|
||||
|
||||
@@ -355,6 +355,7 @@ struct _Maat_feather_t
|
||||
struct _Maat_scanner_t *update_tmp_scanner;
|
||||
MESA_lqueue_head garbage_q;
|
||||
int table_cnt;
|
||||
int DEFERRED_INIT_ON;
|
||||
int GROUP_MODE_ON;
|
||||
int REDIS_MODE_ON;
|
||||
int still_working;
|
||||
@@ -448,6 +449,7 @@ inline void ipv6_ntoh(unsigned int *v6_addr)
|
||||
void * HASH_fetch_by_id(MESA_htable_handle hash,int id);
|
||||
int HASH_add_by_id(MESA_htable_handle hash,int id,void*data);
|
||||
int HASH_delete_by_id(MESA_htable_handle hash,int id);
|
||||
void maat_read_full_config(_Maat_feather_t* _feather);
|
||||
void maat_stat_init(struct _Maat_feather_t* feather);
|
||||
void maat_stat_table(struct _Maat_table_info_t* p_table,int scan_len,struct timespec* start, struct timespec* end,int thread_num);
|
||||
void maat_stat_output(struct _Maat_feather_t* feather);
|
||||
|
||||
Reference in New Issue
Block a user