解决创建hash表时重复打印配置问题

This commit is contained in:
崔一鸣
2019-10-08 17:45:37 +08:00
parent 0ef167555a
commit 1b22879e90
3 changed files with 53 additions and 43 deletions

View File

@@ -2298,8 +2298,10 @@ extern "C" int kni_init(){
g_kni_handle->send_logger = send_logger;
//init traceid2pme_htable
traceid2pme_htable = kni_create_htable(profile, "traceid2pme_htable", NULL,
(void*)traceid2pme_htable_expire_notify_cb, local_logger);
struct kni_htable_opt opt;
memset(&opt, 0, sizeof(opt));
kni_get_htable_opt(&opt, profile, "traceid2pme_htable", NULL, (void*)traceid2pme_htable_expire_notify_cb, local_logger);
traceid2pme_htable = kni_create_htable("traceid2pme_htable", &opt, local_logger);
if(traceid2pme_htable == NULL){
KNI_LOG_ERROR(local_logger, "Failed at create traceid2pme_htable");
goto error_out;
@@ -2308,9 +2310,10 @@ extern "C" int kni_init(){
//init tuple2stream_htable
g_kni_handle->threads_handle = ALLOC(struct per_thread_handle, g_kni_handle->thread_count);
memset(&opt, 0, sizeof(opt));
kni_get_htable_opt(&opt, profile, "tuple2stream_htable", (void*)tuple2stream_htable_data_free_cb, NULL, local_logger);
for(int i = 0; i < g_kni_handle->thread_count; i++){
MESA_htable_handle tuple2stream_htable = kni_create_htable(profile, "tuple2stream_htable",
(void*)tuple2stream_htable_data_free_cb, NULL, local_logger);
MESA_htable_handle tuple2stream_htable = kni_create_htable("tuple2stream_htable", &opt, local_logger);
if(tuple2stream_htable == NULL){
KNI_LOG_ERROR(local_logger, "Failed at kni_create_htable, table = tuple2stream_htable");
goto error_out;