[CodeFormat] Clang-format cpp sources (#4965)
Clang-format all c++ source files.
This commit is contained in:
@ -15,58 +15,56 @@
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
#include "runtime/exec_env.h"
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include "agent/cgroups_mgr.h"
|
||||
#include "common/config.h"
|
||||
#include "common/logging.h"
|
||||
#include "gen_cpp/BackendService.h"
|
||||
#include "gen_cpp/FrontendService.h"
|
||||
#include "gen_cpp/HeartbeatService_types.h"
|
||||
#include "gen_cpp/TExtDataSourceService.h"
|
||||
#include "gen_cpp/TPaloBrokerService.h"
|
||||
#include "olap/page_cache.h"
|
||||
#include "olap/storage_engine.h"
|
||||
#include "plugin/plugin_mgr.h"
|
||||
#include "runtime/broker_mgr.h"
|
||||
#include "runtime/bufferpool/buffer_pool.h"
|
||||
#include "runtime/bufferpool/reservation_tracker.h"
|
||||
#include "runtime/cache/result_cache.h"
|
||||
#include "runtime/client_cache.h"
|
||||
#include "runtime/data_stream_mgr.h"
|
||||
#include "runtime/disk_io_mgr.h"
|
||||
#include "runtime/etl_job_mgr.h"
|
||||
#include "runtime/exec_env.h"
|
||||
#include "runtime/external_scan_context_mgr.h"
|
||||
#include "runtime/fragment_mgr.h"
|
||||
#include "runtime/heartbeat_flags.h"
|
||||
#include "runtime/load_channel_mgr.h"
|
||||
#include "runtime/load_path_mgr.h"
|
||||
#include "runtime/mem_tracker.h"
|
||||
#include "runtime/result_buffer_mgr.h"
|
||||
#include "runtime/result_queue_mgr.h"
|
||||
#include "runtime/mem_tracker.h"
|
||||
#include "runtime/routine_load/routine_load_task_executor.h"
|
||||
#include "runtime/small_file_mgr.h"
|
||||
#include "runtime/stream_load/load_stream_mgr.h"
|
||||
#include "runtime/stream_load/stream_load_executor.h"
|
||||
#include "runtime/thread_resource_mgr.h"
|
||||
#include "runtime/fragment_mgr.h"
|
||||
#include "runtime/load_channel_mgr.h"
|
||||
#include "runtime/tmp_file_mgr.h"
|
||||
#include "runtime/bufferpool/reservation_tracker.h"
|
||||
#include "runtime/cache/result_cache.h"
|
||||
#include "util/bfd_parser.h"
|
||||
#include "util/brpc_stub_cache.h"
|
||||
#include "util/debug_util.h"
|
||||
#include "util/doris_metrics.h"
|
||||
#include "util/mem_info.h"
|
||||
#include "util/metrics.h"
|
||||
#include "util/network_util.h"
|
||||
#include "util/parse_util.h"
|
||||
#include "util/mem_info.h"
|
||||
#include "util/debug_util.h"
|
||||
#include "olap/storage_engine.h"
|
||||
#include "olap/page_cache.h"
|
||||
#include "util/network_util.h"
|
||||
#include "util/bfd_parser.h"
|
||||
#include "runtime/etl_job_mgr.h"
|
||||
#include "runtime/load_path_mgr.h"
|
||||
#include "runtime/routine_load/routine_load_task_executor.h"
|
||||
#include "runtime/stream_load/load_stream_mgr.h"
|
||||
#include "runtime/stream_load/stream_load_executor.h"
|
||||
#include "runtime/small_file_mgr.h"
|
||||
#include "util/pretty_printer.h"
|
||||
#include "util/doris_metrics.h"
|
||||
#include "util/brpc_stub_cache.h"
|
||||
#include "util/priority_thread_pool.hpp"
|
||||
#include "agent/cgroups_mgr.h"
|
||||
#include "gen_cpp/BackendService.h"
|
||||
#include "gen_cpp/FrontendService.h"
|
||||
#include "gen_cpp/TPaloBrokerService.h"
|
||||
#include "gen_cpp/TExtDataSourceService.h"
|
||||
#include "gen_cpp/HeartbeatService_types.h"
|
||||
#include "runtime/heartbeat_flags.h"
|
||||
#include "plugin/plugin_mgr.h"
|
||||
|
||||
namespace doris {
|
||||
|
||||
Status ExecEnv::init(ExecEnv* env, const std::vector<StorePath>& store_paths) {
|
||||
Status ExecEnv::init(ExecEnv* env, const std::vector<StorePath>& store_paths) {
|
||||
return env->_init(store_paths);
|
||||
}
|
||||
|
||||
@ -83,24 +81,23 @@ Status ExecEnv::_init(const std::vector<StorePath>& store_paths) {
|
||||
_backend_client_cache = new BackendServiceClientCache(config::max_client_cache_size_per_host);
|
||||
_frontend_client_cache = new FrontendServiceClientCache(config::max_client_cache_size_per_host);
|
||||
_broker_client_cache = new BrokerServiceClientCache(config::max_client_cache_size_per_host);
|
||||
_extdatasource_client_cache = new ExtDataSourceServiceClientCache(config::max_client_cache_size_per_host);
|
||||
_extdatasource_client_cache =
|
||||
new ExtDataSourceServiceClientCache(config::max_client_cache_size_per_host);
|
||||
_pool_mem_trackers = new PoolMemTrackerRegistry();
|
||||
_thread_mgr = new ThreadResourceMgr();
|
||||
_thread_pool = new PriorityThreadPool(
|
||||
config::doris_scanner_thread_pool_thread_num,
|
||||
config::doris_scanner_thread_pool_queue_size);
|
||||
_etl_thread_pool = new PriorityThreadPool(
|
||||
config::etl_thread_pool_size,
|
||||
config::etl_thread_pool_queue_size);
|
||||
_thread_pool = new PriorityThreadPool(config::doris_scanner_thread_pool_thread_num,
|
||||
config::doris_scanner_thread_pool_queue_size);
|
||||
_etl_thread_pool = new PriorityThreadPool(config::etl_thread_pool_size,
|
||||
config::etl_thread_pool_queue_size);
|
||||
_cgroups_mgr = new CgroupsMgr(this, config::doris_cgroups);
|
||||
_fragment_mgr = new FragmentMgr(this);
|
||||
_result_cache = new ResultCache(config::query_cache_max_size_mb, config::query_cache_elasticity_size_mb);
|
||||
_result_cache = new ResultCache(config::query_cache_max_size_mb,
|
||||
config::query_cache_elasticity_size_mb);
|
||||
_master_info = new TMasterInfo();
|
||||
_etl_job_mgr = new EtlJobMgr(this);
|
||||
_load_path_mgr = new LoadPathMgr(this);
|
||||
_disk_io_mgr = new DiskIoMgr();
|
||||
_tmp_file_mgr = new TmpFileMgr(this),
|
||||
_bfd_parser = BfdParser::create();
|
||||
_tmp_file_mgr = new TmpFileMgr(this), _bfd_parser = BfdParser::create();
|
||||
_broker_mgr = new BrokerMgr(this);
|
||||
_load_channel_mgr = new LoadChannelMgr();
|
||||
_load_stream_mgr = new LoadStreamMgr();
|
||||
@ -149,31 +146,30 @@ Status ExecEnv::_init_mem_tracker() {
|
||||
return Status::InternalError(ss.str());
|
||||
}
|
||||
|
||||
int64_t buffer_pool_limit = ParseUtil::parse_mem_spec(
|
||||
config::buffer_pool_limit, &is_percent);
|
||||
int64_t buffer_pool_limit = ParseUtil::parse_mem_spec(config::buffer_pool_limit, &is_percent);
|
||||
if (buffer_pool_limit <= 0) {
|
||||
ss << "Invalid --buffer_pool_limit value, must be a percentage or "
|
||||
"positive bytes value or percentage: " << config::buffer_pool_limit;
|
||||
"positive bytes value or percentage: "
|
||||
<< config::buffer_pool_limit;
|
||||
return Status::InternalError(ss.str());
|
||||
}
|
||||
buffer_pool_limit = BitUtil::RoundDown(buffer_pool_limit, config::min_buffer_size);
|
||||
|
||||
int64_t clean_pages_limit = ParseUtil::parse_mem_spec(
|
||||
config::buffer_pool_clean_pages_limit, &is_percent);
|
||||
int64_t clean_pages_limit =
|
||||
ParseUtil::parse_mem_spec(config::buffer_pool_clean_pages_limit, &is_percent);
|
||||
if (clean_pages_limit <= 0) {
|
||||
ss << "Invalid --buffer_pool_clean_pages_limit value, must be a percentage or "
|
||||
"positive bytes value or percentage: " << config::buffer_pool_clean_pages_limit;
|
||||
"positive bytes value or percentage: "
|
||||
<< config::buffer_pool_clean_pages_limit;
|
||||
return Status::InternalError(ss.str());
|
||||
}
|
||||
|
||||
_init_buffer_pool(config::min_buffer_size, buffer_pool_limit, clean_pages_limit);
|
||||
|
||||
if (bytes_limit > MemInfo::physical_mem()) {
|
||||
LOG(WARNING) << "Memory limit "
|
||||
<< PrettyPrinter::print(bytes_limit, TUnit::BYTES)
|
||||
LOG(WARNING) << "Memory limit " << PrettyPrinter::print(bytes_limit, TUnit::BYTES)
|
||||
<< " exceeds physical memory of "
|
||||
<< PrettyPrinter::print(MemInfo::physical_mem(),
|
||||
TUnit::BYTES)
|
||||
<< PrettyPrinter::print(MemInfo::physical_mem(), TUnit::BYTES)
|
||||
<< ". Using physical memory instead";
|
||||
bytes_limit = MemInfo::physical_mem();
|
||||
}
|
||||
@ -190,12 +186,11 @@ Status ExecEnv::_init_mem_tracker() {
|
||||
RETURN_IF_ERROR(_disk_io_mgr->init(_mem_tracker));
|
||||
RETURN_IF_ERROR(_tmp_file_mgr->init());
|
||||
|
||||
int64_t storage_cache_limit = ParseUtil::parse_mem_spec(
|
||||
config::storage_page_cache_limit, &is_percent);
|
||||
int64_t storage_cache_limit =
|
||||
ParseUtil::parse_mem_spec(config::storage_page_cache_limit, &is_percent);
|
||||
if (storage_cache_limit > MemInfo::physical_mem()) {
|
||||
LOG(WARNING) << "Config storage_page_cache_limit is greater than memory size, config="
|
||||
<< config::storage_page_cache_limit
|
||||
<< ", memory=" << MemInfo::physical_mem();
|
||||
<< config::storage_page_cache_limit << ", memory=" << MemInfo::physical_mem();
|
||||
}
|
||||
StoragePageCache::create_global_cache(storage_cache_limit);
|
||||
|
||||
@ -204,8 +199,7 @@ Status ExecEnv::_init_mem_tracker() {
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
void ExecEnv::_init_buffer_pool(int64_t min_page_size,
|
||||
int64_t capacity,
|
||||
void ExecEnv::_init_buffer_pool(int64_t min_page_size, int64_t capacity,
|
||||
int64_t clean_pages_limit) {
|
||||
DCHECK(_buffer_pool == nullptr);
|
||||
_buffer_pool = new BufferPool(min_page_size, capacity, clean_pages_limit);
|
||||
@ -252,4 +246,4 @@ void ExecEnv::destroy(ExecEnv* env) {
|
||||
env->_destroy();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace doris
|
||||
|
||||
Reference in New Issue
Block a user