parent_data struct contains info that is common for each task, not only in parent-child relationship context. To use it this way without confusion, its name is changed to task_info. In order to be able to widely and comfortably use task_info, it is moved from tasks/task_manager.hh to tasks/types.hh and slightly extended.
30 lines
499 B
C++
30 lines
499 B
C++
/*
|
|
* Copyright (C) 2022-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "utils/UUID.hh"
|
|
|
|
namespace tasks {
|
|
|
|
using task_id = utils::tagged_uuid<struct task_id_tag>;
|
|
|
|
struct task_info {
|
|
task_id id;
|
|
unsigned shard;
|
|
|
|
task_info() noexcept : id(task_id::create_null_id()) {}
|
|
task_info(task_id id, unsigned parent_shard) noexcept : id(id), shard(parent_shard) {}
|
|
|
|
operator bool() const noexcept {
|
|
return bool(id);
|
|
}
|
|
};
|
|
|
|
}
|