ClickHouse/programs/copier/TaskShard.h

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

57 lines
1.4 KiB
C++
Raw Normal View History

2022-10-20 13:56:40 +00:00
#pragma once
#include "Aliases.h"
#include "Internals.h"
#include "ClusterPartition.h"
2022-10-20 14:37:27 +00:00
#include "ShardPartition.h"
2022-10-20 13:56:40 +00:00
namespace DB
{
struct TaskTable;
struct TaskShard
{
2022-10-20 14:37:27 +00:00
TaskShard(TaskTable & parent, const Cluster::ShardInfo & info_);
2022-10-20 13:56:40 +00:00
TaskTable & task_table;
2022-10-20 14:37:27 +00:00
Cluster::ShardInfo info;
2022-10-20 13:56:40 +00:00
UInt32 numberInCluster() const;
UInt32 indexInCluster() const;
String getDescription() const;
String getHostNameExample() const;
/// Used to sort clusters by their proximity
ShardPriority priority;
/// Column with unique destination partitions (computed from engine_push_partition_key expr.) in the shard
ColumnWithTypeAndName partition_key_column;
/// There is a task for each destination partition
TasksPartition partition_tasks;
/// Which partitions have been checked for existence
/// If some partition from this lists is exists, it is in partition_tasks
std::set<String> checked_partitions;
/// Last CREATE TABLE query of the table of the shard
ASTPtr current_pull_table_create_query;
ASTPtr current_push_table_create_query;
/// Internal distributed tables
DatabaseAndTableName table_read_shard;
DatabaseAndTableName main_table_split_shard;
ListOfDatabasesAndTableNames list_of_split_tables_on_shard;
};
2022-10-20 14:37:27 +00:00
using TaskShardPtr = std::shared_ptr<TaskShard>;
using TasksShard = std::vector<TaskShardPtr>;
2022-10-20 13:56:40 +00:00
}