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:
@@ -13,6 +13,7 @@
|
||||
|
||||
namespace locator {
|
||||
class tablet_id;
|
||||
enum class tablet_task_type;
|
||||
}
|
||||
|
||||
namespace service {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user