2021-07-05 19:58:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <Storages/MergeTree/MergeTreePartInfo.h>
|
|
|
|
#include <Storages/MergeTree/MergeTreeDataFormatVersion.h>
|
|
|
|
#include <Storages/MergeTree/ReplicatedMergeTreeLogEntry.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class DropPartsRanges
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
MergeTreeDataFormatVersion format_version;
|
|
|
|
|
|
|
|
std::map<std::string, MergeTreePartInfo> drop_ranges;
|
|
|
|
public:
|
|
|
|
|
|
|
|
explicit DropPartsRanges(MergeTreeDataFormatVersion format_version_)
|
|
|
|
: format_version(format_version_)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool isAffectedByDropRange(const ReplicatedMergeTreeLogEntry & entry, std::string & postpone_reason) const;
|
2021-07-06 08:36:39 +00:00
|
|
|
bool isAffectedByDropRange(const std::string & new_part_name, std::string & postpone_reason) const;
|
2021-07-05 19:58:36 +00:00
|
|
|
|
|
|
|
bool hasDropRange(const MergeTreePartInfo & new_drop_range_info) const;
|
|
|
|
|
|
|
|
void addDropRange(const ReplicatedMergeTreeLogEntryPtr & entry, Poco::Logger * log);
|
|
|
|
|
|
|
|
void removeDropRange(const ReplicatedMergeTreeLogEntryPtr & entry, Poco::Logger * log);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|