ClickHouse/dbms/include/DB/Storages/MergeTree/ReshardingJob.h
Alexey Arno 6efc98d1f3 Merge
2016-03-01 20:47:53 +03:00

53 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <DB/Storages/AlterCommands.h>
#include <string>
namespace DB
{
class StorageReplicatedMergeTree;
/** Описание задачи перешардирования.
*/
struct ReshardingJob final
{
public:
ReshardingJob() = default;
/// Создаёт описание на основе его сериализованного представления.
ReshardingJob(const std::string & serialized_job);
ReshardingJob(const std::string & database_name_, const std::string & table_name_,
const std::string & partition_, const WeightedZooKeeperPaths & paths_,
const ASTPtr & sharding_key_expr_, const std::string & coordinator_id_);
ReshardingJob(const ReshardingJob &) = delete;
ReshardingJob & operator=(const ReshardingJob &) = delete;
ReshardingJob(ReshardingJob &&) = default;
ReshardingJob & operator=(ReshardingJob &&) = default;
operator bool() const;
/// Сериализует описание задачи.
std::string toString() const;
bool isCoordinated() const;
void clear();
public:
std::string database_name;
std::string table_name;
std::string partition;
WeightedZooKeeperPaths paths;
ASTPtr sharding_key_expr;
std::string coordinator_id;
StorageReplicatedMergeTree * storage = nullptr;
UInt64 block_number = 0;
bool is_aborted = false;
};
}