From 0caffd67f893b539a8dd3426bd66dbe4d597eda7 Mon Sep 17 00:00:00 2001 From: Aleksandra Martyniuk Date: Tue, 3 Dec 2024 11:11:53 +0100 Subject: [PATCH] service: tasks: extend virtual_task_hint Extend virtual_task_hint to contain task_type and tablet_id. These fields would be used by tablet_virtual_task in the following patches. --- service/task_manager_module.hh | 1 + tasks/task_manager.cc | 14 ++++++++++++++ tasks/virtual_task_hint.hh | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/service/task_manager_module.hh b/service/task_manager_module.hh index 3c0c7d9eed..8e9fbb9e42 100644 --- a/service/task_manager_module.hh +++ b/service/task_manager_module.hh @@ -13,6 +13,7 @@ namespace locator { class tablet_id; +enum class tablet_task_type; } namespace service { diff --git a/tasks/task_manager.cc b/tasks/task_manager.cc index 8727a5e8e2..533060e55f 100644 --- a/tasks/task_manager.cc +++ b/tasks/task_manager.cc @@ -795,4 +795,18 @@ future<> task_manager::uninit_ms_handlers() { return make_ready_future(); } +locator::tablet_task_type virtual_task_hint::get_task_type() const { + if (!task_type.has_value()) { + on_internal_error(tmlogger, "tablet_virtual_task hint does not contain task type"); + } + return task_type.value(); +} + +locator::tablet_id virtual_task_hint::get_tablet_id() const { + if (!tablet_id.has_value()) { + on_internal_error(tmlogger, "tablet_virtual_task hint does not contain tablet_id"); + } + return tablet_id.value(); +} + } diff --git a/tasks/virtual_task_hint.hh b/tasks/virtual_task_hint.hh index 81a011d593..c5bcc0f9a9 100644 --- a/tasks/virtual_task_hint.hh +++ b/tasks/virtual_task_hint.hh @@ -8,12 +8,18 @@ #pragma once +#include "locator/tablets.hh" #include "schema/schema_fwd.hh" namespace tasks { struct virtual_task_hint { // Contains hints for all virtual tasks types. std::optional table_id; + std::optional task_type; + std::optional tablet_id; + + locator::tablet_task_type get_task_type() const; + locator::tablet_id get_tablet_id() const; }; }