ClickHouse/src/Storages/MergeTree/MovesList.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
1.3 KiB
C++
Raw Normal View History

2022-10-25 13:56:46 +00:00
#pragma once
#include <Storages/MergeTree/BackgroundProcessList.h>
#include <Interpreters/StorageID.h>
#include <Common/Stopwatch.h>
#include <Common/CurrentMetrics.h>
#include <Poco/URI.h>
#include <boost/noncopyable.hpp>
namespace CurrentMetrics
{
extern const Metric Move;
}
namespace DB
{
struct MoveInfo
{
std::string database;
std::string table;
std::string partition_id;
2022-11-18 20:04:11 +00:00
std::string target_disk_name;
2022-11-07 20:33:25 +00:00
std::string target_disk_path;
2022-10-25 13:56:46 +00:00
UInt64 part_size;
Float64 elapsed;
UInt64 thread_id;
};
struct MovesListElement : private boost::noncopyable
{
const StorageID table_id;
const std::string partition_id;
2022-11-18 20:04:11 +00:00
const std::string target_disk_name;
2022-11-07 20:33:25 +00:00
const std::string target_disk_path;
const UInt64 part_size;
2022-10-25 13:56:46 +00:00
Stopwatch watch;
const UInt64 thread_id;
MovesListElement(
const StorageID & table_id_,
2022-11-07 20:33:25 +00:00
const std::string & partition_id_,
2022-11-18 20:04:11 +00:00
const std::string & target_disk_name_,
2022-11-07 20:33:25 +00:00
const std::string & target_disk_path_,
UInt64 part_size_);
2022-10-25 13:56:46 +00:00
MoveInfo getInfo() const;
};
/// List of currently processing moves
class MovesList final : public BackgroundProcessList<MovesListElement, MoveInfo>
{
private:
using Parent = BackgroundProcessList<MovesListElement, MoveInfo>;
public:
MovesList()
: Parent(CurrentMetrics::Move)
{}
};
}