mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-07 00:50:56 +00:00
b6aa7542d0
Almost always it (and not activate()) is precisely what is needed.
40 lines
822 B
C++
40 lines
822 B
C++
#pragma once
|
|
|
|
#include <thread>
|
|
#include <Core/BackgroundSchedulePool.h>
|
|
#include <Common/ZooKeeper/Types.h>
|
|
#include <Core/Types.h>
|
|
#include <common/logger_useful.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class StorageReplicatedMergeTree;
|
|
|
|
|
|
/** Keeps track of changing the table structure in ZooKeeper and performs the necessary conversions.
|
|
*
|
|
* NOTE This has nothing to do with manipulating partitions,
|
|
* which are processed through the replication queue.
|
|
*/
|
|
class ReplicatedMergeTreeAlterThread
|
|
{
|
|
public:
|
|
ReplicatedMergeTreeAlterThread(StorageReplicatedMergeTree & storage_);
|
|
|
|
void start() { task->activateAndSchedule(); }
|
|
|
|
void stop() { task->deactivate(); }
|
|
|
|
private:
|
|
void run();
|
|
|
|
StorageReplicatedMergeTree & storage;
|
|
String log_name;
|
|
Logger * log;
|
|
BackgroundSchedulePool::TaskHolder task;
|
|
};
|
|
|
|
}
|