From 69e99df039b6e2a3d734b0a6868c402e6c6dfba3 Mon Sep 17 00:00:00 2001 From: HappenLee Date: Sun, 26 Jan 2025 17:09:05 +0800 Subject: [PATCH] [Config](brpc) Add connection_type config for brpc --- be/src/common/config.cpp | 2 ++ be/src/common/config.h | 2 ++ be/src/util/brpc_client_cache.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index 267a12c0ecc99b..788b1cd246121e 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -1410,6 +1410,8 @@ DEFINE_mBool(enable_sleep_between_delete_cumu_compaction, "false"); DEFINE_mInt32(compaction_num_per_round, "1"); +DEFINE_mString(brpc_connection_type, "single"); + // clang-format off #ifdef BE_TEST // test s3 diff --git a/be/src/common/config.h b/be/src/common/config.h index 462ba5c8f36ab0..01df89eebf08cc 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -1495,6 +1495,8 @@ DECLARE_Bool(enable_table_size_correctness_check); DECLARE_mBool(enable_sleep_between_delete_cumu_compaction); DECLARE_mInt32(compaction_num_per_round); +// Set default of brpc_connection_type to "single/pooled/short". +DECLARE_String(brpc_connection_type); #ifdef BE_TEST // test s3 diff --git a/be/src/util/brpc_client_cache.cpp b/be/src/util/brpc_client_cache.cpp index c5a6488787879b..95c1a975c0bcc9 100644 --- a/be/src/util/brpc_client_cache.cpp +++ b/be/src/util/brpc_client_cache.cpp @@ -34,7 +34,7 @@ BrpcClientCache::BrpcClientCache(std::string protocol, std::string connection_type, std::string connection_group) : _protocol(protocol), - _connection_type(connection_type), + _connection_type(connection_type == "" ? config::brpc_connection_type : connection_type), _connection_group(connection_group) { if (connection_group == "streaming") { REGISTER_HOOK_METRIC(brpc_stream_endpoint_stub_count,