This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch resource_ctx
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/resource_ctx by this push:
new 5172e41fb04 f
5172e41fb04 is described below
commit 5172e41fb04fb0793892180f17bff6dd7c62dfa3
Author: yiguolei <[email protected]>
AuthorDate: Sat Dec 7 19:34:24 2024 +0800
f
---
be/src/runtime/workload_management/resource_context.h | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/be/src/runtime/workload_management/resource_context.h
b/be/src/runtime/workload_management/resource_context.h
index 5f910c590d0..359564d4a7c 100644
--- a/be/src/runtime/workload_management/resource_context.h
+++ b/be/src/runtime/workload_management/resource_context.h
@@ -31,9 +31,15 @@
namespace doris {
// Any task that allow cancel should implement this class.
-class ResourceReclaimer {
+class TaskController {
+ ENABLE_FACTORY_CREATOR(TaskController);
+
public:
virtual Status cancel(Status cancel_reason) { return Status::OK(); }
+ virtual Status running_time(int64_t* running_time_msecs) {
+ *running_time_msecs = 0;
+ return Status::OK();
+ }
};
// Every task should have its own resource context. And BE may adjust the
resource
@@ -56,14 +62,16 @@ public:
CPUContext* cpu_context() { return cpu_context_.get(); }
MemoryContext* memory_context() { return memory_context_.get(); }
IOContext* io_context() { return io_context_.get(); }
- ResourceReclaimer* reclaimer() { return reclaimer_.get(); }
+ TaskController* task_controller() { return task_controller_.get(); }
void set_cpu_context(std::shared_ptr<CPUContext> cpu_context) {
cpu_context_ = cpu_context; }
void set_memory_context(std::shared_ptr<MemoryContext> memory_context) {
memory_context_ = memory_context;
}
void set_io_context(std::shared_ptr<IOContext> io_context) { io_context_ =
io_context; }
- void set_reclaimer(std::shared_ptr<ResourceReclaimer> reclaimer) {
reclaimer_ = reclaimer; }
+ void set_task_controller(std::shared_ptr<TaskController> task_controller) {
+ task_controller_ = task_controller;
+ }
void set_workload_group(std::shared_ptr<WorkloadGroup> wg) {
// update all child context's workload group property
@@ -77,7 +85,7 @@ private:
std::shared_ptr<CPUContext> cpu_context_ = nullptr;
std::shared_ptr<MemoryContext> memory_context_ = nullptr;
std::shared_ptr<IOContext> io_context_ = nullptr;
- std::shared_ptr<ResourceReclaimer> reclaimer_ = nullptr;
+ std::shared_ptr<TaskController> task_controller_ = nullptr;
// Workload group will own resource context, so that resource context only
have weak ptr for workload group.
// TODO: should use atomic weak ptr to avoid the concurrent modification
of the pointer.
std::weak_ptr<WorkloadGroup> workload_group_ = nullptr;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]