[PATCH]bugfix for switch expr engine
This commit is contained in:
@@ -56,10 +56,16 @@ enum maat_update_type {
|
||||
MAAT_UPDATE_TYPE_INC
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief auto means select engine automatically
|
||||
* regex rules always use hyperscan
|
||||
* literal rules: rule_num <= 50k, use hyperscan
|
||||
* rule_num > 50k, use rulescan
|
||||
*/
|
||||
enum maat_expr_engine {
|
||||
MAAT_EXPR_ENGINE_HS = 0, //hyperscan(default engine)
|
||||
MAAT_EXPR_ENGINE_RS, //rulescan
|
||||
MAAT_EXPR_ENGINE_AUTO
|
||||
MAAT_EXPR_ENGINE_HS = 0, //hyperscan
|
||||
MAAT_EXPR_ENGINE_RS, //rulescan
|
||||
MAAT_EXPR_ENGINE_AUTO //default
|
||||
};
|
||||
|
||||
struct ip_addr {
|
||||
|
||||
@@ -506,7 +506,11 @@ void *expr_runtime_new(void *expr_schema, size_t max_thread_num,
|
||||
expr_rt->ref_garbage_bin = garbage_bin;
|
||||
expr_rt->logger = logger;
|
||||
expr_rt->district_map = maat_kv_store_new();
|
||||
expr_rt->engine_type = schema->engine_type;
|
||||
if (schema->engine_type == MAAT_EXPR_ENGINE_AUTO) {
|
||||
expr_rt->engine_type = table_manager_get_expr_engine(schema->ref_tbl_mgr);
|
||||
} else {
|
||||
expr_rt->engine_type = schema->engine_type;
|
||||
}
|
||||
|
||||
expr_rt->hit_cnt = alignment_int64_array_alloc(max_thread_num);
|
||||
expr_rt->scan_cnt = alignment_int64_array_alloc(max_thread_num);
|
||||
|
||||
@@ -1138,7 +1138,7 @@ int table_manager_get_valid_column(struct table_manager *tbl_mgr, int table_id)
|
||||
enum maat_expr_engine table_manager_get_expr_engine(struct table_manager *tbl_mgr)
|
||||
{
|
||||
if (NULL == tbl_mgr) {
|
||||
return EXPR_ENGINE_TYPE_HS;
|
||||
return EXPR_ENGINE_TYPE_AUTO;
|
||||
}
|
||||
|
||||
return tbl_mgr->engine_type;
|
||||
|
||||
@@ -235,7 +235,7 @@ int main(int argc, char ** argv)
|
||||
{
|
||||
int ret=0;
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
g_logger = log_handle_create("./input_mode_gtest.log", 0);
|
||||
g_logger = log_handle_create("./maat_input_mode_gtest.log", 0);
|
||||
|
||||
char json_iris_path[NAME_MAX] = {0};
|
||||
snprintf(json_iris_path, sizeof(json_iris_path), "./%s_iris_tmp", json_filename);
|
||||
|
||||
Reference in New Issue
Block a user