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.
This commit is contained in:
Aleksandra Martyniuk
2024-12-03 11:11:53 +01:00
parent 9fad3a621a
commit 0caffd67f8
3 changed files with 21 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
namespace locator {
class tablet_id;
enum class tablet_task_type;
}
namespace service {

View File

@@ -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();
}
}

View File

@@ -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> table_id;
std::optional<locator::tablet_task_type> task_type;
std::optional<locator::tablet_id> tablet_id;
locator::tablet_task_type get_task_type() const;
locator::tablet_id get_tablet_id() const;
};
}