This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 8bed900f057a283a00496471cbf70d796d08c2d8
Author: wangbo <wan...@apache.org>
AuthorDate: Sat Sep 9 00:56:39 2023 +0800

    [improvement](executor)Add name for task scheduler #23983
---
 be/src/pipeline/task_scheduler.cpp | 2 +-
 be/src/pipeline/task_scheduler.h   | 6 ++++--
 be/src/runtime/exec_env_init.cpp   | 6 ++++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/be/src/pipeline/task_scheduler.cpp 
b/be/src/pipeline/task_scheduler.cpp
index 9d783005af..1f5d5e58b6 100644
--- a/be/src/pipeline/task_scheduler.cpp
+++ b/be/src/pipeline/task_scheduler.cpp
@@ -211,7 +211,7 @@ TaskScheduler::~TaskScheduler() {
 Status TaskScheduler::start() {
     int cores = _task_queue->cores();
     // Must be mutil number of cpu cores
-    ThreadPoolBuilder("TaskSchedulerThreadPool")
+    ThreadPoolBuilder(_name)
             .set_min_threads(cores)
             .set_max_threads(cores)
             .set_max_queue_size(0)
diff --git a/be/src/pipeline/task_scheduler.h b/be/src/pipeline/task_scheduler.h
index 1fcbe2c068..bcdbcf1a48 100644
--- a/be/src/pipeline/task_scheduler.h
+++ b/be/src/pipeline/task_scheduler.h
@@ -78,10 +78,11 @@ private:
 class TaskScheduler {
 public:
     TaskScheduler(ExecEnv* exec_env, std::shared_ptr<BlockedTaskScheduler> 
b_scheduler,
-                  std::shared_ptr<TaskQueue> task_queue)
+                  std::shared_ptr<TaskQueue> task_queue, std::string name)
             : _task_queue(std::move(task_queue)),
               _blocked_task_scheduler(std::move(b_scheduler)),
-              _shutdown(false) {}
+              _shutdown(false),
+              _name(name) {}
 
     ~TaskScheduler();
 
@@ -100,6 +101,7 @@ private:
     std::vector<std::unique_ptr<std::atomic<bool>>> _markers;
     std::shared_ptr<BlockedTaskScheduler> _blocked_task_scheduler;
     std::atomic<bool> _shutdown;
+    std::string _name;
 
     void _do_work(size_t index);
     // after _try_close_task, task maybe destructed.
diff --git a/be/src/runtime/exec_env_init.cpp b/be/src/runtime/exec_env_init.cpp
index 7f88efe689..b023fa2f74 100644
--- a/be/src/runtime/exec_env_init.cpp
+++ b/be/src/runtime/exec_env_init.cpp
@@ -198,12 +198,14 @@ Status ExecEnv::init_pipeline_task_scheduler() {
     // TODO pipeline task group combie two blocked schedulers.
     auto t_queue = 
std::make_shared<pipeline::MultiCoreTaskQueue>(executors_size);
     auto b_scheduler = 
std::make_shared<pipeline::BlockedTaskScheduler>(t_queue);
-    _pipeline_task_scheduler = new pipeline::TaskScheduler(this, b_scheduler, 
t_queue);
+    _pipeline_task_scheduler =
+            new pipeline::TaskScheduler(this, b_scheduler, t_queue, 
"WithoutGroupTaskSchePool");
     RETURN_IF_ERROR(_pipeline_task_scheduler->start());
 
     auto tg_queue = 
std::make_shared<pipeline::TaskGroupTaskQueue>(executors_size);
     auto tg_b_scheduler = 
std::make_shared<pipeline::BlockedTaskScheduler>(tg_queue);
-    _pipeline_task_group_scheduler = new pipeline::TaskScheduler(this, 
tg_b_scheduler, tg_queue);
+    _pipeline_task_group_scheduler =
+            new pipeline::TaskScheduler(this, tg_b_scheduler, tg_queue, 
"WithGroupTaskSchePool");
     RETURN_IF_ERROR(_pipeline_task_group_scheduler->start());
 
     return Status::OK();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to